Hi, I''m having some problems converting an image based domu to lvm based. This is what I''ve done so far. lvcreate -L 5000M -n vmsname /dev/vg0 mkfs.ext3 /dev/vg0/vmsname lvcreate -L 1000M -n vmsswap /dev/vg0 mkswap /dev/vg0/vmsswap I then used kpartx to expand/mount the image, and with the new lvm mounted I copied the contents of the image into the lvm. I then dismounted the lvm and the image. I configured the config as follows name = "vmsname" memory = "256" disk = [''phy:/dev/VolGroup01/vmsname,hda1,w'', ''phy:/dev/VolGroup01/vmsname,hda2,w'' ] vif = [ ''bridge=xenbr0'', ] bootloader="/usr/bin/pygrub" vcpus=1 on_reboot = ''restart'' on_crash = ''restart'' When i try to create the vms it hangs until I control+c it. Anyone have any insight? Thanks in advance. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Personally, I''d simply create a logical volume the same size as the image based disk (or bigger if you feel like expanding) and dd it over. Cheers, On Tue, Oct 13, 2009 at 6:44 PM, Mike <systems@db3broadband.com> wrote:> Hi, I''m having some problems converting an image based domu to lvm based. > This is what I''ve done so far. > > lvcreate -L 5000M -n vmsname /dev/vg0 > mkfs.ext3 /dev/vg0/vmsname > lvcreate -L 1000M -n vmsswap /dev/vg0 > mkswap /dev/vg0/vmsswap > > I then used kpartx to expand/mount the image, and with the new lvm mounted > I copied the contents of the image into the lvm. I then dismounted the lvm > and the image. > > I configured the config as follows > > name = "vmsname" > memory = "256" > disk = [''phy:/dev/VolGroup01/vmsname,hda1,w'', > ''phy:/dev/VolGroup01/vmsname,hda2,w'' ] > vif = [ ''bridge=xenbr0'', ] > bootloader="/usr/bin/pygrub" > vcpus=1 > on_reboot = ''restart'' > on_crash = ''restart'' > > When i try to create the vms it hangs until I control+c it. Anyone have any > insight? Thanks in advance. > > > _______________________________________________ > 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
On Wed, Oct 14, 2009 at 7:13 AM, Stephen Ross <stephen.ross1986@googlemail.com> wrote:> Personally, I''d simply create a logical volume the same size as the image > based disk (or bigger if you feel like expanding) and dd it over.That would be the easiest way.> On Tue, Oct 13, 2009 at 6:44 PM, Mike <systems@db3broadband.com> wrote:>> I then used kpartx to expand/mount the image, and with the new lvm mounted >> I copied the contents of the image into the lvm. I then dismounted the lvm >> and the image.>> disk = [''phy:/dev/VolGroup01/vmsname,hda1,w'', >> ''phy:/dev/VolGroup01/vmsname,hda2,w'' ]So in your original setup, the file is mapped as hda while in LVM setup each LV is mapped as partition (hda1, hda2)?>> bootloader="/usr/bin/pygrub">> When i try to create the vms it hangs until I control+c it. Anyone have >> any insight? Thanks in advance.Does "pygrub /dev/VolGroup01/vmsname" work? It should give the similar output as when you run "pygrub /path/to/your/original/image/file.img". Also please check whether udev is running (ps -ef | grep udev). -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha wrote:> On Wed, Oct 14, 2009 at 7:13 AM, Stephen Ross > <stephen.ross1986@googlemail.com> wrote: >> Personally, I''d simply create a logical volume the same size as the image >> based disk (or bigger if you feel like expanding) and dd it over. > > That would be the easiest way. > >> On Tue, Oct 13, 2009 at 6:44 PM, Mike <systems@db3broadband.com> wrote: > >>> I then used kpartx to expand/mount the image, and with the new lvm mounted >>> I copied the contents of the image into the lvm. I then dismounted the lvm >>> and the image. > >>> disk = [''phy:/dev/VolGroup01/vmsname,hda1,w'', >>> ''phy:/dev/VolGroup01/vmsname,hda2,w'' ] > > So in your original setup, the file is mapped as hda while in LVM > setup each LV is mapped as partition (hda1, hda2)? > >>> bootloader="/usr/bin/pygrub" > >>> When i try to create the vms it hangs until I control+c it. Anyone have >>> any insight? Thanks in advance. > > Does "pygrub /dev/VolGroup01/vmsname" work? It should give the similar > output as when you run "pygrub /path/to/your/original/image/file.img". > Also please check whether udev is running (ps -ef | grep udev). >After sending the original thread off to the ML I had tried the ''dd'' method and it worked flawlessly. My only concern is being able to resize the filesystem inside of the images after i''ve dd''d them over. it should be just like resizing any other logical volume with a resizable file system...all ext3 centos vms'' so i would imagine this will be fine? Any caveats from anyone? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Oct 15, 2009 at 2:11 AM, Mike <systems@db3broadband.com> wrote:> After sending the original thread off to the ML I had tried the ''dd'' method > and it worked flawlessly. My only concern is being able to resize the > filesystem inside of the images after i''ve dd''d them over. it should be just > like resizing any other logical volume with a resizable file system...all > ext3 centos vms'' so i would imagine this will be fine? Any caveats from > anyone?Since you dd-them you also copy its partition table. That means after you resize the LV you also need to modify the partition table. And you also need kpartx to mount it. If that''s OK with you (it''s what you do anyway with file-based image, right?) than you can stick with it. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users