Virtualisation Part 2 – Storage
What is GlusterFS
GlusterFS is a clustered file system.
Similar to RAID in principle but uses physical servers in place of disks.
Where did we get to?
Built a hypervisor based on KVM and libvirt.
Added a second hypervisor for resilience.
Used shared storage to hold the virtual hard disks (NFS).
Ability to migrate the virtual machines between physical hypervisors.
Our setup was not 100% resilient due to storage residing on only 1 host.
A BIT MORE ABOUT GLUSTERFS
Servers classed as bricks.
Striping, Mirroring Replication based storage.
Load balancing, High availability and failover.
Traditional connectivity methods (NFS).
yum install glusterfs glusterfs-server nfs-utils
yum install glusterfs glusterfs-fuse
TURN IT ON…
systemctl start glusterd.service
systemctl start rpcbind.service
service glusterd start
service rpcbind start
rpcbind is to allow NFS connectivity to the service
CREATE THE VOLUMES
Lets create a directory to host the volume. This is what is classed as a brick. On all servers run:
On host1 run:
gluster peer probe host2
This makes the hosts become “friends”, add as many hosts here as you like. Note: DNS records or hosts file needs to be in place to allow name resolution.
CONNECTING THE GLUSTER CLUSTER
On host1 the following command will create the glusterfs volume gluster-vmstore:
gluster volume create gluster-vmstore replica 2 host1:/vmstore host2:/vmstore
This uses the directory (/vmstore) we created as a storage brick for our GlusterFS volume
STARTING THE CLUSTER
We must now startup our replicated volume:
gluster volume start gluster-vmstore
The server side configuration of GlusterFS is now complete.
LETS MOUNT THE VOLUMES
Each node mounts it’s own brick.
mount localhost:/gluster-vmstore /mnt/gluster
Anything written to /mnt/gluster-vmstore on either host is replicated to the other node(s) in the GlusterFS cluster.
USING THIS WITH LIBVIRT
Add new storage into Virt-Manager, can be NFS or GlusterFS.
Virtual Hard disk files now reside on all Gluster/libvirt nodes.
High Availability/Failover – Heartbeat
Current failover would be manual, automate this to complete the picture
Because the demo didn’t work correctly at the meet I put together a screen cast of the whole process: