Comandos Vmware
Arrancar una VM:
# vim-cmd vmsvc/power.on ID
Apagar una VM:
# vim-cmd vmsvc/power.off ID
Reiniciar una VM:
# vim-cmd vmsvc/power.restart ID
Te dice el wwn
esxcfg-mpath –hbas
# vim-cmd vmsvc
Commands available under vmsvc/:
acquiremksticket get.configoption power.offconnect get.datastores power.on
convert.toTemplate get.disabledmethods power.reboot
convert.toVm get.environment power.reset
createdummyvm get.filelayout power.shutdown
destroy get.guest power.suspend
device.connection get.guestheartbeatStatus reloaddevice.connusbdev get.managedentitystatus setscreenres
device.disconnusbdev get.networks snapshot.create
device.diskadd get.runtime snapshot.dumpoption
device.diskaddexisting get.snapshotinfo snapshot.get
device.diskremove get.summary snapshot.remove
device.getdevices get.tasklist snapshot.removealldevice.toolsSyncSet getallvms snapshot.revert
device.vmiadd gethostconstraints snapshot.setoption
device.vmiremove login tools.cancelinstall
devices.createnic logout tools.install
get.capability message tools.upgrade
get.config power.getstate unregister
get.config.cpuidmask power.hibernate upgrade
# vim-cmd vmsvc/getallvms
Vmid Name File Guest OS Version Annotation
32 WinXP-ibex01-a [SharedVMs] WinXP-ibex01-a/WinXP-ibex01-a.vmx winXPProGuest vmx-07 OneSizeXP-R40c.vmdk
64 WinXP-ibex01-c [SharedVMs]WinXP-ibex01-c/WinXP-ibex01-c.vmx winXPProGuest vmx-07 OneSizeXP-R40c.vmdk
# vim-cmd vmsvc/power.off 32
Powering off VM:
# vim-cmd vmsvc/power.on 32
Powering on VM:
# vim-cmd vmsvc/power.reboot 32
(vim.fault.ToolsUnavailable) {
dynamicType = <unset>,
faultCause = (vmodl.MethodFault) null,
msg = "Cannot complete operation because VMware Tools is not running in thisvirtual machine.",
}
# vim-cmd vmsvc/get.networks 32
Networks:
(vim.Network.Summary) {
dynamicType = <unset>,
network = 'vim.dvs.DistributedVirtualPortgroup:DVPG-a6 77 07 50 43 f3 38 cd-01 b9 dd 92 d3 d4 e7 b0-dvportgroup-146',
name = "Production",
accessible = true,
ipPoolName = "",
}
# vim-cmd vmsvc/get.datastores 32
name SharedVMsurl /vmfs/volumes/4d333ff0-28d4682c-49ea-00237da51830
capacity 145492017152
freeSpace 31078744064
accessible 1
type VMFS
multipleHostAccess <unset>
# vim-cmd vmsvc/snapshot.get 32
Get Snapshot:
|-ROOT
--Snapshot Name : 01%2f20%2f2011 15:04:40
--Snapshot Desciption :
--Snapshot Created On : 1/20/2011 14:59:11
--SnapshotState : powered on
# vim-cmd vmsvc/snapshot.removeall 32
Remove All Snapshots:
# vim-cmd vmsvc/snapshot.get 32
Get Snapshot:
# vim-cmd vmsvc/snapshot.create 32 snappy
Create Snapshot:
# vim-cmd vmsvc/snapshot.get 32
Get Snapshot:
|-ROOT
--Snapshot Name : snappy
--Snapshot Desciption :
--Snapshot Created On : 1/20/2011 20:0:9
--Snapshot State :powered off
# vim-cmd vmsvc/snapshot.remove 32
* List all VMs registered to this host (This reveals the Vmid needed for other commands)
vim-cmd /vmsvc/getallvms
* Unregister a VM
vim-cmd /vmsvc/unregister <Vmid>
* Register a VM
vim-cmd /solo/register /path/to/file.vmx
* Get power state of a VM
vim-cmd /vmsvc/power.getstate <Vimid>
* Power...
Regístrate para leer el documento completo.