PowerShell script exchange
Post Reply
vmm
Service Provider
Posts: 15
Liked: never
Joined: Nov 23, 2015 10:09 am
Full Name: Marat Akhmetianov
Contact:

Restore vApp in vCloud Director to different resources

Post by vmm »

Hi!

We need to do a script which can restore a vApp in vCloud Director no only to different OrgVDC or Organization but also to a different resources if they are unavailable (datastore and other settings).

Code: Select all

$restoreparams=Get-VBRRestorePoint -Backup $backup | Where {$_.Name -eq "vApp_01"} | New-VBRvCloudVAppRestoreSettings
$restoreparams.OrgVdc=Find-VBRvCloudEntity -OrganizationVdc -Name "Org_02"
$restoreparams.Org=Find-VBRvCloudEntity -Organization -Name "Org_02"
Start-VBRvCloudRestoreVApp -RestoreParams $restoreparams
vmm
Service Provider
Posts: 15
Liked: never
Joined: Nov 23, 2015 10:09 am
Full Name: Marat Akhmetianov
Contact:

Re: Restore vApp in vCloud Director to different resources

Post by vmm »

As far as I see for vApp we can't do that. The only possible solution is for VM.

What is wrong with these commands:

Code: Select all

$restorepoint = Get-VBRBackup -Name "cloud" | Get-VBRRestorePoint -Name *vApp-Templ-CentOS-7* | Sort-Object $_.creationtime -Descending | Select -First 1
$vapp = Find-VBRvCloudEntity -vApp -Name "vApp_CentOS7_V3"
$profile = Find-VBRvCloudEntity -StorageProfile -Name *
$datastore = Find-VBRvCloudEntity -Datastore -Name "Solidfire-test-1"
$template = Find-VBRvCloudEntity -VmTemplate -Name "vApp-Templ-CentOS-7"
Start-VBRvCloudRestoreVm -RestorePoint $restorepoint -vApp $vapp -StorageProfile $profile -vCloudDatastore $datastore -VmTemplate $template -PowerUp
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests