Is it possible to have mhvtl update library_contents.x dynamically to make the library more persistent?
For example, I used mktape then used vtlcmd to inject it into the map, and netbackup picked it up and moved it to an empty slot. All good except next time I start mhvtl my tape is outside the library again.
Re: Updating library_contents on exit - enhancement?
To date, this has been deliberate (i.e. by design) as the primary
focus of this vtl has been to assist with supporting NetBackup.
Hence after testing/re-producing a customer's issue, it is nice to
re-start everything and have it all come back to default.
It also reproduces the "what if the customer changes the library
configuration without telling the backup software" scenario.
I'm more than willing to accept a patch which optionally re-writes the
library_contents.XX on exit.
It is something I plan on adding when I finally get around to the xml
config file format. But that won't be in the foreseeable future.
An entry in device.conf like
PERSISTENT: yes | no
So if the "PERSISTENT: yes" will re-write the config file, where
"PERSISTENT: no" will keep current behaviour.
On Thu, Apr 14, 2011 at 8:50 PM, salvus [via MHVTL - Linux Virtual
Tape Library - Community Forums]
<[hidden email]> wrote:
This patch adds the following functionality.
- On startup - check for /etc/mhvtl/library_contents.XX.persist file
If it does not exist - read /etc/mhvtl/library_contents.XX (2nd bit is as per current behaviour)
- On shutdown - dump current config to /etc/mhvtl/library_contents.XX.persist
OK - the previous patch (persistent_library-1.diff) should be good..
I attempted to 'cheat' and combine the persistent library patch into one combined patch.. I forgot to roll up one patch into the original 'persistent_library.diff' - not directly related to persistent library patch but is in the code path..
So you have three options:
1. Apply patch 0001-vtllibrary-call-cleanup.... patch in this posting and the apply the persistent_library.diff first posted.
2. Apply persistent_library-1.diff posted earlier
3. Apply the three git-formatted patches in this posting..
Apologies for such a botch job of supplying a patch..
I run mhvtl daemon with the patch. Than I've stopped the daemon - file library-contents.10.persist was created but it was completely empty.
Please make sure you manually remove library_contents.10.persist before restarting mhVTL - otherwise it will attempt to read zero data from this blank file.. Obviously, then if you exit, it will resave 'blank' amount of data..
Removing the .persist file(s) will force the next load to read library_contents.XX
Another patch - on top of persistent_library-1.diff
This adds/changes the following behaviour:
- Don't read (or update on exit) library_contents.<id>.persist if "PERSIST: " is false in device.conf
- Read library_contents.<id> if it has a newer modify date to library_contents.<id>.persist