Create And Remove A Local Storage Repository On Xen Server/XCP-NG

When it comes to installation of a New VMs, I do prefer to copy the ISO via NFS on the Xen Server, Then continue with my installation, But from the network configuration by the network admin, My PC has been given access to reach other Servers on different VLANS, But those servers can't reach my PC, So That options can't work for me, So I have to create a local storage repository.

My Manager always prefer to pull it from the Xen Repository but for me I don't like this method, I prefer to create a Local Storage Repo, Copy the ISO I downloaded and copy it via SFTP or WinSCP, And continue with the installation.

How To Create A Local Storage Repository On Xen Server/XCP-NG

  • Login Via SSH to server and create a new directory.
  • I created mine in /var/Local_ISO, meaning Local_ISO is the name of the folder.
    Example
mkdir -p /var/Local_ISO

Then Add the folder to Xen SR which displays via Xen/XCP-NG Center,

xe sr-create name-label=Local_ISO type=iso device-config:legacy_mode=true device-config:location=/var/Local_ISO content-type=iso

From The Command Above:
name-label=Local_ISO is the name of the SR
config:location=/var/Local_ISO is the folder where you will copying your ISO files and other files to be seen in other VMS. As you can see, Local_ISO Storage is added.
xcp_storage

 

 

  • Then make use of WinSCP or your favorite File Transfer Program to transfer to the file via SSH to the location you map it to, like mine: /var/Local_ISO and copy the ISO there, After that,
    Go To Local_ISO, Depending on the name you created and Storage, Rescan, I really hope you understand all the process.
  • And continue with installation of your VMs.

How To Remove A Local Storage Repository On Xen Server/XCP-NG

  • Find the UUID of the Local Storage with:
xe sr-list

xen

  • Then remove it with:
xe sr-forget uuid=3ac17a89-c9ds-er2o-de1s-123d1xcs432rh

Replace this with your UUID: 3ac17a89-c9ds-er2o-de1s-123d1xcs432rh

If you have any questions, Let me know.

 

Posted by Shehu Awwal

DevOps Engineer, Interests around Kubernetes, Infrastructure, Security & Automation.

Leave a Reply

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