1.list the power on VMs:
esxcli vm process list --重要的是找到World ID
若用esxcli vm process list | grep <guest vm name>則只會列出名稱與config file位置
2.turn off the VM:
esxcli vm process kill --type=xxxx --world-id=yyyyy
例如:esxcli vm process kill --type=soft --world-id=60418
for -type=xxxx use: soft, hard or force
for world-id=yyyy(VM ID) use the World ID listed in the command above
(eg. World ID 39731 for the example VM "Cold")
Some information about the three possible shutdown methods:
soft = prefer this if you want to shut down "softly"
hard = equal to an immediate shutdown
force = hard kill of the VM
3.trun on the VM:
list the VM:
vim-cmd vmsvc/getallvms
power on the VM:
vim-cmd vmsvc/power.on <vmid>
Check the power state of the VM
vim-cmd vmsvc/power.getstate <vmid>
check VM status:
esxcli vm process list
4.reboot the VM:
vim-cmd vmsvc/power.restart (reboot)<vm-id>
5.shutdown the VM:
vim-cmd vmsvc/power.shutdown <vm-id>
沒有留言:
張貼留言