[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Re: Partition vs disk images


  • To: xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Fajar A. Nugraha" <fajar@xxxxxxxxx>
  • Date: Fri, 02 May 2008 10:01:45 +0700
  • Delivery-date: Thu, 01 May 2008 20:02:19 -0700
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Rob Greene wrote:
On Tue, Apr 29, 2008 at 10:15 PM, Fajar A. Nugraha <fajar@xxxxxxxxx> wrote:

In RHEL 5 at least, anaconda requires the block device/file to be mapped as 
disk (e.g hda, sda) not partition (e.g. sda1). Try changing it to
disk = [ "phy:lvm-raid/FileVolGroup,sda,w" ]


 Ok, so (at least in CentOS/RHEL?) the Xen domU sees the dom0
partition not as a partition but as a physical disk?

Mark's post put this in a well-phrased statement : "the *installer* used by CentOS/RHEL
guests will be unhappy if you try and provide it with separate partitions
instead of a whole disk"

It's redhat installer issue, not a Xen issue. In other words, if you want to use redhat installer to setup domU, you should map it as a disk, not partition.

sda1, sda, and
hda all failed

Try xvda. That's the default device name used when you use virt-manager.

What concerns me is that if/when I want to grow disk available to a
domU (this on in particular is a file server), I can't just grow what
shows up as hda1, right?  I'd need to add a new "disk" and extend a
LVM within the domU?

Yup.

Don't these layers of RAID+LVM (dom0) and Xen block device and LVM
(domU) come at a price?

Around 3% performance penalty, I believe.

I was hoping that the partition got mapped
straight into the domU so I avoided any extra stuff within the domU
and I would have the added bonus of being able to mount the drives and
copy files between when setting this up.


The "recommended" way, if you want to use virt-manager and redhat installer, is to have LVM on domU side only. Meaning :
- you map partitions or disks (not LVM) on dom0 as whole disk on domU
- the installer will setup LVM (in domU) on that disk
- to extend domU's fs, map another partition/disk to domU as whole disk, and use LVM on domU to extend the VG and LV


Having said that, if you're building lots of identical domUs, using prebuilt 
template (and mappingthe block device  as sda1 instead of sda) should be faster 
than installer.

If I can only do partitions, how does this work then?  Unless all the
drives are identical in size and I 'dd' the device??

Not necessarily :) You can always use tar to copy the files.

I have prebuilt images of RHEL4 and RHEL5 domUs. To create a domU, what I did was :
- create two LVMs on domU : e.g. testrootlv and testswaplv
- initialize the LVMs : mkfs and mkswap
- create Xen config file, which is something like

==========================
memory = "250"
disk = [ 'phy:/dev/vg/testrootlv,hda1,w','phy:/dev/vg/testswaplv,hda2,w' ]
vif = [ 'mac=00:16:3E:23:3A:51, bridge=br105', ]
bootloader="/usr/bin/pygrub"
==========================

Note that in "vif" line, I specify MAC address and bridge (I setup network bridges manually, but that's another story). You should always define a static, unique MAC address for each domU for production purposes. The partition names can be or xvda1 or xvda2 if you want.

- populate root fs :
mount /dev/vg/testrootlv && (wget -O - http://location_of_install_images | tar xvfz -) && umount /mnt/tmp

- startup domU. In my setup in always start with eth0 disabled, empty root password - edit /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0, set root password
- reboot domU

The entire process took about five minutes.

You can convert an installed domU (created using installer) to a template quite easily, but I wont cover it here. Kai's post shows one way to do it.

Regards,

Fajar

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.