Hi, I have Xen 4.0 installation on Debian Squeeze. I am able to boot Xen guest based on physical partition but failing to boot Xen guest with LVM within DomU. To use LVM inside DomU, I took the following way: 1. Installed a basic debian squeeze system on a AMD64 box. Used the entire disk disk and configure LVM option to set root on LVM. The root is at /dev/Box1/root and swap is at /dev/Box1/swap_1 2. Installed Xen and Dom0 from repository. 3. Populated Xen guest image with DomO image. When I try to run the image, I get the error that the volume logical volume is not found. I have set root to /dev/mapper/root in Xen configuration volume. Is there anything I am missing. Has anyone used LVM inside Xen guest? Prakhar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I wanted to echo Fajar''s comments that using the installer to create a guest with a new LVM configuration inside the virtual disk is the best idea for you. The idea that you could copy /dev/sda into a LV is rather suspicious. Only an LV created on a larger device such as /dev/sdb could contain the data in /dev/sda. If you created the LV in a VG created on /dev/sda then it would not fit inside itself. Also, please understand that an LVM configuration has named volume groups (VGs). If you copy /dev/sda then the name of the VG which is stored in /dev/sda would also be copied. This means two VGs with the same name on the same computer. That''s bad news. It might not be apparent to you that VGs have names if you haven''t created many. For example, the openSUSE installer defaults to a VG named system. Each VM guest would try to create "system" and this is not such a great idea. I would change each to match the name of the server.> Date: Sun, 10 Jul 2011 22:54:23 +0530 > From: Prakhar Srivastava <prakhar.apj@gmail.com> > Subject: Re: [Xen-users] Cannot boot with LVM inside Xen DomU > To: "Fajar A. Nugraha" <list@fajar.net> > Cc: xen-users@lists.xensource.com > Message-ID: > <CAF+Dr+uesk7reRgujQkM52f9HybYEN5dADUAj07Li3nqr_ss5A@mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, > I am going to copy the domO PV i.e. /dev/sda to a logical volume and use > that to boot a Xen guest. > > I have been using Eucalyptus images for Xen to rum them from an LVM > backend. > > Anyways, I am going to try and use virt-manager for installing Xen PV > guests > and hope I am able to setup LVM within. > > Thanks > Prakhar_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Prakhar Srivastava
2011-Jul-11 18:47 UTC
Re: [Xen-users] Re: Cannot boot with LVM inside Xen DomU
Hi, Thanks a lot to both of you for providing all these valuable information. This has really enhanced my understanding about LVM. The idea of copying the entire physical partition to a logical volume was really bad. So, I tried to use virt-install to create a Xen guest image. However I found that virt-install was easier to use with Red Hat/CentOS because it doesnt work out of the box for debian/ubuntu. The installer itself partitioned the Xen virtual disk into root and swap LVs. .I had some issue with CentOS installer where the installer hanged at 0% while downloading essential packages. But I believe I will be able to sort it out. I have one more query. As stated by Fazar in his last reply, Redhat/CentOS DomU have by default LVM within which allows them to increase the root disk online by xm block-attach command. However, I have read in one of the Xen list discussion that using LVM as DomU backend and also within DomU is not a great idea in terms of performance. I want to have a similar kind of setup and believe that having the flexibility of resizing root disk online is a great plus in a virtualized environment. What are your thoughts on this ?? Thanks, Prakhar On Mon, Jul 11, 2011 at 10:51 PM, Oliver Wilcock <oliver@owch.ca> wrote:> I wanted to echo Fajar''s comments that using the installer to create a > guest with a new LVM configuration inside the virtual disk is the best > idea for you. > > The idea that you could copy /dev/sda into a LV is rather suspicious. > Only an LV created on a larger device such as /dev/sdb could contain the > data in /dev/sda. If you created the LV in a VG created on /dev/sda then > it would not fit inside itself. > > Also, please understand that an LVM configuration has named volume groups > (VGs). If you copy /dev/sda then the name of the VG which is stored in > /dev/sda would also be copied. This means two VGs with the same name on > the same computer. That''s bad news. > > It might not be apparent to you that VGs have names if you haven''t created > many. For example, the openSUSE installer defaults to a VG named system. > Each VM guest would try to create "system" and this is not such a great > idea. I would change each to match the name of the server. > > > Date: Sun, 10 Jul 2011 22:54:23 +0530 > > From: Prakhar Srivastava <prakhar.apj@gmail.com> > > Subject: Re: [Xen-users] Cannot boot with LVM inside Xen DomU > > To: "Fajar A. Nugraha" <list@fajar.net> > > Cc: xen-users@lists.xensource.com > > Message-ID: > > < > CAF+Dr+uesk7reRgujQkM52f9HybYEN5dADUAj07Li3nqr_ss5A@mail.gmail.com> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi, > > I am going to copy the domO PV i.e. /dev/sda to a logical volume and use > > that to boot a Xen guest. > > > > I have been using Eucalyptus images for Xen to rum them from an LVM > > backend. > > > > Anyways, I am going to try and use virt-manager for installing Xen PV > > guests > > and hope I am able to setup LVM within. > > > > Thanks > > Prakhar > > > > > _______________________________________________ > 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
Oliver Wilcock
2011-Jul-17 11:11 UTC
Re: [Xen-users] Re: Cannot boot with LVM inside Xen DomU
Sorry about the late reply. Resizing of the root disk. Here are some thoughts: I previously shared that you may run into trouble when upgrading if the root (/) is the entire disk. In my experience the SUSE installer was confused (it couldn''t find the existing installation) and had to be tricked. Consequently I now put root on /dev/xvda1. It doesn''t sound right that you can resize with xm block-attach. You may want to re-read whatever you are referring to. Why would you need to make your root disk bigger? It is probably smarter to put the data that grows on separate LVM backed storage. Perhaps you need to assign separate LVs to /home /var /opt. For relatively simple guests I would typically create an LV for swap, var and home and mount those as disks (phy:/dev/raid10x6/guestservername-home,xvdc,w). You can do online expansion of the LV which appears as a larger xvdc device. In dom0: lvresize -L?GB /dev/raid10x6/guestservername-home Performance penalty of nested LVM: I''m sure there is an impact (a few percent probably, I''ve never measured it). You might still want to do it though. I''ve done it once for the ability to create LV snapshots inside the guest as part of the backup strategy. I didn''t do it on root (/) though. Just the mount points where I kept the databases and log files. On 2011-07-11 14:47, Prakhar Srivastava wrote:> Hi,snip> I have one more query. As stated by Fazar in his last reply, > Redhat/CentOS DomU have by default LVM within which allows them to > increase the root disk online by xm block-attach command. However, I > have read in one of the Xen list discussion that using LVM as DomU > backend and also within DomU is not a great idea in terms of > performance. I want to have a similar kind of setup and believe that > having the flexibility of resizing root disk online is a great plus in a > virtualized environment. What are your thoughts on this ?? > > Thanks, > Prakhar_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users