PowerShell script exchange
Post Reply
TheMonk
Influencer
Posts: 24
Liked: never
Joined: Jun 17, 2015 3:03 pm
Full Name: Chris Armitage
Contact:

Adding More than one Copy VM to a Application Group

Post by TheMonk »

Hi There

Ive been in discussions on the following topic http://forums.veeam.com/veeam-backup-re ... 39-30.html

This is all about adding a copied VM to an application group for testing in a sandbox environment.

The reason for this is so I can replicate certain site to site connections etc.

I can get one VM into a application group but when using the provided code in that previous topic I can not get any more than one VM.

If I run

Code: Select all

$RestorePoints = @((Get-VBRRestorePoint -Name "Name of first VM" | sort creationtime | select -Last 1), (Get-VBRRestorePoint -Name "Name of second VM" | sort creationtime | select -Last 1))
Add-VSBViApplicationGroup –Name “AG” –RestorePoint $RestorePoints
That simply adds the second VM

if I run

Code: Select all

Get-VBRRestorePoint -Name "Name of first VM" | sort creationtime | select -Last 1
That gives me the first VM showing that at least I can see the restore point.

Many thanks for any help in advance
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Adding More than one Copy VM to a Application Group

Post by veremin »

What product version you're using? And what happens if you input $RestorePoints variable into console, will both restore points be shown?
TheMonk
Influencer
Posts: 24
Liked: never
Joined: Jun 17, 2015 3:03 pm
Full Name: Chris Armitage
Contact:

Re: Adding More than one Copy VM to a Application Group

Post by TheMonk »

Im using version8 with the latest patch.

Interestingly now its placing the First VM into the Application group...no second one.

When I run $RestorePoints it simply shows me the one VM
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Adding More than one Copy VM to a Application Group

Post by veremin »

That's what I suspected. That means that only one restore point out of two is gotten and then passed to application group. As the result, Application Group contains only one VM.

Try to divide the code into two portions and see which one doesn't work:

Code: Select all

$RestorePoint1 = Get-VBRRestorePoint -Name "Name of first VM" | sort creationtime | select -Last 1
$RestorePoint2 = Get-VBRRestorePoint -Name "Name of second VM" | sort creationtime | select -Last 1
$RestorePoint1
$RestorePoint2
If one of those doesn't show anything, try to disregard sorting portion and check whether at least something is returned for the said VM:

Code: Select all

Get-VBRRestorePoint -Name "Name of first or second VM"
Thanks.
TheMonk
Influencer
Posts: 24
Liked: never
Joined: Jun 17, 2015 3:03 pm
Full Name: Chris Armitage
Contact:

Re: Adding More than one Copy VM to a Application Group

Post by TheMonk »

WTF

The following now works

Code: Select all

$RestorePoints = @((Get-VBRRestorePoint -Name "Name of first VM" | sort creationtime | select -Last 1), (Get-VBRRestorePoint -Name "Name of second VM" | sort creationtime | select -Last 1))
Add-VSBViApplicationGroup –Name “AG” –RestorePoint $RestorePoints
Only change is that the server has been rebooted.....it did a windows update? I wonder if Powershell was somehow stuck
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Adding More than one Copy VM to a Application Group

Post by veremin »

Not sure what might have been wrong in your situation. May be prior to update PowerShell didn't operate as expected. By the way, isn't it PS 2.0 by any chance; this version typically has a lot of strange problems with missing parameters, etc.?

Anyway, I'm glad to hear that now everything works properly.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests