Augusto Castelan Carlson
2008-Jan-11 13:39 UTC
[Fedora-xen] add 2 lvm to guest with virt-manager
Hi! I did some research in the archives and found one message (https://www.redhat.com/archives/fedora-xen/2007-December/msg00019.html) related with my doubt, but without answer that I repeat below. "If, for example, a guest has separate /root, /boot, and swap do you recommend as best practice a separate logical volume for each or do you give just one logical volume to the guest for it to dice up into the various types of file systems? Is there a significant performance difference between these two solutions?" If it is a good practice to separate logical volumes, how can I add 2 logical volume to be used by the guest? Thanks in advance. Regards, Augusto
Are you trying to use 2 logical volumes to separate / and /boot inside the VM, or present 2 logical volumes (which would show up as 2 separate disks entirely, xvda and xvdb for instance) to the guest from domain-0? If all you want to do is have 2 separate logvols for / and /boot, then just present 1 logvol to the guest (which would show up inside the guest as xvda). Then you just partition that like any other physical disk into logical volumes (as many as you want, /, /boot, /var, /home, et cetera) If you are trying to present 2 logvols to the VM itself, those will show up as 2 separate disks inside the VM, as I mentioned (xvda, xvdb, or in HVM sda, sdb, .. you get the idea) and I would wonder why you would want to do that. Mark Augusto Castelan Carlson wrote:> Hi! > > I did some research in the archives and found one message > (https://www.redhat.com/archives/fedora-xen/2007-December/msg00019.html) > related with my doubt, but without answer that I repeat below. > > "If, for example, a guest has separate /root, /boot, and swap do you > recommend as best practice a separate logical volume for each or do > you give just one logical volume to the guest for it to dice up into > the various types of file systems? Is there a significant performance > difference between these two solutions?" > > If it is a good practice to separate logical volumes, how can I add 2 > logical volume to be used by the guest? > > Thanks in advance. > > Regards, > > Augusto > > -- > Fedora-xen mailing list > Fedora-xen@redhat.com > https://www.redhat.com/mailman/listinfo/fedora-xen >
Augusto Castelan Carlson
2008-Jan-11 14:05 UTC
Re: [Fedora-xen] add 2 lvm to guest with virt-manager
Hi!> Are you trying to use 2 logical volumes to separate / and /boot inside > the VM, or present 2 logical volumes (which would show up as 2 separate > disks entirely, xvda and xvdb for instance) to the guest from domain-0?I''m trying to present 2 logical volumes to the VM.> If you are trying to present 2 logvols to the VM itself, those will show > up as 2 separate disks inside the VM, as I mentioned (xvda, xvdb, or in > HVM sda, sdb, .. you get the idea) and I would wonder why you would want > to do that.How can I present 2 logvols to the VM? I proposed to my "boss" to present one logvols to the VM and then do the partitioning inside the VM (xvda1 = /home, xvda2 = /groups,...), but he wants to present 2 logvols, one to be used for /home and the other for /groups... Do you believe that is better to present only one logvols? If so, please tell me, maybe a can convince him about use only one. Thanks! Regards, Augusto
Augusto Castelan Carlson wrote:> Hi! > > >> Are you trying to use 2 logical volumes to separate / and /boot inside >> the VM, or present 2 logical volumes (which would show up as 2 separate >> disks entirely, xvda and xvdb for instance) to the guest from domain-0? >> > > I''m trying to present 2 logical volumes to the VM. > > >> If you are trying to present 2 logvols to the VM itself, those will show >> up as 2 separate disks inside the VM, as I mentioned (xvda, xvdb, or in >> HVM sda, sdb, .. you get the idea) and I would wonder why you would want >> to do that. >> > > How can I present 2 logvols to the VM? > > I proposed to my "boss" to present one logvols to the VM and then do > the partitioning inside the VM (xvda1 = /home, xvda2 = /groups,...), > but he wants to present 2 logvols, one to be used for /home and the > other for /groups... > >OK, well I''m not sure what benefit this would provide you honestly. I am assuming that both logvols you present to the VM are coming from the same storage (be it SAN or local disk). You are lucky (if you insist on using virt-manager), however, in that it''s /groups you want to partition off. You could simply install the system as normal with /, /boot, /home, et al, residing on xvda. Then you shut the VM down, edit the config file for the VM to add the second logical volume as xvdb, start the VM back up and fdisk/partition/format and create your logical volumes as you would normally. Think of it as installing a new box, then shutting it down to physically add a new hard disk. It makes things a little easier it you think of VMs as being just like any other server, the same thing you''d do to a physical box you have to pretty much do with a VM (there are exceptions, block attach, etc) but the hardware is just "virtual" vs. physical. OR -- simpy use virt-install. It''s a cmd line based too, but I find faster and simpler to use. The -f flag is used to present a disk, you just add -f as many times for as many logical volumes you want to present. I would expect that it orders them just as you do on the command line.> Do you believe that is better to present only one logvols? If so, > please tell me, maybe a can convince him about use only one. > >I add 2 logical volumes all the time to just about every VM I have, but I typically do it because the LV in question is shared among VMs with GFS partitions inside the VM in a cluster of virtual systems :) again, just add -f as many times as you want using virt-install.> Thanks! > > Regards, > Augusto >
Dustin Henning
2008-Jan-11 14:24 UTC
RE: [Fedora-xen] add 2 lvm to guest with virt-manager
Augusto, What you present to the VM is virtual disks. I believe what you want to do is create one logical volume to the VM as a disk (xda), and then partition that virtual disk using lvm (create a logical group and logical volumes on that virtual disk). With partitions, you can do that by fdisking a partition and providing the partition as the virtual disk. i.e.: fdisk /dev/sdb3, partition as you would a disk, provide /dev/sdb3 as xvda. However, I don''t know if it is that simple with lvm. Alternately, assuming that you are using hvm, you would just provide your virtual disk (something like sdb3 or something like loggroup01/logvol03 in the config) to the vm and install/configure lvm on hda during setup. If using paravirtualization, I don''t know whether or not you go through the full blown manual install process, but if you do, it would be the very similar, you would just provide your virtual disk (something like sdb3 or something like loggroup01/logvol03 in the config) to the vm and install/configure lvm on xvda during setup. If you don''t go through the full blown manual setup when using pv, hopefully someone else can tell you how you would configure lvm on the virtual disk. Dustin -----Original Message----- From: fedora-xen-bounces@redhat.com [mailto:fedora-xen-bounces@redhat.com] On Behalf Of Augusto Castelan Carlson Sent: Friday, January 11, 2008 09:06 To: Mark Nielsen Cc: fedora-xen@redhat.com Subject: Re: [Fedora-xen] add 2 lvm to guest with virt-manager Hi!> Are you trying to use 2 logical volumes to separate / and /boot inside > the VM, or present 2 logical volumes (which would show up as 2 separate > disks entirely, xvda and xvdb for instance) to the guest from domain-0?I''m trying to present 2 logical volumes to the VM.> If you are trying to present 2 logvols to the VM itself, those will show > up as 2 separate disks inside the VM, as I mentioned (xvda, xvdb, or in > HVM sda, sdb, .. you get the idea) and I would wonder why you would want > to do that.How can I present 2 logvols to the VM? I proposed to my "boss" to present one logvols to the VM and then do the partitioning inside the VM (xvda1 = /home, xvda2 = /groups,...), but he wants to present 2 logvols, one to be used for /home and the other for /groups... Do you believe that is better to present only one logvols? If so, please tell me, maybe a can convince him about use only one. Thanks! Regards, Augusto -- Fedora-xen mailing list Fedora-xen@redhat.com https://www.redhat.com/mailman/listinfo/fedora-xen
oops, I was just advised of the limits when adding multiple logical volumes to a VM... "you can have upto 3 for fullvirt (or 4 if you PXE it instead of CDRM), or 16 for paravirt" - thanks Dan B. Mark Mark Nielsen wrote:> Augusto Castelan Carlson wrote: >> Hi! >> >> >>> Are you trying to use 2 logical volumes to separate / and /boot inside >>> the VM, or present 2 logical volumes (which would show up as 2 separate >>> disks entirely, xvda and xvdb for instance) to the guest from domain-0? >>> >> >> I''m trying to present 2 logical volumes to the VM. >> >> >>> If you are trying to present 2 logvols to the VM itself, those will >>> show >>> up as 2 separate disks inside the VM, as I mentioned (xvda, xvdb, or in >>> HVM sda, sdb, .. you get the idea) and I would wonder why you would >>> want >>> to do that. >>> >> >> How can I present 2 logvols to the VM? >> >> I proposed to my "boss" to present one logvols to the VM and then do >> the partitioning inside the VM (xvda1 = /home, xvda2 = /groups,...), >> but he wants to present 2 logvols, one to be used for /home and the >> other for /groups... >> >> > OK, well I''m not sure what benefit this would provide you honestly. I > am assuming that both logvols you present to the VM are coming from > the same storage (be it SAN or local disk). You are lucky (if you > insist on using virt-manager), however, in that it''s /groups you want > to partition off. You could simply install the system as normal with > /, /boot, /home, et al, residing on xvda. Then you shut the VM down, > edit the config file for the VM to add the second logical volume as > xvdb, start the VM back up and fdisk/partition/format and create your > logical volumes as you would normally. Think of it as installing a new > box, then shutting it down to physically add a new hard disk. It makes > things a little easier it you think of VMs as being just like any > other server, the same thing you''d do to a physical box you have to > pretty much do with a VM (there are exceptions, block attach, etc) but > the hardware is just "virtual" vs. physical. > > OR -- simpy use virt-install. It''s a cmd line based too, but I find > faster and simpler to use. The -f flag is used to present a disk, you > just add -f as many times for as many logical volumes you want to > present. I would expect that it orders them just as you do on the > command line. >> Do you believe that is better to present only one logvols? If so, >> please tell me, maybe a can convince him about use only one. >> >> > I add 2 logical volumes all the time to just about every VM I have, > but I typically do it because the LV in question is shared among VMs > with GFS partitions inside the VM in a cluster of virtual systems :) > again, just add -f as many times as you want using virt-install. >> Thanks! >> >> Regards, >> Augusto >> > > -- > Fedora-xen mailing list > Fedora-xen@redhat.com > https://www.redhat.com/mailman/listinfo/fedora-xen >
Augusto Castelan Carlson
2008-Jan-11 16:07 UTC
Re: [Fedora-xen] add 2 lvm to guest with virt-manager
Hi!> Then you shut the VM down, edit the config file > for the VM to add the second logical volume as xvdb, start the VM back > up and fdisk/partition/format and create your logical volumes as you > would normally.Only to be sure, this config file is the one placed in /var/lib/xend/domains/.../config.sxp? Regards, Augusto
Augusto Castelan Carlson wrote:> Hi! > > >> Then you shut the VM down, edit the config file >> for the VM to add the second logical volume as xvdb, start the VM back >> up and fdisk/partition/format and create your logical volumes as you >> would normally. >> > > Only to be sure, this config file is the one placed in > /var/lib/xend/domains/.../config.sxp? > >someone else needs to verify that :) I''ve only been working on RHEL 5. I know there were changes somewhere in the Fedora line, but I''m not familiar with them.> Regards, > > Augusto >Mark
Daniel P. Berrange
2008-Jan-11 16:10 UTC
Re: [Fedora-xen] add 2 lvm to guest with virt-manager
On Fri, Jan 11, 2008 at 02:07:22PM -0200, Augusto Castelan Carlson wrote:> Hi! > > > Then you shut the VM down, edit the config file > > for the VM to add the second logical volume as xvdb, start the VM back > > up and fdisk/partition/format and create your logical volumes as you > > would normally. > > Only to be sure, this config file is the one placed in > /var/lib/xend/domains/.../config.sxp?No, don''t edit that unless you want your changes to be thrown away / randomly overwriten at will. Either use virt-manager to add/remove devices, or using virsh you can do the following: virsh dumpxml [NAME|UUID|ID of GUEST] > NAME.xml emacs NAME.xml virsh define NAME.xml That will ensure that the config is loaded into XenD correctly, and will indirectly modify the files in /var/lib/xend in a safe fashion Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|