Thursday, 31 May 2012

power off / get state of vm vim-cmd


from VMware's own www

Using the ESXi command-line utility vim-cmd to power off the virtual machine

  1. On the ESXi console, enter Tech Support mode and log in as root. 
  2. Get a list of all registered virtual machines, identified by their VMID, Display Name, and path to the .vmx configuration file, using this command:

    vim-cmd vmsvc/getallvms

  3. To get the current state of a virtual machine
    vim-cmd vmsvc/power.getstate VMID
  4. Power off the virtual machine using the VMID found in Step 2 and run:

    vim-cmd vmsvc/power.off VMID

    Note: If the virtual machine fails to power off, use the following command:
    vim-cmd vmsvc/power.shutdownVMID

No comments:

Post a Comment