VmWare/Misc Commands
From r00tedvw.com wiki
(Difference between revisions)
(Created page with "Misc commands (to be used with SSH--see below for enabling SSH) List VMs (get vmIds): vim-cmd vmsvc/getallvms VM status: vim-cmd vmsvc/power.getstate vmId Power on/off ...") |
|||
Line 1: | Line 1: | ||
+ | (https://sites.google.com/site/bmaupinwiki/home/applications/vmware/vmware-esxi) | ||
Misc commands | Misc commands | ||
(to be used with SSH--see below for enabling SSH) | (to be used with SSH--see below for enabling SSH) | ||
Line 58: | Line 59: | ||
Ctrl-C to exit | Ctrl-C to exit | ||
+ | |||
+ | |||
+ | Enable SSH (from terminal): | ||
+ | vi /etc/inetd.conf | ||
+ | uncomment ssh line (remove # from line that starts with #ssh) | ||
+ | save the file (:wq) | ||
+ | restart inetd | ||
+ | kill -HUP `ps | grep inetd` |
Revision as of 16:02, 21 February 2013
(https://sites.google.com/site/bmaupinwiki/home/applications/vmware/vmware-esxi) Misc commands (to be used with SSH--see below for enabling SSH)
List VMs (get vmIds):
vim-cmd vmsvc/getallvms
VM status:
vim-cmd vmsvc/power.getstate vmId
Power on/off a VM:
vim-cmd vmsvc/power.[on/off] vmId
Get the IP address of a VM:
vim-cmd vmsvc/get.summary vmId | grep ipAddress
To list available commands:
vim-cmd help vim-cmd vmsvc
Standard VM operations:
vim-cmd vmsvc/power.getstate vmId vim-cmd vmsvc/power.on vmId vim-cmd vmsvc/power.off vmId vim-cmd vmsvc/power.suspend vmId vim-cmd vmsvc/power.reset vmId vim-cmd vmsvc/power.shutdown vmId vim-cmd vmsvc/power.reboot vmId vim-cmd vmsvc/power.hibernate vmId vim-cmd vmsvc/snapshot.create vmId snapshotName snapshotDescription includeMemory Ex: vim-cmd "vmsvc/snapshot.create XXXX FIRST_SNAPSHOT MY_FIRST_SNAPSHOT_1" vim-cmd vmsvc/snapshot.revert VmId snapshotLevel snapshotIndex Ex: vim-cmd "vmsvc/snapshot.revert XXXX 1" vim-cmd vmsvc/snapshot.removeall VmId vim-cmd vmsvc/snapshot.remove VmId removeChildren snapshotLevel snapshotIndex vim-cmd vmsvc/snapshot.get vmId
Remove a VM:
vim-cmd vmsvc/unregister vmId then delete the vm directory from the datastore (/vmfs/...)
Maintenance mode for ESX host:
- (unfortunately this command will not evacuate/VMotion your VMs to rest of the cluster)
vim-cmd hostsvc/maintenance_mode_enter vim-cmd hostsvc/maintenance_mode_exit
show the DCUI (direct console user interface)
dcui
Ctrl-C to exit
Enable SSH (from terminal):
vi /etc/inetd.conf uncomment ssh line (remove # from line that starts with #ssh) save the file (:wq) restart inetd kill -HUP `ps | grep inetd`