Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have setup a drbd resource between 2 server nodes - everything works correctly when doing sync tests between the two. (I want to create a HA cluster using drbd,xen and heartbeat)

However, when I try and create a XEN VM with Centos as guest operating system, I get through to the partitioning screen on the install but when I select a partitioning type the next screen gives me the following error :

"An error has occurred - no valid devices were found on which to create new file systems. Please check your hardware for the cause of this problem."

This is the first time attempting create a setup like this and searching Google does not help much...

my config files for DRBD and XEN....

DRBD (just the section that is pertinent)

on xennode0 { device /dev/drbd0; disk /dev/sda5; address X.X.X.X:7788; flexible-meta-disk internal; }

on xennode1 { device /dev/drbd0; disk /dev/sda5; address X.X.X.X:7788; meta-disk internal; }

XEN

kernel = "/boot/xeninstall/vmlinuz" ramdisk = "/boot/xeninstall/initrd.img" extra = "text" name = "VM" maxmem = 3000 memory = 3000 vcpus = 4 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" vfb = [ ] disk = [ "phy:/dev/drbd0,sda1,w", "tap:aio:/srv/xen/xenswap.img,sda2,w" ] vif = [ "mac=00:16:3e:11:67:ae,bridge=xenbr0" ] root = "/dev/sda1 ro"

Thanks in advance!

share|improve this question
    
Can you post the output of mount please? Is this problem to do with installing CentOS or formatting and installing a new DRBD partition? –  Andy Jul 16 '09 at 12:08
    
Hi Andy, thanks for the reply... The problem is with installing a domU. The dom0 is working correctly... the output of mount... /dev/sda2 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda1 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) none on /var/lib/xenstored type tmpfs (rw) –  SaberTooth Jul 16 '09 at 13:20
add comment

2 Answers

Well, seeing as though I pulled my hair out solving this, let me answer my question and save someone else the trouble of hair pulling :)

Solution:

After playing around, plenty of Googling and repartitioning etc... I came to a setup that works like a charm.

There is probably a quicker way to do this but I am not going to over complicate this answer

I did a standard install with the partitions like this (I have a 500g hard drive) :

/boot 100mb /swap 4gb / 40gb

The balance of the disk space is to be left as unpartitioned space.

Then, I created a primary partition called /dev/sda4 by following these steps:

~: fdisk /dev/sda ~: (fdisk shell) p4 (for primary partition # 4) ~: (fdisk shell) t (hit t and enter to edit the partition type) ~: (fdisk shell) 08e (Linux LVM)

Reboot the server so that the new partitions can take effect.

Now create logical volumes by:

~: pvcreate /dev/sda4

~: vgcreate xenvg -s 4M /dev/sda4 (xenvg is the name of my virtual group, you can rename it)

~: lvcreate -L400G -n xenroot xenvg (xenroot is going to be my drbd resource and root partition for my DomU)

~: lvcreate -L4G -n xenswap xenvg (xenswap is my swap file for my DomU)

Now that you have the correct partitioning you can go ahead and install DRBD with the following config file directives (drbd.conf)

Just displaying the 2 important directives here...

{ device /dev/drbd0; disk /dev/xenvg/xenroot; }

Your XEN VM config file needs to look like this (again, just the important one)

{ disk = [ "drbd:xenvm,xvda,w","phy:xenvg/xenswap,xvdb,w" ] }

I hope this helps someone out there...

share|improve this answer
add comment

So there are two points that are important here:

  1. It's better to use whole disks instead of partitions for the device the DomU will see
  2. Use standard-device-names within the DomU (xvd*)

I stumbled across the latter with the newest SLES SP3 Kernel Patch: Up to then I was using "sda" as device-name within the DomU.

Now my paravirtualized DomUs just hung during the application of the kernel-patch. An strace of the patch-process showed me that something was trying to access sda as if it were a physical disk. After changing sda to xvda I had no problems any more.

With CentOS 4 as paravirtualized DomU it was quite tricky to use "sda", too. I had to convince the system not to use the scsi-driver for that device, but the xenblock-driver instead. Basically the same problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.