Skip to content

Instantly share code, notes, and snippets.

@cmd-not-found
Created April 11, 2021 14:43
Show Gist options
  • Select an option

  • Save cmd-not-found/23517eb33b3f5b79d9ad2c9ee8d8ff47 to your computer and use it in GitHub Desktop.

Select an option

Save cmd-not-found/23517eb33b3f5b79d9ad2c9ee8d8ff47 to your computer and use it in GitHub Desktop.
XCP-ng add ISO and refresh ISO storage repository

Adding an ISO to XCP-ng Host Via Command-Line

REF: https://linuxconfig.org/how-to-refresh-xenserver-s-storage-repository-to-include-newly-added-items

Identify ISO Link

Copy link address from browser. wget ISO to local XCP-ng host. Below example is CentOS Stream 8 from a mirror.

REF: http://isoredirect.centos.org/centos/8-stream/isos/x86_64/

[10:19 oasis iso_images]# wget http://mirror.linux.duke.edu/pub/centos/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-20210406-boot.iso
--2021-04-11 10:19:48--  http://mirror.linux.duke.edu/pub/centos/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-20210406-boot.iso
Resolving mirror.linux.duke.edu (mirror.linux.duke.edu)... 152.3.102.14
Connecting to mirror.linux.duke.edu (mirror.linux.duke.edu)|152.3.102.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 758120448 (723M) [application/octet-stream]
Saving to: ‘CentOS-Stream-8-x86_64-20210406-boot.iso’

100%[======================================>] 758,120,448 27.9MB/s   in 29s    

2021-04-11 10:20:17 (25.1 MB/s) - ‘CentOS-Stream-8-x86_64-20210406-boot.iso’ saved [758120448/758120448]

If you run xe cd-list, the new ISO hasn't yet been recognized so we'll need to re-scan the storage repository (sr).

[10:25 oasis iso_images]# xe cd-list
uuid ( RO)          : fcadf37b-7fad-4db1-a0c2-b1449b3e76f1
    name-label ( RW): guest-tools.iso


uuid ( RO)          : fdf30c16-4bfe-4e97-83dc-80b7928f8a77
    name-label ( RW): ubuntu-18.04.5-live-server-amd64.iso


uuid ( RO)          : ab17ffe5-0049-4d55-bd93-33b54ef479b8
    name-label ( RW): ubuntu-20.04.2-live-server-amd64.iso

Re-Scan Storage Repository (SR)

First, get the UUID of the relevant ISO storage repository by using xe sr-list. We can filter on type=iso to limit the output.

[10:23 oasis iso_images]# xe sr-list type=iso
uuid ( RO)                : 190d3dff-5801-36aa-887f-3981912f9640
          name-label ( RW): XCP-ng Tools
    name-description ( RW): XCP-ng Tools ISOs
                host ( RO): oasis
                type ( RO): iso
        content-type ( RO): iso


uuid ( RO)                : 0593ee67-b5b0-0861-f20c-e2b1c8d2bc12
          name-label ( RW): ISO Images
    name-description ( RW): 
                host ( RO): oasis
                type ( RO): iso
        content-type ( RO): iso

Then, we'll use the xe sr-scan with the uuid required parameter to rescan and update the new ISO. xe cd-list displays the new results.

[10:32 oasis iso_images]# xe sr-scan uuid=0593ee67-b5b0-0861-f20c-e2b1c8d2bc12
[10:35 oasis iso_images]# xe cd-list
uuid ( RO)          : fcadf37b-7fad-4db1-a0c2-b1449b3e76f1
    name-label ( RW): guest-tools.iso


uuid ( RO)          : e5570fe5-ea6f-4f6c-848f-73300047e8f7
    name-label ( RW): CentOS-Stream-8-x86_64-20210406-boot.iso


uuid ( RO)          : fdf30c16-4bfe-4e97-83dc-80b7928f8a77
    name-label ( RW): ubuntu-18.04.5-live-server-amd64.iso


uuid ( RO)          : ab17ffe5-0049-4d55-bd93-33b54ef479b8
    name-label ( RW): ubuntu-20.04.2-live-server-amd64.iso


[10:35 oasis iso_images]# 

Now, the new ISO will display in the Xen Orchestra UI as a bootable mount for installing a new Virtual Machine with this operating system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment