Hello all,
i learning VI tool kit as I go along but need some help. Can you please provide samples for reverting back to a specific snapshot? I'm using some sample code as a guide but it does not appear to work.
In addition if anyone has a example of the command to change the amount of ram allocated to a vm that would be helpful as well.
thanks,
pete
Hi Pete,
To set a particular snapshot use the following script.
get-viserver -server
$vm = Get-VM -Name "VMName"
$snapshotname = $vm | Get-Snapshot -Name "Target-Snpsht"
$vm | get-snapshot -Name "Target-Snpsht" | where { $_.name -like $snapshotname.name } | %{ set-vm $vm -snapshot $snapshotname }
You can change the ram allocated to the VM using the cmdlet Set-VM.
I hope it works and resolve your issue.
Thanks
Niket
Hi Pete,
To set a particular snapshot use the following script.
get-viserver -server
$vm = Get-VM -Name "VMName"
$snapshotname = $vm | Get-Snapshot -Name "Target-Snpsht"
$vm | get-snapshot -Name "Target-Snpsht" | where { $_.name -like $snapshotname.name } | %{ set-vm $vm -snapshot $snapshotname }
You can change the ram allocated to the VM using the cmdlet Set-VM.
I hope it works and resolve your issue.
Thanks
Niket
I found a couple of good examples with a search of "[set-vm snapshot|http://communities.vmware.com/search.jspa?q=set-vm+snapshot&resultTypes=BLOG_POST&resultTypes=DOCUMENT&resultTypes=MESSAGE&resultTypes=BLOG&resultTypes=COMMUNITY&peopleEnabled=true&dateRange=all&communityID=2530&userID=&numResults=15&rankBy=10001]". (link to search results).
The same cmdlet is used for changing memory.
If you would like more detailed help, please explain what you have tried and paste the error messages or other output.
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)