vim_vm_power

VM power lifecycle via SOAP (vim.VirtualMachine.Power*Task + guest variants).

REST /api/vcenter/vm/{id}/power covers the basics, but several common ops (reset, standby_guest, hard shutdown vs graceful tools-shutdown) want the SOAP surface — and SOAP returns rich task references the caller can poll.

Asynchronous ops return the task moid; guest ops (ShutdownGuest etc.) are fire-and-forget commands without a task and return True.

saltext.vcf.clients.vim_vm_power.get_power_state(opts, vm_id_or_name, profile=None)[source]

Return runtime power state: poweredOn / poweredOff / suspended.

saltext.vcf.clients.vim_vm_power.power_on(opts, vm_id_or_name, host=None, profile=None)[source]

Hard power-on. If host is set, schedules on that target host.

saltext.vcf.clients.vim_vm_power.power_off(opts, vm_id_or_name, profile=None)[source]

Hard power-off (yank cord).

saltext.vcf.clients.vim_vm_power.shutdown_guest(opts, vm_id_or_name, profile=None)[source]

Send a graceful ACPI shutdown via VMware Tools. Synchronous (no task).

saltext.vcf.clients.vim_vm_power.reboot_guest(opts, vm_id_or_name, profile=None)[source]

Send a graceful reboot via VMware Tools. Synchronous (no task).

saltext.vcf.clients.vim_vm_power.standby_guest(opts, vm_id_or_name, profile=None)[source]

Send a standby/suspend command via VMware Tools. Synchronous (no task).

saltext.vcf.clients.vim_vm_power.reset(opts, vm_id_or_name, profile=None)[source]

Hard reset.

saltext.vcf.clients.vim_vm_power.suspend(opts, vm_id_or_name, profile=None)[source]

Suspend (saves state to a .vmss file).