xen vm安装_脚本:关闭服务器上的所有Xen VM

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上:

xen-shutdown-all.sh.

xen-shutdown-all.sh

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安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值