xen 调整磁盘空间_如何在Xen中将磁盘动态附加到正在运行的DomU?

xen 调整磁盘空间

I want to attach a disk to a DomU.

我想将磁盘连接到DomU。

The Xen DomU is running and should not be rebooted. Hence, changing its configuration file is not an option.

Xen DomU正在运行,不应重新启动。 因此,更改其配置文件不是一种选择。

How to dynamically attach a disk to running DomU in Xen?

如何在Xen中将磁盘动态附加到正在运行的DomU?

To attach phy:vg_xen/vm-228-large to vm-228 as xvdb, run this on Dom0:

要将phy:vg_xen / vm-228-large作为xvdb附加到vm-228,请在Dom0上运行此命令:

# xl block-attach vm-228 phy:vg_xen/vm-228-large xvdb w

With the old xm tool stack, replace xl with xm.

使用旧的xm工具堆栈,将xl替换为xm

In the VM vm-228, a new device /dev/xvdb should appear.

在VM vm-228中,应显示一个新设备/dev/xvdb

The general format for block-attach is as follows.

block-attach的一般格式如下。

xl [-v] block-attach <Domain> <BackDev> <FrontDev> 
[<Mode>] [BackDomain]

Bonus:

奖励

Using this method, you can also mounting a USB drive to a DomU by attaching the whole USB drive (e.g./dev/sde, not the partition /dev/sde1) to a VM as a disk like

使用此方法,您还可以通过将整个USB驱动器(例如/dev/sde ,而不是分区/dev/sde1 )作为磁盘(例如磁盘)连接到VM,从而将USB驱动器安装到DomU。

# xl block-attach vm-228 /dev/sde xvde w

Note that do not mount the USB drive on Dom0 and umount it if the OS automatically mounted it.

请注意,请勿将USB驱动器安装在Dom0上,如果操作系统自动将其安装,则不要将其卸载

Detach a disk:

卸下磁盘:

# xl block-detach vm-228 xvde
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-dynamically-attach-a-disk-to-running-domu-in-xen/

xen 调整磁盘空间

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值