VM Power State (shutdown, suspend)

最後更新: 2021-03-03

目錄

  • shutdown
  • acpid shutdown guest setting
  • suspend / wakeup

 


shutdown

 

Syntax

# Gracefully shuts down a domain.

shutdown domain [--mode MODE-LIST]

--mode

By default the hypervisor will try to pick a suitable shutdown method.

次序: "agent", "acpi", "initctl", "signal" and "paravirt"

 


acpid shutdown guest setting

 

VM 內要有 acpi 的響應機制:

yum install -y acpid

systemctl enable acpid

systemctl start acpid

VM 要有 acpi 能力:

<features>
  <acpi/>
</features>

 


suspend & wakeup

 

suspend

dompmsuspend domain target

target:

mem(Suspend-to-RAM), disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)

i.e.

dompmsuspend seafile mem

Suspend a running domain into one of these states (possible target values):
    mem: equivalent of S3 ACPI state
    disk: equivalent of S4 ACPI state
    hybrid: RAM is saved to disk but not powered off

status

domstate seafile

由原來的 running 變成了 pmsuspended

wakeup

i.e.

dompmwakeup seafile

Wakeup a domain from pmsuspended state

 

Creative Commons license icon Creative Commons license icon