-
- Influencer
- Posts: 12
- Liked: 1 time
- Joined: Apr 15, 2011 1:26 pm
Removing a single VM from replicas
Hello,
in a Powershell script I need to delete (from disk) only a particular replica VM among all those created by a given Veeam 6.1 replication job (ie, looking at Veeam shell under "Replicas" and expanding the replica set with the name of the job, I need to just remove (and delete from disk) VM1, leaving VM2 and VM3 in place).
Can someone please provide an example of how to do that through Veeam cmdlets? I tried using remove-vbrrestoreplica and the command seems to complete successfully but the replica VM does not get deleted,
Here's what I tried:
Get-VBRReplica -Name "Test Replication Job" | get-vbrrestorepoint | remove-vbrrestorepoint -Name VM1
TIA
E.
in a Powershell script I need to delete (from disk) only a particular replica VM among all those created by a given Veeam 6.1 replication job (ie, looking at Veeam shell under "Replicas" and expanding the replica set with the name of the job, I need to just remove (and delete from disk) VM1, leaving VM2 and VM3 in place).
Can someone please provide an example of how to do that through Veeam cmdlets? I tried using remove-vbrrestoreplica and the command seems to complete successfully but the replica VM does not get deleted,
Here's what I tried:
Get-VBRReplica -Name "Test Replication Job" | get-vbrrestorepoint | remove-vbrrestorepoint -Name VM1
TIA
E.
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Removing a single VM from replicas
Hi.
As far as I can understand, you did only part of all necessary actions.
Step-by-step plan for your issue should look like this:
1.Find and select the job that has the VM-object you’re going to exclude.
2.Find and select the VM-object you’re going to exclude.
3.Exclude the VM-object from this job.
4.Delete the excluded object.
5.Delete restore point related to the VM.
In PowerShell console:
That’s all.
Truth be told, I’ve used this script in earnest. Still, for the purpose of complete safety I strongly recommend you trying it first in test environment before implementing.
Hope this helps.
Thanks.
As far as I can understand, you did only part of all necessary actions.
Step-by-step plan for your issue should look like this:
1.Find and select the job that has the VM-object you’re going to exclude.
2.Find and select the VM-object you’re going to exclude.
3.Exclude the VM-object from this job.
4.Delete the excluded object.
5.Delete restore point related to the VM.
In PowerShell console:
Code: Select all
$job=Get-VBRJob | ?{$_.Name –eq “Name of your job”}
$object=Get-VBRJobObject –job ($job)| ?{$_.Name –eq “Name of you VM-object”}
Remove-VBRJobObject –job ($job) –object ($object)
$object.delete()
Get-VBRReplica | ?{$_.Name –eq “Name of your job”}| Get-VbrRestorePoint| ?{$_.VMName –eq “Name of you VM”}|Remove-VBRRestorePoint
Truth be told, I’ve used this script in earnest. Still, for the purpose of complete safety I strongly recommend you trying it first in test environment before implementing.
Hope this helps.
Thanks.
-
- Influencer
- Posts: 10
- Liked: never
- Joined: Jun 18, 2012 1:02 pm
- Full Name: Karl Wallenius
- Contact:
MERGED: Command / Script to exclude VMs from existing jobs
Hello there,
In our environment we base our backup jobs on datastorage (one job per datastore). Since VMs in a large enviornment like ours move around from time to time.
I would like to exclude a couple of VMs on all jobs we have. Is there a good cmd-let to manage exclusions in a fairly smooth manner?
In our environment we base our backup jobs on datastorage (one job per datastore). Since VMs in a large enviornment like ours move around from time to time.
I would like to exclude a couple of VMs on all jobs we have. Is there a good cmd-let to manage exclusions in a fairly smooth manner?
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: MERGED: Command / Script to exclude VMs from existing jo
Hi, Karl.KarlW wrote:Hello there,
In our environment we base our backup jobs on datastorage (one job per datastore). Since VMs in a large enviornment like ours move around from time to time.
I would like to exclude a couple of VMs on all jobs we have. Is there a good cmd-let to manage exclusions in a fairly smooth manner?
Please take a look at the script provided above. I think, it's exactly want you need.
Furthermore, if you want to exclude this VMs only temporarily, just skip the part responsible for deleting the excluded object and for removing associated restore points.
Thanks.
-
- Service Provider
- Posts: 105
- Liked: 7 times
- Joined: Aug 24, 2010 8:55 am
- Full Name: Alex
- Contact:
[MERGED] : remove item from job
I've been struggling to remove an object, in my case a vmware folder, from an existing backup job. So far without any luck.
If anyone could please post a few lines of code I'd be a very happy guy.
Thanks,
Alex
If anyone could please post a few lines of code I'd be a very happy guy.
Thanks,
Alex
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Removing a single VM from replicas
Hi, Alex. The following code should meet your expectations:
Hope this helps.
Thanks.
Code: Select all
Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your Job"
$ObjectToRemove = $Job | Get-VBRJobObject -name "Name of a folder you’re going to exclude"
$ObjectToRemove | Remove-VBRJobObject #this line will exclude a given object
$ObjectToRemove.delete() #this line will remove a given object from the job completely
Thanks.
-
- Veteran
- Posts: 293
- Liked: 19 times
- Joined: Apr 13, 2011 12:45 pm
- Full Name: Thomas McConnell
- Contact:
Re: Removing a single VM from replicas
Code: Select all
Remove-VBRJobObject
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Removing a single VM from replicas
I must have totally missed this switch; thanks for pointing it out.
So, the shortened version of the aforesaid script should look like this:
Thanks.
So, the shortened version of the aforesaid script should look like this:
Code: Select all
Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your Job"
$ObjectToRemove = $Job | Get-VBRJobObject -name "Name of a folder you’re going to exclude"
$ObjectToRemove | Remove-VBRJobObject -completely
Thanks.
Who is online
Users browsing this forum: No registered users and 14 guests