Add-VBRBackupJob specify ESX server

PowerShell script exchange

Add-VBRBackupJob specify ESX server

Veeam Logoby jhicks » Wed Jul 07, 2010 2:52 pm

Alright I give. :cry: I've tried to make sense of the documentation and example for creating a new backup job but either I'm missing something or there is an element missing from the cmdlet. How do you specify which ESX server to connect to for backup? Whenever I try to setup a job, it tries to connect to an ESX server that is currently offline.

What I want to do is create a backup job that will go through all VMS in the store, DataStore2 from the server called ESX and back them up locally to G:\datastore2. This is the most recent version of my expression, which fails.

Add-VBRBackupJob -Name "Dstore2_Backup" -Type VDDK -mode san -Folder g:\datastore2 -objects DataStore2 -host "My Computer" -FileName g:\dstore2.vbk

I'm suspecting I have to set the right value for -objects but I'm not sure how.
jhicks
Novice
 
Posts: 6
Liked: never
Joined: Fri Dec 11, 2009 2:35 pm
Full Name: Jeffery Hicks

Re: Add-VBRBackupJob specify ESX server

Veeam Logoby Vitaliy S. » Wed Jul 07, 2010 3:20 pm

Hello Jeffery,

You cannot choose a datastore as a container to backup VMs from. This feature will be delivered with v5. I'm not a great PowerShell expert, but I would recommend you to try using the following syntax. That should allow you to choose every VM located on the ESX.SERVER.LOCAL host:

Code: Select all
Add-VBRBackupJob -Name "Dstore2_Backup" -Type VDDK -mode san -Folder g:\datastore2 -objects ESX.SERVER.LOCAL -host "My Computer" -FileName g:\dstore2.vbk

Additionally, please have a look at this topic which contains some useful information about using PowerShell. There you will also find a link to the script example created by one of our customers, which he posted in his blog - Powershell cmdlets

Hope it helps!
Vitaliy S.
Veeam Software
 
Posts: 19564
Liked: 1103 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: Add-VBRBackupJob specify ESX server

Veeam Logoby jhicks » Wed Jul 07, 2010 5:40 pm

I ended up removing my offline VM from the list. It didn't have any backups yet so it wasn't a big deal. Once that was done I was able to get the command to work. Allthough I also realized I was specifying the folder name and not the actual VM name for -object. But even so, it seems you need to be able to specify a server name because what happens if you happen to have VMs on different hosts that happen to have the same name?

Using PowerCLI and Veeam, I created my job like this:

$v=@()
get-vm -Datastore datastore2 | foreach {$v+=$_.name}
Add-VBRBackupJob -Name "Dstore2_Backup" -Type VDDK -mode san -Folder g:\datastore2 -objects $v -host "MyComputer" -FileName dstore2
jhicks
Novice
 
Posts: 6
Liked: never
Joined: Fri Dec 11, 2009 2:35 pm
Full Name: Jeffery Hicks

Re: Add-VBRBackupJob specify ESX server

Veeam Logoby Vitaliy S. » Thu Jul 08, 2010 11:23 am

In case you have VMs with the same name on different hosts, they will be both added to the job and processed using the unique moref ID.
Vitaliy S.
Veeam Software
 
Posts: 19564
Liked: 1103 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests