Xen Cloud Platform (XCP) – Add A Disk To The Default LVM Volume Group

image_pdfimage_print

If you initially install XCP using only one disk you can still add more drives later if you find you need more room. XCP uses LVM storage to manage the partitions created for new Virtual Machines which allows you to extend the default volume group at your leisure among other things.

In order to add a new disk to your default volume group perform the following steps.

Install the new drive into the computer

Partition it using fdisk

fdisk /dev/sdb

After you create the partition change it’s type to Linux LVM:

Enter the menu option T to change the partition type:

Enter the menu option 1 to choose the first partition:

Enter the menu item 8e to choose Linux LVM:

Enter the menu item p to print the partition output to verify that it is set to Linux LVM:

Enter the menu item w to save the partition information:

Enter the menu item q to quit:

Now we can add the partition to the volume group.

Set the partition as a physical volume:

pvcreate /dev/sdb1

Find out the name of the existing volume group:

pvdisplay

This should output something like this:

   --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               VG_XenStorage-be47438c-f310-dcf6-744e-651ba2bfaff9
  PV Size               457.76 GB / not usable 6.62 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              117183
  Free PE               96097
  Allocated PE          21086
  PV UUID               ZCI4EI-EURD-H5lK-VTlt-ZahV-itnl-bgMyiN

We are interested in this line:

VG Name          VG_XenStorage-be47438c-f310-dcf6-744e-651ba2bfaff9

Add the new physical volume to the existing volume group

vgextend /dev/VG_XenStorage-be47438c-f310-dcf6-744e-651ba2bfaff9 \
/dev/sdb1

Now you can verify that it worked by typing:

vgs

This should list the volume group and display it’s current size, which should indicate the size of the old volume group + the size of the added disk.

2 Responses to “Xen Cloud Platform (XCP) – Add A Disk To The Default LVM Volume Group”


  1. chris

    This is a great how-to and i really appreciate it. I decided to add a local RAID5 volume to xen cloud platform. I setup the disks as raid in the bios and configured them as hardware raid on the motherboard but I can’t seem to get xen cloud to see the array. I tried using dmraid but i get an error “device-mapper target type “raid45″ is not in the kernel” Device isw_ddeghccjgbj_V0 (V0 being the name i gave the array in hardware) could not be activated. This is as far as I’ve gotten. Any tips you can provide would be welcome.

  2. Ronny

    It sounds like you are using software raid instead of hardware raid.  The centos linux kernel will need to contain the drivers for your card either built in or as modules. I would suggest doing some research on how to get your raid working under centos instead of xcp.