-
- Veteran
- Posts: 254
- Liked: 14 times
- Joined: Nov 23, 2015 10:56 pm
- Full Name: Peter Shute
- Contact:
Logging manual tape changes
Is there a way to get Veeam to log which tape is in the drive at a particular time of day?
We have a single manual tape drive, and I want to check if people are changing the tape in between weekly backups. E.g. On Tuesday someone might put in the correct tape for the following Monday's backup, but someone, for some reason, manually ejects it and puts in a different one on Thursday. Is there any record kept of that change, and if not, is there a way to get it to make one?
If I run an inventory on the drive, it will display which tape is loaded, but it doesn't list that tape name in the job history. Even if it did, is there a way to schedule an inventory?
We have a single manual tape drive, and I want to check if people are changing the tape in between weekly backups. E.g. On Tuesday someone might put in the correct tape for the following Monday's backup, but someone, for some reason, manually ejects it and puts in a different one on Thursday. Is there any record kept of that change, and if not, is there a way to get it to make one?
If I run an inventory on the drive, it will display which tape is loaded, but it doesn't list that tape name in the job history. Even if it did, is there a way to schedule an inventory?
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: Logging manual tape changes
Hi,
You can use PowerShell cmdlets to check what tape is in the drive:
That will return you information about current tape. Is that what you need?
Thank you.
You can use PowerShell cmdlets to check what tape is in the drive:
Code: Select all
Get-VBRTapeMedium -Drive (Get-VBRTapeDrive -name "Name of your drive")
Thank you.
-
- Veteran
- Posts: 254
- Liked: 14 times
- Joined: Nov 23, 2015 10:56 pm
- Full Name: Peter Shute
- Contact:
Re: Logging manual tape changes
Thanks, that will be very useful.
We only have one tape drive. Is it correct that we can omit the -name parameter?
Initially, the command returned no results. I suspect this was because Veeam thought the drive was empty because I just manually changed the tape this morning. It returned results after an inventory, so it looks like my script will have to do an inventory first. I can't get the inventory CmdLet to work. Is this correct:
Get-VBRTapeDrive|Start-VBRTapeInventory
That command seems to work fine after running an inventory from the GUI, IF there's a tape in it. But if it thinks the drive is empty, the command above crashes:
"Start-VBRTapeInventory : Cannot validate argument on parameter 'Medium'. The argument is null."
I tried this instead:
Get-VBRTapeLibrary|Start-VBRTapeInventory
But it doesn't do anything. It still thinks the drive is in the previous state (empty/loaded). What do I have to do to get it to do an inventory?
Also, when I read your response last night, there was a simpler command. Did you edit it?
We only have one tape drive. Is it correct that we can omit the -name parameter?
Initially, the command returned no results. I suspect this was because Veeam thought the drive was empty because I just manually changed the tape this morning. It returned results after an inventory, so it looks like my script will have to do an inventory first. I can't get the inventory CmdLet to work. Is this correct:
Get-VBRTapeDrive|Start-VBRTapeInventory
That command seems to work fine after running an inventory from the GUI, IF there's a tape in it. But if it thinks the drive is empty, the command above crashes:
"Start-VBRTapeInventory : Cannot validate argument on parameter 'Medium'. The argument is null."
I tried this instead:
Get-VBRTapeLibrary|Start-VBRTapeInventory
But it doesn't do anything. It still thinks the drive is in the previous state (empty/loaded). What do I have to do to get it to do an inventory?
Also, when I read your response last night, there was a simpler command. Did you edit it?
-
- Veteran
- Posts: 254
- Liked: 14 times
- Joined: Nov 23, 2015 10:56 pm
- Full Name: Peter Shute
- Contact:
Re: Logging manual tape changes
It seems that this command does work, but with a delay. It seems fairly quick when a tape has just been inserted, but takes over a minute when one has just been ejected (manually). (Timed at 95 seconds.)pshute wrote:I tried this instead:
Get-VBRTapeLibrary|Start-VBRTapeInventory
But it doesn't do anything. It still thinks the drive is in the previous state (empty/loaded). What do I have to do to get it to do an inventory?
How can the script tell when the inventory is finished?
-
- Product Manager
- Posts: 20413
- Liked: 2301 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Logging manual tape changes
You can use -Wait switch, so that, script proceeds to the next line only when the previous command finishes:
Thanks.
Code: Select all
Start-VBRTapeInventory -Wait
-
- Veteran
- Posts: 254
- Liked: 14 times
- Joined: Nov 23, 2015 10:56 pm
- Full Name: Peter Shute
- Contact:
Re: Logging manual tape changes
Thanks, that does the job. Why does it take so long when the drive is empty?
And why does:
Get-VBRTapeDrive|Start-VBRTapeInventory
crash when the drive is empty?
And why does:
Get-VBRTapeDrive|Start-VBRTapeInventory
crash when the drive is empty?
-
- Veteran
- Posts: 254
- Liked: 14 times
- Joined: Nov 23, 2015 10:56 pm
- Full Name: Peter Shute
- Contact:
Re: Logging manual tape changes
And is there a way to get the results into the Veeam history? I can email them somewhere, but it would be nice to have a record that can be examined in Veeam itself.
-
- Product Manager
- Posts: 20413
- Liked: 2301 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Logging manual tape changes
Can you initiate the same operation via GUI to limit the scope of potential suspects? With what particular error does it crash?crash when the drive is empty?
Could you elaborate on what results are meant here?And is there a way to get the results into the Veeam history?
Thanks.
-
- Veteran
- Posts: 254
- Liked: 14 times
- Joined: Nov 23, 2015 10:56 pm
- Full Name: Peter Shute
- Contact:
Re: Logging manual tape changes
The command that crashes is:v.Eremin wrote: Can you initiate the same operation via GUI to limit the scope of potential suspects? With what particular error does it crash?
Code: Select all
Get-VBRTapeDrive|Start-VBRTapeInventory
"Start-VBRTapeInventory : Cannot validate argument on parameter 'Medium'. The argument is null."
I'm now using:
Code: Select all
Get-VBRTapeLibrary|Start-VBRTapeInventory
The results I'm returning are the name of the tape in the drive, or "Drive empty". I would like to log that, somehow. The inventory command is automatically logged in the Veeam History, but not the name of the tape it found. I'd like to add that too, if possible.Could you elaborate on what results are meant here?
-
- Product Manager
- Posts: 20413
- Liked: 2301 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Logging manual tape changes
It must be related to the different objects that are returned by each cmdlet. Get-VBRDrive returns a drive object, while Get-VBRTapeLibrary a library one.I'd like to know why the difference in behaviour.
The Start-VBRTapeInvetory works either with library or with tape object. Thus, it fails when you pass a drive object to it through a pipeline.
If I'm not mistaken, after inventory a tape stays in drive. So, once inventory is finished, you can query a drive and check what medium is present there. This should be your cassette that has been just inventoried.The results I'm returning are the name of the tape in the drive, or "Drive empty". I would like to log that, somehow.
Thanks.
-
- Veteran
- Posts: 254
- Liked: 14 times
- Joined: Nov 23, 2015 10:56 pm
- Full Name: Peter Shute
- Contact:
Re: Logging manual tape changes
In case anyone else is trying the same thing, I've noticed that Get-VBRTapeLibrary|Start-VBRTapeInventory -Wait fails after I've manually ejected and then inserted a brand new tape (i.e. unnamed). I'm now testing for inventory failure, and retrying if necessary:
Code: Select all
$i=Get-VBRTapeLibrary|Start-VBRTapeInventory -Wait
if ($i.Result -eq "Failed") {$i=Get-VBRTapeLibrary|Start-VBRTapeInventory -Wait}
-
- Product Manager
- Posts: 20413
- Liked: 2301 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Logging manual tape changes
I'm wondering whether it crashes with the "Cannot validate argument" error which then goes away once the operation is retried. Thanks.
Who is online
Users browsing this forum: Google [Bot] and 15 guests