XCP-NG:如何使用命令行关闭所有运行中的域(VM)

此 bash 脚本将使用命令行关闭 XCP-NG 主机上所有运行中的域(VM):

shutdown_xcpng_vms.sh
for vm in $(xe vm-list power-state=running --minimal | tr ',' ' '); do
    xe vm-shutdown uuid=$vm
done

之后,你通常想强制关闭仍在运行的所有域,可以使用:

force_shutdown_xcpng_vms.sh
for vm in $(xe vm-list power-state=running --minimal | tr ',' ' '); do
    xe vm-shutdown uuid=$vm force=true
done

Check out similar posts by category: XCP-NG, Virtualization