Xen Cloud Platform (XCP) – Local ISO Storage Repositories


XCP supports local ISO storage on an internal hard drive. It is not available as an option in the xsconsole – Disk and Storage Repositories menu. However you can set one up with a little bit of command line magic.

The best way to do this is by using a second hard drive in the server. Once installed use fdisk to create the partition.

fdisk /dev/sdb

Proceed to follow the prompts and create a new partition using the ext3 file system.

Once the partition is created format it:

mke2fs -j /dev/sdb1

Now make the directory that will be the mount point for the volume.

mkdir -p /var/opt/xen/iso_import

Mount it.

mount /dev/sdb1 /var/opt/xen/iso_import 

Then add the following entry in /etc/fstab so that the partition is mounted at boot.

/dev/sdb1   /var/opt/xen/iso_import   ext3  defaults    0 0

Now let Xen know it’s there.

xe sr-create name-label=iso_import type=iso \
device-config:location=/var/opt/xen/iso_import/ \
device-config:legacy_mode=true content-type=iso

That’s it. You can now place ISO images in /var/opt/xen/iso_import and they should automatically show up in XenCenter under local storage. You will also be able to use them to install new virtual machines via the drop down menu.

1 Response to “Xen Cloud Platform (XCP) – Local ISO Storage Repositories”

  1. Sunil

    This article is great but I’m having slightly different XCP problem with local storage. Following are my scenario.

    I have HPDL360 server with 4 raid disk(600G).
    At the time of XCP install it see only one commbined raid disk of 1.8TB(/dev/sda), unlinke other linux installation it doesn’t display the partition option.

    I tried to partition /dev/sda with fdisk utility but it doesn’t work and wipeout XCP installation.

    I want to create a guest with local disk on xcp host server but couldn’t find a way to do that. XCP documentation is almost silent. Since it doesn’t let me partion the existing RAID disk, I can’t allocate disk for guest.

    I need to put guest on local disk for I/O performance reason.

    Any help/BKM would be greatly appreciated.