xen vm安装
Shutting down servers is a common operations for managing a cluster. However, if this server is configured to a Xen Dom0 and has Xen VMs (DomUs), the VMs should be shutdown first to avoid data lost on these VMs.
关闭服务器是管理群集的常见操作。 但是,如果此服务器配置为Xen Dom0并具有Xen VM(DomU),则应先关闭VM,以避免这些VM上的数据丢失。
xm supports a -a
option to shutdown all VMs:
xm支持-a
选项关闭所有VM:
# xm shutdown -a
Add the -w
if you want to make it wait for the domain to complete shutdown before returning
如果要让它等待域完成关闭再返回,则添加-w
Thanks to Eugene for this tips. The script below is a “poor man”‘s solution.
感谢Eugene提供的提示。 下面的脚本是“穷人”的解决方案。
I wrote a Bash script to automatically list all running VMs and shutdown them down by calling xm
which I use to shutdown VMs on servers before turning them off.
我编写了一个Bash脚本来自动列出所有正在运行的VM,并通过调用xm
关闭它们来关闭它们,该命令用于关闭服务器上的VM。
The xen-shutdown-all.sh
script is on github:
xen-shutdown-all.sh
脚本位于github上:
This script use the xm
command for management. If you are using a newer version of Xen which possibly uses xl
for VM management, you can easily change the script by replacing xm
with xl
and make other possibly required changes.
该脚本使用xm
命令进行管理。 如果使用的Xen较新版本可能使用xl
进行VM管理,则可以通过将xm
替换为xl
来轻松更改脚本,并进行其他可能需要的更改。
Enjoy!
请享用!
翻译自: https://www.systutorials.com/script-shutting-down-all-xen-vms-on-a-server/
xen vm安装