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 Xen-users@lists.xensource.com lists.xensource.com/xen-users
Vivien Bernet-Rollande
2011-May-02 08:07 UTC
Re: [Xen-users] Expanding a virtual block device
in my case the domU resides in a lv at the dom0 too, i''ve used> lvextend instead of vdi-resize > > Dom0# lvextend -L +5G /dev/vg_r710/vol_xyz > > and followed the remaining steps from this link > > michelem.org/2009/01/16/how-to-resize-a-disk-partition-on-a-xen-guest-linux-host > > at the end used resizefs > > DomU# resize2fs /dev/vg_vm/lv_root >The solution you are offering requires a reboot of the VM, which I''m trying to avoid. I know how to resize a LV and filesystem. I want to resize my disk, and have Xen and the domU notice it, without having to reboot the domU. Is this actually possible with Xen ? -- Vivien Bernet-Rollande Systems& Networking Engineer Alter Way Hosting _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
On 05/02/2011 10:07 AM, Vivien Bernet-Rollande wrote:> in my case the domU resides in a lv at the dom0 too, i''ve used >> lvextend instead of vdi-resize >> >> Dom0# lvextend -L +5G /dev/vg_r710/vol_xyz >> >> and followed the remaining steps from this link >> >> michelem.org/2009/01/16/how-to-resize-a-disk-partition-on-a-xen-guest-linux-host >> >> >> at the end used resizefs >> >> DomU# resize2fs /dev/vg_vm/lv_root >> > > The solution you are offering requires a reboot of the VM, which I''m > trying to avoid. I know how to resize a LV and filesystem. > I want to resize my disk, and have Xen and the domU notice it, without > having to reboot the domU. > > Is this actually possible with Xen ? >I tried this and it''s actually not a Xen issue. A resized volume in dom0 (even on DRBD :) ) is noticed by the domU. So if your disk was 100G before and you add another 100G, fdisk(in domU) will report a 200G disk after the resize in dom0. If you have lvm set up in the domU too, you have some options: - create a partition on the free disk space and add the pv to the volume group - no reboot required - delete the pv and recreate it with bigger dimensions - reboot required If you have no volume management in the domU you have to recreate the partition with the new dimensions before you run resizefs - reboot required. hth, Mark _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
Hi Mark, On Mon, May 02, 2011 at 12:44:09PM +0200, Mark Dokter wrote:> On 05/02/2011 10:07 AM, Vivien Bernet-Rollande wrote: > > I want to resize my disk, and have Xen and the domU notice it, without > > having to reboot the domU. > > > > Is this actually possible with Xen ? > > I tried this and it''s actually not a Xen issue. A resized volume in dom0 > (even on DRBD :) ) is noticed by the domU.Are you sure about that? It''s never worked for me, but I''ve not yet tried it in Xen 4.x. It''s always needed a shut down and boot of the domU for me, for it to see a larger block device. Cheers, Andy _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
On Mon, May 2, 2011 at 6:58 PM, Andy Smith <andy@strugglers.net> wrote:> Hi Mark, > > On Mon, May 02, 2011 at 12:44:09PM +0200, Mark Dokter wrote: >> On 05/02/2011 10:07 AM, Vivien Bernet-Rollande wrote: >> > I want to resize my disk, and have Xen and the domU notice it, without >> > having to reboot the domU. >> > >> > Is this actually possible with Xen ? >> >> I tried this and it''s actually not a Xen issue. A resized volume in dom0 >> (even on DRBD :) ) is noticed by the domU. > > Are you sure about that? It''s never worked for me, but I''ve not yet > tried it in Xen 4.x. It''s always needed a shut down and boot of the > domU for me, for it to see a larger block device.It used to be like that for Xen 3.x In 4.x, online resize is possible but ONLY if the domU kernel also support it. I''m using 2.6.32.28 pv_ops from Jeremy''s git tree, and it can recognize the size change just fine once I run partprobe on both dom0 and domU (the dom0 part might not be necessary though). Of course, if you have partitions/LV on top of domU''s block device, then it becomes a lot more complicated since you have to deal with manual partition change or pvresize as well. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
Victor Ramirez Lorca
2011-May-02 12:35 UTC
Re: [Xen-users] Expanding a virtual block device
On Mon, May 2, 2011 at 5:07 AM, Vivien Bernet-Rollande <vivien.bernet-rollande@nexen.alterway.fr> wrote:> in my case the domU resides in a lv at the dom0 too, i''ve used >> >> lvextend instead of vdi-resize >> >> Dom0# lvextend -L +5G /dev/vg_r710/vol_xyz >> >> and followed the remaining steps from this link >> >> >> michelem.org/2009/01/16/how-to-resize-a-disk-partition-on-a-xen-guest-linux-host >> >> at the end used resizefs >> >> DomU# resize2fs /dev/vg_vm/lv_root >> > > The solution you are offering requires a reboot of the VM, which I''m trying > to avoid. I know how to resize a LV and filesystem. > I want to resize my disk, and have Xen and the domU notice it, without > having to reboot the domU. > > Is this actually possible with Xen ?i have not tested it but this should work on DomU in the stage of "reboot domU" partprobe(8) part of gnuparted. cyberciti.biz/tips/re-read-the-partition-table-without-rebooting-linux-system.html> > -- > Vivien Bernet-Rollande > Systems& Networking Engineer > Alter Way Hosting > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
Vivien Bernet-Rollande
2011-May-02 12:42 UTC
Re: [Xen-users] Expanding a virtual block device
> I tried this and it''s actually not a Xen issue. A resized volume in dom0 > (even on DRBD :) ) is noticed by the domU. > So if your disk was 100G before and you add another 100G, fdisk(in domU) > will report a 200G disk after the resize in dom0. >This is interesting, as it is not the behaviour I have observed. Let''s check the disk (in dom0) at the start : > x1:/home/vbernetr# blockdev --getsize64 /dev/sdc > 42954915840 And in the domU : > root@x-debian:~# blockdev --getsize64 /dev/xvdd > 42954915840 Now I resize the iSCSI Lun : > group01> volume select voltest01 size 70G On the dom0, I rescan the connected targets, and check the size of the device : > x1:/home/vbernetr# iscsiadm -m node -R > x1:/home/vbernetr# blockdev --getsize64 /dev/sdc > 75167170560 However, in domU, I still have the old size : > root@x-debian:~# blockdev --getsize64 /dev/xvdd > 42954915840 After a reboot domU sees the correct size. > root@x-debian:~# blockdev --getsize64 /dev/xvdd > 75167170560 Are you sure the experience you are describing happens without a reboot ? And if so, how are your virtual block devices configured ? Are you using "phy", "file", "tap:aio", or something else ? -- Vivien Bernet-Rollande Systems& Networking Engineer Alter Way Hosting _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
On 5/2/11 2:42 PM, Vivien Bernet-Rollande wrote:> >> I tried this and it''s actually not a Xen issue. A resized volume in dom0 >> (even on DRBD :) ) is noticed by the domU. >> So if your disk was 100G before and you add another 100G, fdisk(in domU) >> will report a 200G disk after the resize in dom0. >> > This is interesting, as it is not the behaviour I have observed. >[...]> > Are you sure the experience you are describing happens without a reboot > ? And if so, how are your virtual block devices configured ? Are you > using "phy", "file", "tap:aio", or something else ? >I use: - ubuntu 10.04 - xen 4.0.1 - 2.6.32 pvops kernel - lvm OR lvm+drbd (tried both) in dom0 - configured domU disk with "phy" - pv-on-hvm drivers in domU (xen-blkfront etc...) After I resized the volume (with the domU running) I got a kernel message in the domU saying that a disk resize was detected. The disk was now bigger, but the partition on that disk must still be adjusted. Mark _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
On 5/2/11 2:10 PM, Fajar A. Nugraha wrote:> On Mon, May 2, 2011 at 6:58 PM, Andy Smith <andy@strugglers.net> wrote: >> Hi Mark, >>Hi!> > Of course, if you have partitions/LV on top of domU''s block device, > then it becomes a lot more complicated since you have to deal with > manual partition change or pvresize as well. >Partitions are necessary, since I use hardware virtualization. LVM is what actually makes the resizing easy :) Mark _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
Hi Fajar, Mark, On Mon, May 02, 2011 at 07:10:38PM +0700, Fajar A. Nugraha wrote:> On Mon, May 2, 2011 at 6:58 PM, Andy Smith <andy@strugglers.net> wrote: > > On Mon, May 02, 2011 at 12:44:09PM +0200, Mark Dokter wrote: > >> I tried this and it''s actually not a Xen issue. A resized volume in dom0 > >> (even on DRBD :) ) is noticed by the domU. > > > > Are you sure about that? It''s never worked for me, but I''ve not yet > > tried it in Xen 4.x. It''s always needed a shut down and boot of the > > domU for me, for it to see a larger block device. > > It used to be like that for Xen 3.x > > In 4.x, online resize is possible but ONLY if the domU kernel also > support it.Ah right, that''s great. Sorry Mark for doubting you. I have as yet only done the most minor of testing with 4.x. Cheers, Andy _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users
On Mon, May 02, 2011 at 07:10:38PM +0700, Fajar A. Nugraha wrote:> On Mon, May 2, 2011 at 6:58 PM, Andy Smith <andy@strugglers.net> wrote: > > Hi Mark, > > > > On Mon, May 02, 2011 at 12:44:09PM +0200, Mark Dokter wrote: > >> On 05/02/2011 10:07 AM, Vivien Bernet-Rollande wrote: > >> > I want to resize my disk, and have Xen and the domU notice it, without > >> > having to reboot the domU. > >> > > >> > Is this actually possible with Xen ? > >> > >> I tried this and it''s actually not a Xen issue. A resized volume in dom0 > >> (even on DRBD :) ) is noticed by the domU. > > > > Are you sure about that? It''s never worked for me, but I''ve not yet > > tried it in Xen 4.x. It''s always needed a shut down and boot of the > > domU for me, for it to see a larger block device. > > It used to be like that for Xen 3.x > > In 4.x, online resize is possible but ONLY if the domU kernel also > support it. I''m using 2.6.32.28 pv_ops from Jeremy''s git tree, and it > can recognize the size change just fine once I run partprobe on both > dom0 and domU (the dom0 part might not be necessary though). >Yep, xen/stable-2.6.32.x kernel supports online resizing. Online resizing was added up upstream (kernel.org) Linux 2.6.36. RHEL5 kernel-xen is expected to get online resizing support in rhel5.8. (bugzilla.redhat.com/show_bug.cgi?id=618317) -- Pasi _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com lists.xensource.com/xen-users