Pages

Wednesday 22 June 2011

Deleting Multiple VM's from XenCenter

First use excel (or your choice of word editor) and create a list of all your VM's you would like to delete plus the added XE command options

xe vm-uninstall vm=VM1 force=true
xe vm-uninstall vm=VM2 force=true
xe vm-uninstall vm=VM3 force=true
xe vm-uninstall vm=VM4 force=true
xe vm-uninstall vm=VM5 force=true
xe vm-uninstall vm=VM6 force=true
xe vm-uninstall vm=VM7 force=true
xe vm-uninstall vm=VM8 force=true
xe vm-uninstall vm=VM9 force=true


Next open up a putty session to a Xen Host and copy all of the above next directly in to the putty session.

NOTE: Please be aware that the VM names are CaSe Sensitive.

As the text is processed you'll see each VM being delete and you can also view the VM's being deleted in XenCenter as each line of command runs in the putty session.

[root@XENHOST ~]# xe vm-uninstall vm=VM1 force=true
The following items are about to be destroyed
VM : e995f197-5730-9cfc-3491-c2768e02236f (VM1)
All objects destroyed
[root@XENHOST ~]# xe vm-uninstall vm=VM2 force=true
The following items are about to be destroyed
VM : ec6d123d-a3d5-aa11-9439-f4c44927a0fa (VM2)
All objects destroyed


Obviously be double sure that you have the correct list of VM's before you run this command.