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安装
本文介绍了一种在服务器上关闭所有Xen虚拟机(VM)的实用脚本。该脚本通过调用xm命令自动列出并关闭所有运行中的VM,避免了直接关闭服务器导致的数据丢失。适用于使用Xen作为虚拟化平台的管理员。

142

被折叠的 条评论
为什么被折叠?



