KVM VMの自動起動/自動シャットダウン設定

・ホスト側の設定

# vi /etc/sysconfig/libvirt-guests
START_DELAY=30
ON_SHUTDOWN=shutdown
SHUTDOWN_TIMEOUT=180

# virsh autostart <自動起動したいVM名>
# ls /etc/libvirt/qemu/autostart

解除する場合は下記
# virsh autostart --disable <自動起動したいVM名>
# ls /etc/libvirt/qemu/autostart

・ゲスト側の設定
ホストのシャットダウン命令を受け付けるようにする

# yum -y install acpid
# systemctl start acpid
# systemctl enable acpid