- Vmid : virutal machine id
- Name : of the server in vsphere
- File :: which is the location and name of the VMX,
- Guest OS :: os type
- Version :: of hardware
- Vmid : is 7
- Name : is 250-DC01.
- File :: located in datastore2 under 250-DC01
- Guest OS :: win 2008 64 is listed as windows7server64guest
- Version :: of hardware is 8
Here are the steps to power down a vm via ssh or tech support mode.
The reason this could be useful is if you are having problems with your management agents and before a reboot of the host you wanted to shutdown the vms
Connect to the host in question. Im using ssh. Make sure you enabled it.
First list all your vms on the host:: vim-cmd vmsvc/getallvms
This will list every vm.
It will list:
Example:
For 250-DC01
The VMID is the key to the following steps.
To get the power state of 250-DC01 we would enter
vim-cmd vmsvc/power.getstate VMID
Which in this case is
vim-cmd vmsvc/power.getstate 7
To gracefully to a shutdown, enter
vim-cmd vmsvc/power.shutdown VMID
which in this case is
vim-cmd vmsvc/power.shutdown 7
If you run the power.getstate again you will see its off now.
If you have a vm where it either will not shutdown or you don’t have vmware tools installed, you will need to use another command.
vim-cmd vmsvc/power.off VMID
As you can see above, the VM with vmid 43 didn’t have vmwaretools so I was not able to send it a shutdown request.
So I had to hard power down the vm.
My suggestion, shutdown first, hard power down if you have to.
0 comments:
Post a Comment