[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Expanding a virtual block device

Hi list.

I'm running Xen 4.0.1 on Debian.

I'm trying to live resize a block device :

 - I have a arbitrary block device in my dom0 (/dev/mapper/vm-vol42).
- I start a PV domain with that device as a disk (disk = ['phy:/dev/mapper/vm-vol42,xvda,w']).
 - I resize vm-vol42 in the dom0 (adding size only)
 - the dom0 sees the device's new size.
 - the domU still has a disk of the old size.
- I want the domU to see the new disk with it's actual size, so it can resize partitions and filesystems on said disk.

From my research I have gathered :
- on XenServer or XCP, there is a "xe vdi-resize" command. But since I'm on debian, no "xe" for me, and I'm not even sure it works online. - Browsing in the XenApi code showed an interesting method, VBD_media_change. However, it seems to allow only for changing read-only CD images. However, Xxm does not look like it uses it. - I cannot pause the domU, remove the device, add it back and unpause the domain (the block-dettach operation hangs on a paused domain). I can do it quite fast without unpausing, but it's not fully transparent, and can't be done on the root device. - I cannot issue a scsi rescan in dom0 since the xvd devices don't go through the scsi subsystem (and I couldn't find anything relevant in /sys/devices/vbda nor /sys/classes/block/xvda (apart from a read only "size" file).

I know I could just use LVM in the domU, create and attach a new block device, and grow my vg and lv in the domU. However this means managing more volumes, and I'd rather manage a 50GB volume than 5 10GB volumes.

So, the end question : how can I notify Xen that the device's size has changed, so the VBD's size in the domU will also increase ?

Vivien Bernet-Rollande
Systems&  Networking Engineer
Alter Way Hosting

Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.