VMware

This Question is Answered

1 "helpful" answer available (6 pts)
4 Replies Last post: Nov 3, 2009 5:20 AM by gwagchunks  

Snapshot question posted: Nov 3, 2009 4:57 AM

Click to view gwagchunks's profile Novice 4 posts since
May 15, 2008

Hello Everyone

Quick question. What is the difference between: "get-snapshot | remove snapshot " and "remove-snapshot" cmdlets? Basically I clone some VMs over to our DR site, and sometimes even thought the clone works OK, a temporary clone snapshot gets left on the original VM and I have to go in and delete it.

Thanks a lot.

Re: Snapshot question

1. Nov 3, 2009 5:05 AM in response to: gwagchunks
Click to view LucD's profile Champion 2,431 posts since
Oct 31, 2005
Could you perhaps give us a bit more context on the
Get-Snapshot | remove snaphot

I don't know the "remove" cmdlet.
Is this perhaps an alias or a function that was defined in your environment ?
Can you do a
alias remove
get-command remove

Re: Snapshot question

3. Nov 3, 2009 5:18 AM in response to: gwagchunks
Click to view LucD's profile Champion 2,431 posts since
Oct 31, 2005
These are both the same cmdlet, Remove-Snapshot.

In the code you are using, you 'pipe' the snapshot object that you got with the Get-Snapshot cmdlet to the Remove-Snapshot cmdlet.
The cmdlet on the poster works in the same way.

The 2nd way of using the cmdlet is by giving the snapshot object via the -Snapshot parameter
Like this:
Remove-Snapshot -Snapshot (Get-VM DR_testsvr | Get-Snapshot) -Confirm:$false

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities