PowerShell script exchange
Post Reply
Jarvis
Lurker
Posts: 2
Liked: never
Joined: Apr 29, 2021 9:28 am
Full Name: Dirk Nebermann

Automate Tape Copy/Cloning

Post by Jarvis »

Hi there,

I'm testing currently the new Veeam v11 feature to copy/duplicate/clone tapes. The feature is available in the GUI as also via PowerShell, but must be executed manually. Manually executed in the GUI the feature is working as expected fine.

It would be nicer, if I could to automate this part :D .... so directly after a File2Tape/Backup2Tape Job as a Powershell Post-Script the previously written tapes will be cloned. I made some test the Start-VBRTapeCopy PS commandlet based on the media pool, but I received no satisfied result so far like that with appropriate param depending tapes were not copied.

f.ex. (just simple)

Code: Select all

$mp-source = Get-VBRTapeMediaPool -Name "mp-source"
$tape = Get-VBRTapeMedium -MediaPool $mp-source | Sort LastWriteTime -Descending | Select -First 1
$mp-clone = Get-VBRTapeMediaPool -Name "mp-clone"

Start-VBRTapeCopy -TapeMedium $tape -TargetMediaPool $mp-clone -Wait -EnableHardwareCompression -AddDependentMediumAutomatically -PreserveOriginalRetention
Probably one of you have a better approach or also has already implemented something similar successfully in an own Veeam Backup environment.

Regards
J.

PetrM
Veeam Software
Posts: 1340
Liked: 209 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: Automate Tape Copy/Cloning

Post by PetrM »

Hi Dirk,

Would you be so kind to elaborate a bit more on the result of script running, what happens when you execute it?

Thanks!

Jarvis
Lurker
Posts: 2
Liked: never
Joined: Apr 29, 2021 9:28 am
Full Name: Dirk Nebermann

Re: Automate Tape Copy/Cloning

Post by Jarvis »

Hi PetrM,

the aim of this small script will
1.) define source Media Pool, where the File2Tape/Backup2Tape Medias are located.
2.) getting the very latest tape in this pool to which data has been written
3.) define a target media pool for the cloned/copied tapes
4.) starting Tape Copy Job of the latest tape in source media pool including the related dependent tapes

Result: Job is starting as expected. In case there was originally one source tape it is getting cloned to the target media pool. In case the media set consisted based on several tapes, still only the latest tape is getting cloned.
So it looks currently a little like the param "-AddDependentMediumAutomatically" is being ignored. If I would copy the tape in the Veeam Management Console then the wizard is asking correctly if the dependent tapes should be added ... which actually works there.

Regards
J.

PetrM
Veeam Software
Posts: 1340
Liked: 209 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: Automate Tape Copy/Cloning

Post by PetrM »

Hi Dirk,

Thanks for reply. The fact that the behavior is different when you perform the same actions on UI makes me think that we're discussing a technical issue related to the parameter being ignored. From my point of view, you should contact our support team and ask them to have a closer look at the problem.

Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests