ESXi

 View Only
  • 1.  esxi CLI command for graceful shutdown

    Posted Dec 23, 2015 10:07 AM

    Hello,

    Which command can I use for clean and graceful shutdown all VM and turn off esxi host  in sequence?


    D.



  • 2.  RE: esxi CLI command for graceful shutdown

    Posted Dec 23, 2015 12:35 PM

    Hi, I suggest the use of powercli with this sequence:

    $host = "192.168.1.10"

    $vms = Get-Vm

    foreach($vm in $vms){

        Shutdown-VMGuest -VM $vm -Confirm

    }

    Stop-VMHost $host -Confirm

    Regards



  • 3.  RE: esxi CLI command for graceful shutdown

    Posted Dec 24, 2015 02:37 PM

    Thank you!

    Please tell me, how I can run this script on esxi host via ssh ?



  • 4.  RE: esxi CLI command for graceful shutdown
    Best Answer

    Posted Dec 25, 2015 09:23 AM

    Hi

    this is just an example... sure you could try many improvement following powercli commands guide (see official doc)... sure before use it you should connect using command Connect-VIServer.

    You should use this script via powercli (Download link: https://my.vmware.com/web/vmware/info/slug/datacenter_cloud_infrastructure/vmware_vsphere/6_0#drivers_tools‌) then save file with ps1 extension.

    There are some commands you could be executed via ssh directly to the single host... I define this way as a big management workaround, because the purpose of the host cli is for emergency or straordinary management. I suggest to try powercli before.

    Regards