[XCP-ng] Set up NFS Shared Storage and enable High Availability

After successfully setting up Resource Pool on Xen Orchestra, I was able to continue researching advanced features: setting up NFS Shared Storage and configuring High Availability for virtual machines.

High availability (which can be understood as “Always on duty”) is a feature that allows devices or web servers to be always ready to serve, minimizing disruption to the entire system.

1. Create NFS Shared Storage

I will create a dedicated network storage area for the Resource Pool. This network drive is set up on another server, and shared through the NFS Server.

Create more storage areas by going to New -> Storage to create a new storage area.

Section General

  • Host: select any server belonging to My Pool.
  • Name: the name of the storage area
  • Description: caption
  • Storage Type: NFS

Settings section:

  1. Enter IP of NFS Server
  2. Click on the search icon to connect
  3. Select the folder in the Path . section

Scroll down and click Create to create.

After creating, accessing the Storage section will see NFS Shared Storage appear, with the parameter Shared nfs.

2. Create a new virtual machine

I will create a new virtual machine with a virtual drive stored on NFS Shared Storage, pay attention to the following 2 items.

  1. Select My Pool (cannot select individual server)
  2. Select NFS Shared Storage in the Disks section.

The remaining items are optional according to usage needs, then click Create to create a new virtual machine.

The virtual machine after creation will be automatically linked to 1 of the servers located in the Pool. For example, Ubuntu 22.04 is on xcp-ng-18 server and VyOS is on xcp-ng-17 server.

3. Activate High Availability

Access the Pool, click through the Advanced tab, you will see the High Availability feature is turned off (Disable).

To enable High Availability (HA) for the Resource Pool, we need to use the CLI command line interface (SSH to 1 of the servers in the Pool) to enable HA for Shared Storage with the following command.

xe pool-ha-enable heartbeat-sr-uuids=<SR_UUID>

To find the UUID, click on the name of the corresponding Shared Storage and copy the code below the name.

Or you can use the following command to find Storage’s UUID

xe sr-list shared=true
uuid ( RO)                : f26868ac-a772-f769-531b-ed5d8e688e5a
          name-label ( RW): XCP-ng Tools
    name-description ( RW): XCP-ng Tools ISOs
                host ( RO): <shared>
                type ( RO): iso
        content-type ( RO): iso

uuid ( RO)                : b918ca9c-8bcd-b144-5aa4-b37c2f594a79
          name-label ( RW): NFS Shared Storage
    name-description ( RW): Shared Storage
                host ( RO): <shared>
                type ( RO): nfs
        content-type ( RO): user

uuid ( RO)                : 6a2980f5-dd3e-0409-bb44-bc3f47e1542e
          name-label ( RW): ISO Storage
    name-description ( RW): ISO Storage
                host ( RO): <shared>
                type ( RO): iso
        content-type ( RO): iso

Enable High Availabity for NFS Shared Storage (UUID: b918ca9c-8bcd-b144-5aa4-b37c2f594a79)

xe pool-ha-enable heartbeat-sr-uuids=b918ca9c-8bcd-b144-5aa4-b37c2f594a79

Back to Xen Orchestra, you will see that next to the name of NFS Shared Storage, the word HA will appear.

Next to the name of My Pool will also have an HA icon, confirming that the Pool has enabled the High Availability feature.

The High Availability section has now been changed to Enable.

In the following part, I will guide you to enable High Availability of virtual machines located in My Pool and demo how High Availability works on XCP-ng.

Reference: Xen-Orchestra

If my article has provided valuable insights and information to you, consider showing your appreciation with a virtual pat on the back or a kind message. Your encouragement will drive me to continue creating and sharing informative content. Thank you for taking the time to read!

Leave a Reply

Your email address will not be published. Required fields are marked *