Add and Use ISO Library Storage Repository in Xen XCP-ng

Posted on 104 views

In our previous articles we walked you through the installation of XCP-ng Hypervisor and how to manage XCP-ng Hypervisor with XenCenter | XCP-ng Center. Once the hypervisor and management from XenCenter is configured, configuration of networking and storage repositories can be performed. In Xen virtualization Storage Repository is the place for your VM disks (VDI SR) and storage of  ISO files. In this guide we look at how you can configure ISO Library Storage Repository in Xen and upload some ISO files to it.

There are two types of ISO SR that can be configured in Xen:

  • NFS ISO – This SR type handles CD images stored as files in ISO format available as an NFS share.
  • Windows File Sharing (SMB/CIFS) – This SR type handles CD images stored as files in ISO format available as a Windows (SMB/CIFS) share.

Configure new ISO Storage Repository in Xen

We’ll be using XenCenter/XCP-ng Center in this setup but Xen Orchestra can also be used to achieve the same.

NFS Server is needed for the storing ISO images. We’ll configure NFS share on a Linux server.

Step 1: Install NFS Server

Use the commands below to install NFS Server on Ubuntu / Debian system:

# Debian / Ubuntu
sudo apt update
sudo apt install nfs-kernel-server -y

Install NFS Server on CentOS / RHEL 8 / CentOS 7:

sudo yum -y install nfs-utils

Once NFS Server is installed use the commands below to enable the service:

sudo systemctl enable --now rpcbind nfs-server

Step 2: Configure NFS Share

Create ISO Library directory in your NFS Server:

sudo mkdir -p /mnt/isos

Configure NFS Share by editing the file /etc/exports

$ sudo vim /etc/exports
# Examples
/mnt/isos *(rw,no_root_squash,no_subtree_check) #Allow access from any IP
/mnt/isos 192.168.20.0/24(rw,no_root_squash,no_subtree_check) #Allow access only from hosts in subnet 192.168.20.0/24
/mnt/isos 192.168.20.10/24(rw,no_root_squash,no_subtree_check) #Allow access only from single host IP 192.168.20.10

Export your shares

$ sudo exportfs -rrv
exporting 192.168.20.0/24:/mnt/isos

On CentOS NFS Server

If you have Firewalld running allow NFS service:

sudo firewall-cmd --add-service=nfs --permanent
sudo firewall-cmd --reload

#If use NFSv3 allow the following
sudo firewall-cmd --add-service=nfs3,mountd,rpc-bind --permanent
sudo firewall-cmd --reload

Step 3: Add ISO Storage Repository

Open your XenCenter/XCP-ng Center console and click “Storage” > “New SR” on the toolbar.

Configure-ISO-Library-Storage-Repository-Xen-XCP-ng-01-1024x371

In the next screen choose “ISO library

Configure-ISO-Library-Storage-Repository-Xen-XCP-ng-02-02-1024x697

Give the storage repository a name. The default can be used without renaming.

Configure-ISO-Library-Storage-Repository-Xen-XCP-ng-03-02-1024x687

Enter NFS share path inside “Share Name” box. Example: 192.168.20.2:/mnt/isos

Where:

  • 192.168.20.2 is the IP Address of NFS server
  • /mnt/isos is the path to ISO files directory as exported in NFS server.

Configure-ISO-Library-Storage-Repository-Xen-XCP-ng-04-02-1024x688

For Windows File Sharing SMB/CIFS the share name will have format like \server\sharename

Confirm storage repository has been added and visible.

Configure-ISO-Library-Storage-Repository-Xen-XCP-ng-uuid-1024x446

Step 4: Add ISO files to NFS share

Let’s download some ISO files to the NFS share.

Switch to nfs share directory:

sudo su -
cd /mnt/isos

Download ISO files to the directory. See below examples;

# Ubuntu 22.04 ISO
wget https://releases.ubuntu.com/jammy/ubuntu-22.04-live-server-amd64.iso

# Rocky Linux 8 Minimal ISO
wget https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.6-x86_64-minimal.iso

# Debian 11 netinstall ISO
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.3.0-amd64-netinst.iso

Confirm if ISO files can be seen on the XCP-ng server end:

Configure-ISO-Library-Storage-Repository-Xen-XCP-ng-06-1024x293

In our next guide we’ll discuss installation of Linux and Windows virtual machines from the ISO files in the ISO Library.

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.