VMware {code} Community
GregoryMachin
Contributor
Contributor

completely removing a VM

Hi,

I'm looking for a way to completely remove a VM without leaving an orphaned entry in vSphere or the leaving the VM on disk. I have looked at the scripts in vSphere 6.0 Documentation Center but I can't see one the cleanly remove, only unregister, which leaves the VM files on disk. Where can I find a sample for doing this ? My Perl is rusty beginner  so could do with a hand, please.

Thank you.

Reply
0 Kudos
2 Replies
stumpr
Virtuoso
Virtuoso

Destroy_Task() will do it.

Reuben Stump | http://www.virtuin.com | @ReubenStump
Reply
0 Kudos
Anjani_Kumar
Commander
Commander

Follow this.

Remove-VM vm_name -deletepermanently


VMware KB: Performing common virtual machine-related tasks with command-line utilities

Please consider marking this answer "correct" or "helpful" if you found it useful. Anjani Kumar | VMware vExpert 2014-2015-2016 | Infrastructure Specialist Twitter : @anjaniyadav85 Website : http://www.Vmwareminds.com
Reply
0 Kudos