-
- Novice
- Posts: 3
- Liked: 1 time
- Joined: Dec 30, 2015 7:27 am
- Full Name: Alexey Miasoedov
- Contact:
Add vCloud vApp/VM to the existing backup job
Which cmdlets should I use to add vCloud vApp/VM to the existing backup job? I struggled to do this with Add-VBRJobObject / Add-VBRViJobObject.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
What particular issue you came across while trying to add vCD entity to a job via Add-VBRViJobObject? Also, is it a vCD backup job?
-
- Novice
- Posts: 3
- Liked: 1 time
- Joined: Dec 30, 2015 7:27 am
- Full Name: Alexey Miasoedov
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
You cannot pass an item of type CVcdVmItem (returned by Find-VBRvCloudEntity) to Add-VBRViJobObject cmdlet (requires IViItem).
Here is an example:
Code: Select all
public class CVcdVmItem : IVcdItem, IVmItem, IItem, IEquatable<CVcdVmItem>
public interface IViItem : IItem
Code: Select all
$cloud_vm = Find-VBRvCloudEntity -Name 'CARROLLWEB01' -Server $vCloud | ? Type -eq Vm
$test_job = Get-VBRJob -Name TestBackupJob
$test_job.BackupPlatform
EVcd
Add-VBRViJobObject -Job $test_job -Entities $cloud_vm
Add-VBRViJobObject : Cannot bind parameter 'Entities'. Cannot convert the "Veeam.Backup.Core.Infrastructure.CVcdVmItem" value of type
"Veeam.Backup.Core.Infrastructure.CVcdVmItem" to type "Veeam.Backup.Core.Infrastructure.IViItem".
-
- VP, Product Management
- Posts: 6035
- Liked: 2860 times
- Joined: Jun 05, 2009 12:57 pm
- Full Name: Tom Sightler
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
I don't think there's a Powershell cmdlet to do this, although perhaps someone will correct me. However, I've successfully used this workaround:
Code: Select all
$cloud_vm = Find-VBRvCloudEntity -Name 'CARROLLWEB01' -Server $vCloud | ? Type -eq Vm
$test_job = Get-VBRJob -Name TestBackupJob
$added = $failed = $null
[Veeam.Backup.Core.Infrastructure.CJobItemsHelper]::TryAddItemsToJob($test_job, $cloud_vm, [ref] $added, [ref] $failed)
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
I was about to write the same. Current vCD commandlets allow to add objects only during job creation. In order to add objects to existing job you have to load assembly and work with the mentioned methods. Thanks.
-
- Novice
- Posts: 3
- Liked: 1 time
- Joined: Dec 30, 2015 7:27 am
- Full Name: Alexey Miasoedov
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
Thank you guys! This works perfectly.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
You're welcome. By the way, thank you for raising that again, we'll see what can be done in this regard in future.
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Sep 01, 2017 1:15 pm
- Full Name: Sebastian Reitter
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
is this done yet?v.Eremin wrote:You're welcome. By the way, thank you for raising that again, we'll see what can be done in this regard in future.
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Sep 01, 2017 1:15 pm
- Full Name: Sebastian Reitter
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
Thanks, this helped me!
Did yozu address this in the mean time?
Did yozu address this in the mean time?
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
Nope, however, the provided workaround that includes loading assembly should be still a way to go. Thanks.
-
- Lurker
- Posts: 1
- Liked: never
- Joined: Dec 08, 2017 1:48 pm
- Full Name: T. Konefal
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
In order to back up a vApp I have code like this, but it is PAINFULLY slow (nearly a minute per query). I'm unable to change the vcdsystem type to anything else and still get a result for the find-vbrvcloudentity call. Using find-vbrvientity doesn't work for vApps.
Is there a faster way to get this object so I can feed it to the TryAddItemsToJob call?
Code: Select all
$s = get-vbrserver -type vcdsystem
$vcloudvApp = find-vbrvcloudentity -name 'Entity' -server $s -vApp
...
Code: Select all
[Veeam.Backup.Core.Infrastructure.CJobItemsHelper]::TryAddItemsToJob($test_job, $cloud_vm, [ref] $added, [ref] $failed)
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Oct 14, 2016 2:31 pm
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
Did anybody find a better/faster solution for adding vApps to an existing job?
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
As far as I'm concerned, currently that is the only workaround available. Thanks.
-
- Service Provider
- Posts: 25
- Liked: 2 times
- Joined: Jan 08, 2019 2:47 pm
- Full Name: Dominic Lapointe
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
Did anybody find a way to add vCloud VDC instead of just vApps to an existing job?
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Add vCloud vApp/VM to the existing backup job
Hi Dominic,
Try the code below:
Thanks,
Oleg
Try the code below:
Code: Select all
$entity = Find-VBRvCloudEntity -Name 'organization-vdc-1' -OrganizationVdc
$job = Get-VBRJob -Name 'VCLOUD-BACKUP'
Add-VBRvCloudJobObject -Job $job -Entities $entity
Oleg
Who is online
Users browsing this forum: No registered users and 22 guests