Fri Jan 10 12:01:44 ICT 2014

Reset hard disk of virtual machines

After a semester, when WEA class is over, you must reset the machines web1... web15.

There is no easy way for the permissions, you have to use VMware GUI and reset machine by machine.

To erase the virtual hard disks, the provided sheel script offers an easy and fast solution:

  1. Login on the VMware server:
    $ ssh root@virtual3
    
  2. Call the script for one or more WEA virtual machine. For the machine web1 use the pamater 1, use 2 for web2, etc.:
    $ /vmfs/volumes/datastore1/ghettoVCB/reset-vm-disk x y z...
    
    The shell script does the following:
    • stop the virtual machine
    • delete the virtual disk
    • delete any log
    • delete any NVRAM
    • delete any lock file
    • delete any swap file
    • recreate an empty virtual disk

Posted by Olivier | Permanent link | File under: administration, vmware