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
翻译自: https://www.systutorials.com/how-to-dynamically-attach-a-disk-to-running-domu-in-xen/
xen 调整磁盘空间