Hi, I have 2 questions: 1. I was not able to let the guest know that the partition size was changed. 2. I was not able to use block-attach with the same backendfile to different machines (eg: guest + dom0) I''ve read that block-reconfigure could''ve been used for this, except that it wasn''t designed to work for filebased vbd on PVs, only for switching CDROMs in HVM When you use a local disk on a machine, you can use fdisk to change partitions and sizes, it then rereads the partition table to reflect those changes. Since i''m not using a disk, but directly partitions, isn''t it possible to just give a signal to the guest that it should recheck the partition? can be from the guest itself. Some kind of workaround? Sincerely, Maarten _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pasi Kärkkäinen
2009-Feb-05 12:05 UTC
Re: [Xen-users] propagating blktap partition changes
On Thu, Feb 05, 2009 at 11:52:56AM +0100, Maarten Vanraes wrote:> Hi, > > I have 2 questions: > > 1. I was not able to let the guest know that the partition size was changed. > 2. I was not able to use block-attach with the same backendfile to different > machines (eg: guest + dom0) > > I''ve read that block-reconfigure could''ve been used for this, except that it > wasn''t designed to work for filebased vbd on PVs, only for switching CDROMs > in HVM > > When you use a local disk on a machine, you can use fdisk to change partitions > and sizes, it then rereads the partition table to reflect those changes. > > Since i''m not using a disk, but directly partitions, isn''t it possible to just > give a signal to the guest that it should recheck the partition? can be from > the guest itself. > > Some kind of workaround? >Sorry, this is not possible. There''s a a feature request about it for Xen 3.4. Dunno if it will be implemented. -- Pasi _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Maarten Vanraes
2009-Feb-05 12:59 UTC
Re: [Xen-users] propagating blktap partition changes
Op Thursday 05 February 2009 13:05:01 schreef Pasi Kärkkäinen:> On Thu, Feb 05, 2009 at 11:52:56AM +0100, Maarten Vanraes wrote: > > Hi, > > > > I have 2 questions: > > > > 1. I was not able to let the guest know that the partition size was > > changed. 2. I was not able to use block-attach with the same backendfile > > to different machines (eg: guest + dom0) > > > > I''ve read that block-reconfigure could''ve been used for this, except that > > it wasn''t designed to work for filebased vbd on PVs, only for switching > > CDROMs in HVM > > > > When you use a local disk on a machine, you can use fdisk to change > > partitions and sizes, it then rereads the partition table to reflect > > those changes. > > > > Since i''m not using a disk, but directly partitions, isn''t it possible to > > just give a signal to the guest that it should recheck the partition? can > > be from the guest itself. > > > > Some kind of workaround? > > Sorry, this is not possible. > > There''s a a feature request about it for Xen 3.4. > > Dunno if it will be implemented. > > -- PasiYes, i read your thread, i was hoping for some kind of workaround, some kind of "thing" i can execute on the guest, that would make the kernel recheck it''s partition size or something. Maarten _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pasi Kärkkäinen
2009-Feb-05 14:27 UTC
Re: [Xen-users] propagating blktap partition changes
On Thu, Feb 05, 2009 at 01:59:57PM +0100, Maarten Vanraes wrote:> Op Thursday 05 February 2009 13:05:01 schreef Pasi Kärkkäinen: > > On Thu, Feb 05, 2009 at 11:52:56AM +0100, Maarten Vanraes wrote: > > > Hi, > > > > > > I have 2 questions: > > > > > > 1. I was not able to let the guest know that the partition size was > > > changed. 2. I was not able to use block-attach with the same backendfile > > > to different machines (eg: guest + dom0) > > > > > > I''ve read that block-reconfigure could''ve been used for this, except that > > > it wasn''t designed to work for filebased vbd on PVs, only for switching > > > CDROMs in HVM > > > > > > When you use a local disk on a machine, you can use fdisk to change > > > partitions and sizes, it then rereads the partition table to reflect > > > those changes. > > > > > > Since i''m not using a disk, but directly partitions, isn''t it possible to > > > just give a signal to the guest that it should recheck the partition? can > > > be from the guest itself. > > > > > > Some kind of workaround? > > > > Sorry, this is not possible. > > > > There''s a a feature request about it for Xen 3.4. > > > > Dunno if it will be implemented. > > > > -- Pasi > > Yes, i read your thread, i was hoping for some kind of workaround, some kind > of "thing" i can execute on the guest, that would make the kernel recheck > it''s partition size or something. >The problem is not about rereading the partition table; this can be done using for example "blockdev --rereadpt". The problem is to get the disk device (/dev/xvd*) resized.. ie. getting the kernel to see the DISK has been resized. After the disk has been resized, partition table can be resized after that. Disk resizing on the fly is not supported today with Xen. -- Pasi _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Maarten Vanraes
2009-Feb-05 14:35 UTC
Re: [Xen-users] propagating blktap partition changes
Op Thursday 05 February 2009 15:27:55 schreef Pasi Kärkkäinen:> On Thu, Feb 05, 2009 at 01:59:57PM +0100, Maarten Vanraes wrote: > > Op Thursday 05 February 2009 13:05:01 schreef Pasi Kärkkäinen: > > > On Thu, Feb 05, 2009 at 11:52:56AM +0100, Maarten Vanraes wrote: > > > > Hi, > > > > > > > > I have 2 questions: > > > > > > > > 1. I was not able to let the guest know that the partition size was > > > > changed. 2. I was not able to use block-attach with the same > > > > backendfile to different machines (eg: guest + dom0) > > > > > > > > I''ve read that block-reconfigure could''ve been used for this, except > > > > that it wasn''t designed to work for filebased vbd on PVs, only for > > > > switching CDROMs in HVM > > > > > > > > When you use a local disk on a machine, you can use fdisk to change > > > > partitions and sizes, it then rereads the partition table to reflect > > > > those changes. > > > > > > > > Since i''m not using a disk, but directly partitions, isn''t it > > > > possible to just give a signal to the guest that it should recheck > > > > the partition? can be from the guest itself. > > > > > > > > Some kind of workaround? > > > > > > Sorry, this is not possible. > > > > > > There''s a a feature request about it for Xen 3.4. > > > > > > Dunno if it will be implemented. > > > > > > -- Pasi > > > > Yes, i read your thread, i was hoping for some kind of workaround, some > > kind of "thing" i can execute on the guest, that would make the kernel > > recheck it''s partition size or something. > > The problem is not about rereading the partition table; this can be done > using for example "blockdev --rereadpt". > > The problem is to get the disk device (/dev/xvd*) resized.. ie. getting the > kernel to see the DISK has been resized. > > After the disk has been resized, partition table can be resized after that. > > Disk resizing on the fly is not supported today with Xen.Well I understand that it is inside the kernel, but, i''m not using disks, i''m using partitions directly: e.g.: ''tap:aio:/opt/data/file.img, sda1, w'' I can make the partition file larger on dom0 no problem, i could even resize the partition live on dom0 no problem. But (i guess the kernel) doesn''t see the partition as larger, even with forced operations, i still get read errors at the end. I''m not even sure the blktap device detected this change in size on dom0. But if i''m using directly partitions, maybe there is some code that i can execute that does kernel calls or something to refresh it''s device. ie: a workaround. I mean, hotplug seems to be able to do it just fine. ie: memory is detected as larger, i imagine there is such code for block devices as well, no? So i figured there should be something i can do in the guest (maybe even on kernel level) that could force the re-detection of the device or something. Of course if blktap can''t even pass on the information to the guest, this would not work at all... Sincerely, Maarten _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pasi Kärkkäinen
2009-Feb-05 15:36 UTC
Re: [Xen-users] propagating blktap partition changes
On Thu, Feb 05, 2009 at 03:35:18PM +0100, Maarten Vanraes wrote:> Op Thursday 05 February 2009 15:27:55 schreef Pasi Kärkkäinen: > > On Thu, Feb 05, 2009 at 01:59:57PM +0100, Maarten Vanraes wrote: > > > Op Thursday 05 February 2009 13:05:01 schreef Pasi Kärkkäinen: > > > > On Thu, Feb 05, 2009 at 11:52:56AM +0100, Maarten Vanraes wrote: > > > > > Hi, > > > > > > > > > > I have 2 questions: > > > > > > > > > > 1. I was not able to let the guest know that the partition size was > > > > > changed. 2. I was not able to use block-attach with the same > > > > > backendfile to different machines (eg: guest + dom0) > > > > > > > > > > I''ve read that block-reconfigure could''ve been used for this, except > > > > > that it wasn''t designed to work for filebased vbd on PVs, only for > > > > > switching CDROMs in HVM > > > > > > > > > > When you use a local disk on a machine, you can use fdisk to change > > > > > partitions and sizes, it then rereads the partition table to reflect > > > > > those changes. > > > > > > > > > > Since i''m not using a disk, but directly partitions, isn''t it > > > > > possible to just give a signal to the guest that it should recheck > > > > > the partition? can be from the guest itself. > > > > > > > > > > Some kind of workaround? > > > > > > > > Sorry, this is not possible. > > > > > > > > There''s a a feature request about it for Xen 3.4. > > > > > > > > Dunno if it will be implemented. > > > > > > > > -- Pasi > > > > > > Yes, i read your thread, i was hoping for some kind of workaround, some > > > kind of "thing" i can execute on the guest, that would make the kernel > > > recheck it''s partition size or something. > > > > The problem is not about rereading the partition table; this can be done > > using for example "blockdev --rereadpt". > > > > The problem is to get the disk device (/dev/xvd*) resized.. ie. getting the > > kernel to see the DISK has been resized. > > > > After the disk has been resized, partition table can be resized after that. > > > > Disk resizing on the fly is not supported today with Xen. > > Well I understand that it is inside the kernel, but, i''m not using disks, i''m > using partitions directly: > > e.g.: > > ''tap:aio:/opt/data/file.img, sda1, w'' > > I can make the partition file larger on dom0 no problem, i could even resize > the partition live on dom0 no problem. > > But (i guess the kernel) doesn''t see the partition as larger, even with forced > operations, i still get read errors at the end. > > I''m not even sure the blktap device detected this change in size on dom0. > > But if i''m using directly partitions, maybe there is some code that i can > execute that does kernel calls or something to refresh it''s device. ie: a > workaround. > > I mean, hotplug seems to be able to do it just fine. ie: memory is detected as > larger, i imagine there is such code for block devices as well, no? So i > figured there should be something i can do in the guest (maybe even on kernel > level) that could force the re-detection of the device or something. > > Of course if blktap can''t even pass on the information to the guest, this > would not work at all... >Like said, there''s no way for Xen (or dom0) to tell domU that disk or partition has been resized. It is not yet implemented. Solution: Use LVM in domU and xm block-attach new disk/partition to domU, create PV to it and add that PV to existing VG. -- Pasi _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Maarten Vanraes
2009-Feb-05 15:44 UTC
Re: [Xen-users] propagating blktap partition changes
Op Thursday 05 February 2009 16:36:04 schreef Pasi Kärkkäinen:> On Thu, Feb 05, 2009 at 03:35:18PM +0100, Maarten Vanraes wrote: > > Op Thursday 05 February 2009 15:27:55 schreef Pasi Kärkkäinen: > > > On Thu, Feb 05, 2009 at 01:59:57PM +0100, Maarten Vanraes wrote: > > > > Op Thursday 05 February 2009 13:05:01 schreef Pasi Kärkkäinen: > > > > > On Thu, Feb 05, 2009 at 11:52:56AM +0100, Maarten Vanraes wrote: > > > > > > Hi, > > > > > > > > > > > > I have 2 questions: > > > > > > > > > > > > 1. I was not able to let the guest know that the partition size > > > > > > was changed. 2. I was not able to use block-attach with the same > > > > > > backendfile to different machines (eg: guest + dom0) > > > > > > > > > > > > I''ve read that block-reconfigure could''ve been used for this, > > > > > > except that it wasn''t designed to work for filebased vbd on PVs, > > > > > > only for switching CDROMs in HVM > > > > > > > > > > > > When you use a local disk on a machine, you can use fdisk to > > > > > > change partitions and sizes, it then rereads the partition table > > > > > > to reflect those changes. > > > > > > > > > > > > Since i''m not using a disk, but directly partitions, isn''t it > > > > > > possible to just give a signal to the guest that it should > > > > > > recheck the partition? can be from the guest itself. > > > > > > > > > > > > Some kind of workaround? > > > > > > > > > > Sorry, this is not possible. > > > > > > > > > > There''s a a feature request about it for Xen 3.4. > > > > > > > > > > Dunno if it will be implemented. > > > > > > > > > > -- Pasi > > > > > > > > Yes, i read your thread, i was hoping for some kind of workaround, > > > > some kind of "thing" i can execute on the guest, that would make the > > > > kernel recheck it''s partition size or something. > > > > > > The problem is not about rereading the partition table; this can be > > > done using for example "blockdev --rereadpt". > > > > > > The problem is to get the disk device (/dev/xvd*) resized.. ie. getting > > > the kernel to see the DISK has been resized. > > > > > > After the disk has been resized, partition table can be resized after > > > that. > > > > > > Disk resizing on the fly is not supported today with Xen. > > > > Well I understand that it is inside the kernel, but, i''m not using disks, > > i''m using partitions directly: > > > > e.g.: > > > > ''tap:aio:/opt/data/file.img, sda1, w'' > > > > I can make the partition file larger on dom0 no problem, i could even > > resize the partition live on dom0 no problem. > > > > But (i guess the kernel) doesn''t see the partition as larger, even with > > forced operations, i still get read errors at the end. > > > > I''m not even sure the blktap device detected this change in size on dom0. > > > > But if i''m using directly partitions, maybe there is some code that i can > > execute that does kernel calls or something to refresh it''s device. ie: a > > workaround. > > > > I mean, hotplug seems to be able to do it just fine. ie: memory is > > detected as larger, i imagine there is such code for block devices as > > well, no? So i figured there should be something i can do in the guest > > (maybe even on kernel level) that could force the re-detection of the > > device or something. > > > > Of course if blktap can''t even pass on the information to the guest, this > > would not work at all... > > Like said, there''s no way for Xen (or dom0) to tell domU that disk or > partition has been resized. It is not yet implemented. > > Solution: Use LVM in domU and xm block-attach new disk/partition to domU, > create PV to it and add that PV to existing VG. > > -- PasiI don''t follow? * make new disk file on dom0 * xm block-attach the disk file to domU * the domU uses LVM based on the disk files * make on both disks an LVM partition that has the same VolGroup? and combining it linearly? that would mean that adding a PV to the volgroup would make the / bigger? enableing myself to use resize2fs on the domU directly? so if i gather this, it would be the same if i added another device and used raid linear mode as / ? Sincerely, Maarten _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Feb 5, 2009 at 10:44 AM, Maarten Vanraes <maarten@ba.be> wrote:> that would mean that adding a PV to the volgroup would make the / bigger? > enableing myself to use resize2fs on the domU directly?adding a PV (physical volume) to the VG (volume group) makes the VG bigger. then you can grow any LV (logical volume). IOW, the VG abstracts the PVs. the LVs don''t care where the storage is. -- Javier _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Maarten Vanraes
2009-Feb-05 16:08 UTC
Re: [Xen-users] propagating blktap partition changes
Op Thursday 05 February 2009 16:55:44 schreef Javier Guerra:> On Thu, Feb 5, 2009 at 10:44 AM, Maarten Vanraes <maarten@ba.be> wrote: > > that would mean that adding a PV to the volgroup would make the / bigger? > > enableing myself to use resize2fs on the domU directly? > > adding a PV (physical volume) to the VG (volume group) makes the VG > bigger. then you can grow any LV (logical volume). > > IOW, the VG abstracts the PVs. the LVs don''t care where the storage is.I guess that makes sense... If i were to choose between this or mdadm with linear mode, which would be more efficient? i''m guessing it''d be mdadm. and i wouldn''t need anything more than this... I know LVM is much more flexible though, but i don''t necessarily need all that abstraction functionality. I plainly want to enlarge my /. if i were to use mdadm linear mode, could i migrate to this live? i''m guessing not... especially since it''s the /. 1. can i create the linear mode raid without losing data? ie: the first partition doesn''t need to be changed, right? I guess this could work. 2. can I switch the / device while it''s being used? i remember that initrd have a command that does this (pivot_root) or something... I guess this is really going off-topic. it would be so much better if the propagation would work... Sincerely, Maarten _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Maarten Vanraes
2009-Feb-05 16:12 UTC
Re: [Xen-users] propagating blktap partition changes
Op Thursday 05 February 2009 16:55:44 schreef Javier Guerra:> On Thu, Feb 5, 2009 at 10:44 AM, Maarten Vanraes <maarten@ba.be> wrote: > > that would mean that adding a PV to the volgroup would make the / bigger? > > enableing myself to use resize2fs on the domU directly? > > adding a PV (physical volume) to the VG (volume group) makes the VG > bigger. then you can grow any LV (logical volume). > > IOW, the VG abstracts the PVs. the LVs don''t care where the storage is.Also, if block-reconfigure would work, it would also be nice 1. make a live copy of the partition file but bigger 2. pause the domU 3. mount both in dom0 4. do a last rsync 5. umount again 6. block-reconfigure to the new one 7. unpause the domU but i''d prefer growing on dom0 and propagating the change... _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pasi Kärkkäinen
2009-Feb-05 16:13 UTC
Re: [Xen-users] propagating blktap partition changes
On Thu, Feb 05, 2009 at 04:44:07PM +0100, Maarten Vanraes wrote:> Op Thursday 05 February 2009 16:36:04 schreef Pasi Kärkkäinen: > > On Thu, Feb 05, 2009 at 03:35:18PM +0100, Maarten Vanraes wrote: > > > Op Thursday 05 February 2009 15:27:55 schreef Pasi Kärkkäinen: > > > > On Thu, Feb 05, 2009 at 01:59:57PM +0100, Maarten Vanraes wrote: > > > > > Op Thursday 05 February 2009 13:05:01 schreef Pasi Kärkkäinen: > > > > > > On Thu, Feb 05, 2009 at 11:52:56AM +0100, Maarten Vanraes wrote: > > > > > > > Hi, > > > > > > > > > > > > > > I have 2 questions: > > > > > > > > > > > > > > 1. I was not able to let the guest know that the partition size > > > > > > > was changed. 2. I was not able to use block-attach with the same > > > > > > > backendfile to different machines (eg: guest + dom0) > > > > > > > > > > > > > > I''ve read that block-reconfigure could''ve been used for this, > > > > > > > except that it wasn''t designed to work for filebased vbd on PVs, > > > > > > > only for switching CDROMs in HVM > > > > > > > > > > > > > > When you use a local disk on a machine, you can use fdisk to > > > > > > > change partitions and sizes, it then rereads the partition table > > > > > > > to reflect those changes. > > > > > > > > > > > > > > Since i''m not using a disk, but directly partitions, isn''t it > > > > > > > possible to just give a signal to the guest that it should > > > > > > > recheck the partition? can be from the guest itself. > > > > > > > > > > > > > > Some kind of workaround? > > > > > > > > > > > > Sorry, this is not possible. > > > > > > > > > > > > There''s a a feature request about it for Xen 3.4. > > > > > > > > > > > > Dunno if it will be implemented. > > > > > > > > > > > > -- Pasi > > > > > > > > > > Yes, i read your thread, i was hoping for some kind of workaround, > > > > > some kind of "thing" i can execute on the guest, that would make the > > > > > kernel recheck it''s partition size or something. > > > > > > > > The problem is not about rereading the partition table; this can be > > > > done using for example "blockdev --rereadpt". > > > > > > > > The problem is to get the disk device (/dev/xvd*) resized.. ie. getting > > > > the kernel to see the DISK has been resized. > > > > > > > > After the disk has been resized, partition table can be resized after > > > > that. > > > > > > > > Disk resizing on the fly is not supported today with Xen. > > > > > > Well I understand that it is inside the kernel, but, i''m not using disks, > > > i''m using partitions directly: > > > > > > e.g.: > > > > > > ''tap:aio:/opt/data/file.img, sda1, w'' > > > > > > I can make the partition file larger on dom0 no problem, i could even > > > resize the partition live on dom0 no problem. > > > > > > But (i guess the kernel) doesn''t see the partition as larger, even with > > > forced operations, i still get read errors at the end. > > > > > > I''m not even sure the blktap device detected this change in size on dom0. > > > > > > But if i''m using directly partitions, maybe there is some code that i can > > > execute that does kernel calls or something to refresh it''s device. ie: a > > > workaround. > > > > > > I mean, hotplug seems to be able to do it just fine. ie: memory is > > > detected as larger, i imagine there is such code for block devices as > > > well, no? So i figured there should be something i can do in the guest > > > (maybe even on kernel level) that could force the re-detection of the > > > device or something. > > > > > > Of course if blktap can''t even pass on the information to the guest, this > > > would not work at all... > > > > Like said, there''s no way for Xen (or dom0) to tell domU that disk or > > partition has been resized. It is not yet implemented. > > > > Solution: Use LVM in domU and xm block-attach new disk/partition to domU, > > create PV to it and add that PV to existing VG. > > > > -- Pasi > > I don''t follow? > > * make new disk file on dom0 > * xm block-attach the disk file to domU > * the domU uses LVM based on the disk files > * make on both disks an LVM partition that has the same VolGroup? and > combining it linearly? >You don''t need to have LVM partition on the (extra) disks.. just create the PV directly to the device (/dev/xvdb etc). You have just 1 volgroup, and you add new PV to it, so the volgroup gets bigger.> that would mean that adding a PV to the volgroup would make the / bigger? > enableing myself to use resize2fs on the domU directly? >After the volgroup is bigger, you can extend which ever logical volume you need to extend.. and after that resize the filesystem.> so if i gather this, it would be the same if i added another device and used > raid linear mode as / ? >Well, however you want to do it :) -- Pasi _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Pasi Kärkkäinen
2009-Feb-05 16:37 UTC
Re: [Xen-users] propagating blktap partition changes
On Thu, Feb 05, 2009 at 05:12:35PM +0100, Maarten Vanraes wrote:> > but i''d prefer growing on dom0 and propagating the change...Of course, that would be the best option. Feel free to submit patches.. I''m sure they''ll be gladly accepted! -- Pasi _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Maarten Vanraes
2009-Feb-05 21:10 UTC
Re: [Xen-users] propagating blktap partition changes
Op Thursday 05 February 2009 17:37:33 schreef Pasi Kärkkäinen:> On Thu, Feb 05, 2009 at 05:12:35PM +0100, Maarten Vanraes wrote: > > but i''d prefer growing on dom0 and propagating the change... > > Of course, that would be the best option. > > Feel free to submit patches.. I''m sure they''ll be gladly accepted! > > -- PasiI could say the same to you... ;-) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users