I recently upgraded storage on our (first) xen server and would like to migrate the file-based vms I have in play to lvm-based storage... Can anyone point me in the right direction? Is there a way to mount a vm image file like I would using a iso image and a loopback device? Each vm''s disk file contains a partition table with root and swap partitions... In retrospect I wish I''d set these up independently! Thanks for any help! Cheers, Tim -- View this message in context: http://www.nabble.com/migrate-file-based-vm-to-lvm--tp21331539p21331539.html Sent from the Xen - User mailing list archive at Nabble.com. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
If I am thinking correct here you could dd it to an lvm partition? Can anyone confirm? I have yet to try this as I find it easier to manage corporate vm structure using image files (better across the network). -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of s0nspark Sent: Wednesday, January 07, 2009 9:48 AM To: xen-users@lists.xensource.com Subject: [Xen-users] migrate file-based vm to lvm? I recently upgraded storage on our (first) xen server and would like to migrate the file-based vms I have in play to lvm-based storage... Can anyone point me in the right direction? Is there a way to mount a vm image file like I would using a iso image and a loopback device? Each vm''s disk file contains a partition table with root and swap partitions... In retrospect I wish I''d set these up independently! Thanks for any help! Cheers, Tim -- View this message in context: http://www.nabble.com/migrate-file-based-vm-to-lvm--tp21331539p21331539.html Sent from the Xen - User mailing list archive at Nabble.com. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
hmm .. I thought of this but I''m not sure how it would work since each image file contains 2 partitions, a root partition and a swap partition... I seem to recall perhaps some mention of kpartx coming into play... but my memory is foggy on the details... If I am thinking correct here you could dd it to an lvm partition? Can anyone confirm? I have yet to try this as I find it easier to manage corporate vm structure using image files (better across the network). -- View this message in context: http://www.nabble.com/migrate-file-based-vm-to-lvm--tp21331539p21334456.html Sent from the Xen - User mailing list archive at Nabble.com. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Yes, you should be able to create a new LVM volume and then run something like: dd if=/path/to/dis/file of=/dev/volumegroup/volume The LVM volume needs to be either exactly the same size as the file or slightly larger, and there may be some rounding differences, so you may end up with extra space on the volume. -Nick -----Original Message----- From: Tait Clarridge <Tait.Clarridge@lavalife.com> To: s0nspark <s0nspark@gmail.com>, xen-users@lists.xensource.com Subject: RE: [Xen-users] migrate file-based vm to lvm? Date: Wed, 7 Jan 2009 10:36:35 -0500 If I am thinking correct here you could dd it to an lvm partition? Can anyone confirm? I have yet to try this as I find it easier to manage corporate vm structure using image files (better across the network). -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of s0nspark Sent: Wednesday, January 07, 2009 9:48 AM To: xen-users@lists.xensource.com Subject: [Xen-users] migrate file-based vm to lvm? I recently upgraded storage on our (first) xen server and would like to migrate the file-based vms I have in play to lvm-based storage... Can anyone point me in the right direction? Is there a way to mount a vm image file like I would using a iso image and a loopback device? Each vm''s disk file contains a partition table with root and swap partitions... In retrospect I wish I''d set these up independently! Thanks for any help! Cheers, Tim This e-mail may contain confidential and privileged material for the sole use of the intended recipient. If this email is not intended for you, or you are not responsible for the delivery of this message to the intended recipient, please note that this message may contain SEAKR Engineering (SEAKR) Privileged/Proprietary Information. In such a case, you are strictly prohibited from downloading, photocopying, distributing or otherwise using this message, its contents or attachments in any way. If you have received this message in error, please notify us immediately by replying to this e-mail and delete the message from your mailbox. Information contained in this message that does not relate to the business of SEAKR is neither endorsed by nor attributable to SEAKR. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
s0nspark <s0nspark@gmail.com> writes:> hmm .. I thought of this but I''m not sure how it would work since each image > file contains 2 partitions, a root partition and a swap partition... I seem > to recall perhaps some mention of kpartx coming into play... but my memory > is foggy on the details...If you dd the file to an LV, that LV will be usable as a whole disk (xvda) by your domU, exactly like the file was. If your file isn''t sparse, you can create a block device from it by losetup, then use kpartx on the resulting loop to create separate block devices for its partitions. Then you could dd these partition devices into separate LVs for example, and present those LVs to you domU as partitions (xvdaN). -- Feri. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
It should work - all you''re doing is changing how the host presents the data to the domU, not how the domU O/S sees the data. So, you''re still going to be making the LVM volume xvda or hda in the guest, which means the guest is still going to see the partitions. Accessing a partitioned LVM volume on dom0 may be a little tricky, but there shouldn''t be any problems inside domUs. -Nick -----Original Message----- From: s0nspark <s0nspark@gmail.com> To: xen-users@lists.xensource.com Subject: RE: [Xen-users] migrate file-based vm to lvm? Date: Wed, 7 Jan 2009 08:09:07 -0800 (PST) hmm .. I thought of this but I''m not sure how it would work since each image file contains 2 partitions, a root partition and a swap partition... I seem to recall perhaps some mention of kpartx coming into play... but my memory is foggy on the details... If I am thinking correct here you could dd it to an lvm partition? Can anyone confirm? I have yet to try this as I find it easier to manage corporate vm structure using image files (better across the network). This e-mail may contain confidential and privileged material for the sole use of the intended recipient. If this email is not intended for you, or you are not responsible for the delivery of this message to the intended recipient, please note that this message may contain SEAKR Engineering (SEAKR) Privileged/Proprietary Information. In such a case, you are strictly prohibited from downloading, photocopying, distributing or otherwise using this message, its contents or attachments in any way. If you have received this message in error, please notify us immediately by replying to this e-mail and delete the message from your mailbox. Information contained in this message that does not relate to the business of SEAKR is neither endorsed by nor attributable to SEAKR. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
S0nspark wrote on Wed, 7 Jan 2009 06:48:01 -0800 (PST):> Is there a way to mount a vm image file like I would using a iso image and a > loopback device?You can do that, has been mentioned quite a few times on this list, it''s a two or three-step process and I think I didn''t ever make it work. I found it easier to just rsync the running VM to the new location and adjust some files (grub.conf and fstab, maybe a few others). rsync with --numeric-ids option so that the original owner/group gets preserved. It''s pretty straight forward and fast. For swap I add a swap file created with dd. Do it once and then copy them. Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Would it be "better" to migrate to separate lvm volumes for each partition? Are there advantages to that approach besides easier access from dom0? Thanks much, Tim -----Original Message----- It should work - all you''re doing is changing how the host presents the data to the domU, not how the domU O/S sees the data. So, you''re still going to be making the LVM volume xvda or hda in the guest, which means the guest is still going to see the partitions. Accessing a partitioned LVM volume on dom0 may be a little tricky, but there shouldn''t be any problems inside domUs. -Nick -- View this message in context: http://www.nabble.com/migrate-file-based-vm-to-lvm--tp21331539p21336131.html Sent from the Xen - User mailing list archive at Nabble.com. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ferenc Wagner wrote on Wed, 07 Jan 2009 17:46:27 +0100:> If you dd the file to an LV, that LV will be usable as a whole disk > (xvda) by your domU, exactly like the file was.Staying with xvda doesn''t achieve very much. e.g. you may get a little bit of performance (not much), but the handling is still the same, e.g. no easy mounting and working on the filesystem. If you keep using xvda you can just stay with files. Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
s0nspark wrote:> Would it be "better" to migrate to separate lvm volumes for each partition? > Are there advantages to that approach besides easier access from dom0? > >Easy fs resize : shutdown domU, grow LV, resize fs, startup domU If you have multiple partitions on the same LV (without LVM on domU) then resizing is somewhat a pain (you need gparted or something similar). -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users