13.5.2. Virtual Storage Devices

13.5.2. Virtual Storage Devices

Perform the following steps to configure additional virtual storage devices for your guest.

Edit your guest configuration file in /etc/xen/YourGuestName replacing YourGuestName with the name of your guest. The original entry may look like the one below.

disk = [ "file:/var/lib/xen/images/rhel5_64_fv.dsk,hda,w"]

Add an additional entry for your new physical device, LUN, partition or volume to the “disk=” section of the configuration file. The storage entity the para-virtualized driver the updated entry would like the following. Note the use of “tap:aio” for the para-virtualized device if a file based image is used.

disk = [ "file:/var/lib/xen/images/rhel5_64_fv.dsk,hda,w",
    "tap:aio:/var/lib/xen/images/UserStorage1.dsk,xvda,w" ]

If you want to add more entries just add them to the “disk=” section as a comma separated list.

Note

You need to increment the letter for the 'xvd' device, that is for your second storage entity it would be 'xvdb' instead of 'xvda'.

disk = [ "file:/var/lib/xen/images/rhel5_64_fv.dsk,hda,w",
    "tap:aio:/var/lib/xen/images/UserStorage1.dsk,xvda,w" ] 
    "tap:aio:/var/lib/xen/images/UserStorage2.dsk,xvdb,w" ]

Verify the partitions have been created and are available.

# cat /proc/partitions
major minor  #blocks    name
   3     0   10485760   hda
   3     1     104391   hda1
   3     2   10377990   hda2
 202     0      64000   xvda
 202     1      64000   xvdb
 253     0    8257536   dm-0
 253     1    2031616   dm-1

In the above output you can see the partition or device “xvdb” is available to the system.

Mount the new devices and disks to local mount points and update the /etc/fstab inside the guest to mount the devices and partitions at boot time.

# mkdir /mnt/pvdisk_xvda
# mkdir /mnt/pvdisk_xvdb
# mount /dev/xvda /mnt/pvdisk_xvda
# mount /dev/xvdb /mnt/pvdisk_xvdb
# df /mnt/pvdisk_p1
Filesystem           1K-blocks      Used   Available Use%  Mounted on
/dev/xvda                64000        15       63985   1%  /mnt/pvdisk_xvda
/dev/xvdb                64000        15       63985   1%  /mnt/pvdisk_xvdb

Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.