Add and use ISO library repository in Xen XCP-ng

You can download this article in PDF format via the link below to support us.
Download the guide in PDF formatshut down

In the previous article, we introduced you to the installation of XCP-ng Hypervisor and how to use XenCenter to manage XCP-ng Hypervisor. XCP-ng Center. Once the management program and management of XenCenter are configured, the configuration of the network and the repository can be performed. In Xen virtualization, the storage library is where VM disks (VDI SR) and ISO files are stored. In this guide, we introduced how to configure an ISO library repository in Xen and upload some ISO files to it.

Two types of ISO SR can be configured in Xen:

  • NFS ISO -This SR type deals with CD images stored as files in ISO format and can be used as an NFS share.
  • Windows file sharing (SMB / CIFS) -This SR type deals with CD images stored as files in ISO format, these images can be used as Windows (SMB / CIFS) shares.

Configure a new ISO repository in Xen

We will use XenCenter / XCP-ng Center in this setup, but Xen Orchestra It can also be used to achieve the same effect.

An NFS server is required to store ISO images. We will configure the NFS share on the Linux server.

Step 1: Install the NFS server

Use the following command 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 8 / CentOS 7:

sudo yum -y install nfs-utils

Once the NFS server is installed, use the following command to enable the service:

sudo systemctl enable --now rpcbind nfs-server

Step 2: Configure NFS share

Create an ISO library directory on the NFS server:

sudo mkdir -p /mnt/isos

Configure the 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 stock

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

On CentOS NFS server

If a firewall is running, the NFS service is allowed:

$ 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 the ISO repository

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

On the next screen, select “ISO libraryConfigure ISO library repository Xen XCP ng 02 02

Name the repository. You can use the default name without renaming.Configure ISO library repository Xen XCP ng 03 02

Enter the NFS share path in the Share Name box. example: 192.168.20.2:/mnt/isos

where is it:

  • 192.168.20.2 is the IP address of the NFS server
  • /mnt/isos is the path of the ISO file directory exported in the NFS server.

Configure ISO library repository Xen XCP ng 04 02

For Windows File Sharing SMB / CIFS, the format of the share name is Servershare name

Confirm that the repository has been added and is visible.Configure ISO library repository Xen XCP ng 05 02

Step 4: Add the ISO file to the NFS share

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

Switch to the nfs shared directory:

sudo su -
cd /mnt/isos

Download the ISO file to this directory. See the example below;

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

# CentOS 8 Stream Minimal ISO
wget https://centos.mirror.liquidtelecom.com/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-20210406-boot.iso

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

Confirm whether you can see the ISO file on the XCP-ng server:Configure ISO library repository Xen XCP ng 06

In the next guide, we will discuss installing Linux and Windows virtual machines from ISO files in the ISO library.

More guidance on virtualization:

Configure NFS file system as OpenNebula data storage

How to add a computing host to oVirt virtualization

Install OpenNebula LXD node on Debian

You can download this article in PDF format via the link below to support us.
Download the guide in PDF formatshut down

Related Posts