Hello,
When I needed to build Xen guests under Debian I could follow more or less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup the Xen guest directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
The advantages of this approach are: 1. I can add more LVM's later, or share LVM's at the host level among multiple Xen guests. 2. I can easily grow/shrink the Xen guest's disks. 3. I can access the Xen guest's filesystem much more easily 5. Probably less overhead in having LVM->parition->LVM.
But I didn't find a way to achieve this with CentOS 5's automatic tools. Is this supported by CentOS as a Xen host or do I have to find my own way?
Thanks,
--Amos
Monday 10 December 2007 04:50:04 Amos Shapira napisaĆ(a):
Hello,
When I needed to build Xen guests under Debian I could follow more or less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup the Xen guest directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
The advantages of this approach are:
- I can add more LVM's later, or share LVM's at the host level among
multiple Xen guests. 2. I can easily grow/shrink the Xen guest's disks. 3. I can access the Xen guest's filesystem much more easily 5. Probably less overhead in having LVM->parition->LVM.
But I didn't find a way to achieve this with CentOS 5's automatic tools. Is this supported by CentOS as a Xen host or do I have to find my own way?
As far as I know it's not supported with standard CentOS tools.
pz
Amos Shapira wrote:
When I needed to build Xen guests under Debian I could follow more or less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup the Xen guest directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
I might be missing something, but that link seems to talk about FAI and doesn't mention xen. I'm interested in seeing how it can install on the LVM partition but the OS doesn't see it as an entire disk with a partition table. What does "fdisk -l" show, then?
johnn
Johnny Tan wrote:
Amos Shapira wrote:
When I needed to build Xen guests under Debian I could
follow more or
less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup
the Xen guest
directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
I might be missing something, but that link seems to talk about FAI and doesn't mention xen. I'm interested in seeing how it can install on the LVM partition but the OS doesn't see it as an entire disk with a partition table. What does "fdisk -l" show, then?
Here is a good link: http://wiki.rpath.com/wiki/Xen_DomU_Guide
The Xen domU or HVM will treat the partition as a whole disk, so that means MBR and stuff, but you can mount it on dom0 as such:
# fdisk -l -u /dev/es_storage/exch_data.1
Disk /dev/es_storage/exch_data.1: 218.2 GB, 218233831424 bytes 255 heads, 63 sectors/track, 26532 cylinders, total 426237952 sectors Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System /dev/es_storage/exch_data.1p1 128 426220514 213110193+ 7 HPFS/NTFS
# mount -t ntfs -o loop,offset=128 /dev/es_storage/exch_data.1 /mnt
That will create an auto-loop mount of the partition at sector offset 128.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Ross S. W. Walker wrote:
Johnny Tan wrote:
Amos Shapira wrote:
When I needed to build Xen guests under Debian I could
follow more or
less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup
the Xen guest
directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
I might be missing something, but that link seems to talk about FAI and doesn't mention xen. I'm interested in seeing how it can install on the LVM partition but the OS doesn't see it as an entire disk with a partition table. What does "fdisk -l" show, then?
Here is a good link: http://wiki.rpath.com/wiki/Xen_DomU_Guide
The Xen domU or HVM will treat the partition as a whole disk, so that means MBR and stuff, but you can mount it on dom0 as such:
# fdisk -l -u /dev/es_storage/exch_data.1
Disk /dev/es_storage/exch_data.1: 218.2 GB, 218233831424 bytes 255 heads, 63 sectors/track, 26532 cylinders, total 426237952 sectors Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End
Blocks Id System /dev/es_storage/exch_data.1p1 128 426220514 213110193+ 7 HPFS/NTFS
# mount -t ntfs -o loop,offset=128 /dev/es_storage/exch_data.1 /mnt
That will create an auto-loop mount of the partition at sector offset 128.
Oops, offset is in bytes not sectors, so it would be offset 65536 in my case (sector * 512).
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Ross S. W. Walker wrote:
Johnny Tan wrote:
Amos Shapira wrote:
When I needed to build Xen guests under Debian I could
follow more or
less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup
the Xen guest
directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
I might be missing something, but that link seems to talk about FAI and doesn't mention xen. I'm interested in seeing how it can install on the LVM partition but the OS doesn't see it as an entire disk with a partition table. What does "fdisk -l" show, then?
Here is a good link: http://wiki.rpath.com/wiki/Xen_DomU_Guide
Based on that link, this seems like a regular install of Xen onto a LVM partition. I thought Amos was referring to some special setup.
CentOS can definitely do this. Just setup LVM, and then manually edit the /etc/xen/myvm file so that the disk line is:
disk = [ 'phy:/dev/myvg/mylv,xvda,w', ]
johnn
Johnny Tan wrote:
Ross S. W. Walker wrote:
Johnny Tan wrote:
Amos Shapira wrote:
When I needed to build Xen guests under Debian I could
follow more or
less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup
the Xen guest
directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
I might be missing something, but that link seems to talk about FAI and doesn't mention xen. I'm interested in seeing how it can install on the LVM partition but the OS doesn't see it as an entire disk with a partition table. What does "fdisk -l" show, then?
Here is a good link: http://wiki.rpath.com/wiki/Xen_DomU_Guide
Based on that link, this seems like a regular install of Xen onto a LVM partition. I thought Amos was referring to some special setup.
CentOS can definitely do this. Just setup LVM, and then manually edit the /etc/xen/myvm file so that the disk line is:
disk = [ 'phy:/dev/myvg/mylv,xvda,w', ]
you can short hand it [ 'phy:myvg/mylv,xvda,w' ]
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
On 11/12/2007, Ross S. W. Walker rwalker@medallion.com wrote:
Johnny Tan wrote:
Amos Shapira wrote:
When I needed to build Xen guests under Debian I could
follow more or
less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup
the Xen guest
directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
I might be missing something, but that link seems to talk about FAI and doesn't mention xen. I'm interested in seeing how it can install on the LVM partition but the OS doesn't see it as an entire disk with a partition table. What does "fdisk -l" show, then?
Here is a good link: http://wiki.rpath.com/wiki/Xen_DomU_Guide
The Xen domU or HVM will treat the partition as a whole disk, so that means MBR and stuff, but you can mount it on dom0 as such:
# fdisk -l -u /dev/es_storage/exch_data.1
Disk /dev/es_storage/exch_data.1: 218.2 GB, 218233831424 bytes 255 heads, 63 sectors/track, 26532 cylinders, total 426237952 sectors Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/es_storage/exch_data.1p1 128 426220514 213110193+ 7 HPFS/NTFS
# mount -t ntfs -o loop,offset=128 /dev/es_storage/exch_data.1 /mnt
That will create an auto-loop mount of the partition at sector offset 128.
Yes I'm familiar with that trick (including your correction below, though I usually use explicit losetup) but it still: 1. Isn't as easy and safe as a direct "mount" 2. There is still some overhead of having LVM-over-LVM.
Thanks,
--Amos
On 11/12/2007, Ross S. W. Walker rwalker@medallion.com wrote:
Here is a good link: http://wiki.rpath.com/wiki/Xen_DomU_Guide
Ah and forgot to say "thank you" for the link. Looks useful.
Cheers,
--Amos
On 11/12/2007, Johnny Tan linuxweb@gmail.com wrote:
Amos Shapira wrote:
When I needed to build Xen guests under Debian I could follow more or less the instructions in http://preview.tinyurl.com/2oc48r and the advantage of this approach is that it allows me to setup the Xen guest directly on the LVM partition without making it consider the LVM partition as an entire disk with a partition table.
I might be missing something, but that link seems to talk about FAI and doesn't mention xen. I'm interested in seeing how it can install on the LVM partition but the OS doesn't see it as an entire disk with a partition table. What does "fdisk -l" show, then?
The anchor I pointed to is about instructions for creating an entire CentOS file system hierarchy using Yum on Debian without having to go through the CentOS boot process. Nothing to do with FAI except that I found the instructions extremely useful for my needs.
So what I used to do on Debian Dom0 in order to build a new CentOS 5 DomU was: 1. Create an LV for the filesystem, "mke2fs -j /dev/xen/created-lv-name", "mount ..." 2. Go through those instructions to setup the filesystem hierarchy. 3. "umount /dev/xen/created-lv-name", create another LV for the swap 4. Manually configure the /etc/xen/*.cfg file to use the new LV's and map them into disks in the guest machine:
disk = [ 'phy:/dev/xen/centos5.0-01-root,ioemu:sda1,w', 'phy:/dev/xen/centos5.0-01-swap,ioemu:sda2,w'] device_model='/usr/lib/xen-3.0.3-1/bin/qemu-dm'
5. boot the image as a Xen guest.
As for the fdisk output - it looks for partition tables on each of the mapped LV's but doesn't find them:
# fdisk -l
Disk /dev/sda1: 17.1 GB, 17179869184 bytes 255 heads, 63 sectors/track, 2088 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sda1 doesn't contain a valid partition table
Disk /dev/sda2: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sda2 doesn't contain a valid partition table
I suspect that maybe I could follow the same procedure under CentOS but under the current deadline pressure I'm looking for the fastest route.
Cheers,
--Amos