Method: ESX::VM#destroy
- Defined in:
- lib/esx.rb
#destroy ⇒ Object
Destroy the VirtualMaching removing it from the inventory and deleting the disk files
521 522 523 524 525 526 527 528 529 |
# File 'lib/esx.rb', line 521 def destroy #disks = vm_object.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk) unless host.free_license vm_object.Destroy_Task.wait_for_completion else host.remote_command "vim-cmd vmsvc/power.off #{vmid}" host.remote_command "vim-cmd vmsvc/destroy #{vmid}" end end |