13.8. GlusterFS Storage Pools
This section covers enabling a GlusterFS based storage pool. Red Hat Enterprise Linux 6.5 includes native support for creating virtual machines with GlusterFS. GlusterFS is a user-space file system that uses FUSE. When enabled in a guest virtual machine it enables a KVM host physical machine to boot guest virtual machine images from one or more GlusterFS storage volumes, and to use images from a GlusterFS storage volume as data disks for guest virtual machines.
13.8.1. Creating a GlusterFS Storage Pool Using virsh
This section will demonstrate how to prepare a Gluster server and an active Gluster volume.
Procedure 13.9. Preparing a Gluster server and an active Gluster volume
- Obtain the IP address of the Gluster server by listing its status with the following command:
#
gluster volume statusStatus of volume: gluster-vol1 Gluster process Port Online Pid ------------------------------------------------------------------------------ Brick 222.111.222.111:/gluster-vol1 49155 Y 18634 Task Status of Volume gluster-vol1 ------------------------------------------------------------------------------ There are no active volume tasks - If you have not already done so, install glusterfs-fuse and enable virt_use_fusefs. Then prepare one host which will connect to the Gluster server by running the following commands:
#
setsebool virt_use_fusefs on#getsebool virt_use_fusefsvirt_use_fusefs --> on - Create a new XML file to configure a Gluster storage pool (named glusterfs-pool.xml in this example) specifying
pool typeasgluster, and add the following data:<pool type='gluster'> <name>glusterfs-pool</name> <source> <host name='111.222.111.222'/> <dir path='/'/> <name>gluster-vol1</name> </source> </pool>
Figure 13.24. GlusterFS XML file contents
- Define and start the Gluster pool, using the following commands:
#
virsh pool-define glusterfs-pool.xmlPool gluster-pool defined from glusterfs-pool.xml #virsh pool-list --allName State Autostart ----------------------------------------- gluster-pool inactive no #virsh pool-start gluster-poolPool gluster-pool started #virsh pool-list --allName State Autostart ----------------------------------------- gluster-pool active no #virsh vol-list gluster-poolName Path ----------------------------------------- qcow2.img gluster://111.222.111.222/gluster-vol1/qcow2.img raw.img gluster://111.222.111.222/gluster-vol1/raw.img
13.8.2. Deleting a GlusterFS Storage Pool Using virsh
This section details how to delete a storage pool using virsh.
Procedure 13.10. Deleting a GlusterFS storage pool
- Set the status of the storage pool to inactive, using the following command:
#
virsh pool-destroy gluster-poolPool gluster-pool destroyed - Confirm the pool is inactive, using the following command
#
virsh pool-list --allName State Autostart ----------------------------------------- gluster-pool inactive no - Undefine the GlusterFS storage pool using the following command:
#
virsh pool-undefine gluster-poolPool gluster-pool has been undefined - Confirm the pool is undefined, using the following command:
#
virsh pool-list --allName State Autostart -----------------------------------------