No announcement yet.

ESXi 4 - Power off and on VM via command line (RCLI or SSH)

  • Filter
  • Time
  • Show
Clear All
new posts

  • ESXi 4 - Power off and on VM via command line (RCLI or SSH)

    We are looking to migrate several VM's currently running on VMware Server to an ESXi 4 host.

    Some of these VM's are running third party apps that do not have any automated method for backing up the application data. When these VM's were on VMware Server we ran a command using vmware-cmd to shut down the VM after which we copied all the VM files to a file server where they would later be backed up. Once the files were copied we used vmware-cmd to start the VM's back up. This was our workaround for the third party apps defficiencies.

    I would like to do the same thing with ESXi4 where Veem is doing the copying.

    Using the RCLI I cannot shut down a VM (to my knowledge).

    Is there a way to shut down using the command line on the host (via SSH)? I've been searching but I haven't found the right command yet.

    If nothing else I can have a script run within the VM itself that will shut it down, but I still need to automate starting it up.

    Thanks for your help!
    CCA: XenApp 5.0

  • #2
    Re: ESXi 4 - Power off and on VM via command line (RCLI or SSH)

    I know that i am replying 6 months later but hey, someone else can use it as a reference. Quickly, for ESXi 4.0 run this command:

    vim-cmd vmsvc/getallvms - this command checks for your existing VMs, then run

    vim-cmd vmsvc/ 48 - <vm id> on my ESXi is 48.

    If you need to restart your VM on a daily basis I would edit and add the cron job in:


    Command for restarting any vm is:

    vim-cmd vmsvc/power.restart <vm-id>