Nutanix CLI to shutdown all vms currently on

for vm_name in `acli vm.list power_state=on | grep -v ^’VM name’ | awk ‘{print $1}’`; do acli vm.shutdown $vm_name; done

i change acli command from acli vm.force_off to acli vm,shutdown

this command will excute safely shutdown

base on acli parameter:
Initiates a Guest level Reboot of the VMs :
code:
vm.guest_reboot
Initiates a Guest level Shutdown of the VMs :
code:
vm.guest_shutdown
Force VM into the powered off state :
code:
vm.force_off
Lists all VMs :
code:
vm.list
Powers off the specified VMs :
code:
vm.off
Powers on the specified VMs :
code:
vm.on
Power cycles the specified VMs :
code:
vm.power_cycle
Initiates a reboot by issuing an ACPI event :
code:
vm.reboot
Resets the specified VMs :
code:
vm.reset
Initiates a shutdown by issuing an ACPI event :
code:
vm.shutdown

8 mon   Nutanix
Popular