OUR IT BENCHMARK Questions? Call us now on: 01223 911191 Riverlite Managed IT Services Blog XenServer - Creating a local ISO Library by Simon Barnes on 04/01/12 22:40 Tweet Tweet LinkedIn Like 5 This week I had a fresh challenge, create a small demo environment utilising a single XenServer host, however the host was prohibited from communicating with any LAN based devices, so installation media for VMs was going to be a challenge! I decided that using a local ISO library would be the best bet. Unfortunately, XenCentre doesn't give the option to do this, so the CLI was the only option. Step 1 - Creating the ISO Library Folder Connect to the XenServer using SSH and then issue the following command: "mkdir -p /var/opt/xen/iso_store"
Step 2 - Create a ISO Storage Repository Issue the following command within an SSH session: "xe sr-create name-label=localiso type=iso devicecon g:location=/var/opt/xen/iso_store devicecon g:legacy_mode=true content-type=iso" XenCenter will then update and show the new SR: Now that we have an SR we just need to place the ISO les in the directory and installation can then begin, however trying to nd direct links to media download is not always as straight forward as you may think. I needed a copy of 2008 R2 evaluation edition, so I followed Microsoft's many steps in order to get the media, only to be advised that it was going to force me to use the download manager. Once the download manager started the download I could see the source location, but the link was far too long to copy and then re-write. So instead I paused the download and noticed that when I clicked the resume shortcut that was now on my desktop I was taken to the following URL: GRMSXEVAL_EN_DVD.iso?lcid=1033&cprod=WinSvr2 This link is the actual path that the 2008 R2 Eval ISO is available from! So all we had to was now download the ISO using the command line on the XenServer: Step 3 - Change directory
Change to the ISO storage directory: "cd /var/opt/xen/iso_store" Step 4 - Use wget to download the le "wget GRMSXEVAL_EN_DVD.iso?lcid=1033&cprod=WinSvr2" You will see output similar to the below: Unfortunately Domain 0 only has 4GB of storage allocated by default, this ISO as demonstrated above is 2.9G and will fail during the download process due to lack of space. A smaller ISO (XP etc) would be ne, but not Win7 or 2008 R2 eval editions. Using the command "df -h" we can see the current disk usage: Part 2 - Creating a larger ISO library When running the df -h command you will see the GPT partition that is listed as my local storage in XenCenter
(/var/run/sr-mount etc). This has plenty of capactiy and will be perfect for my ISO requirement. So we now create a new ISO directory (note that the GUID after /sr-mount will be di erent for each installation): "cd /var/run/sr-mount/1b042bc0-16b3-fa45-f94d- 7a6e4e3dafbe/" then: "mkdir -p ISO_Storage" We now have an ISO_Storage folder that can be used to store ISO les and not have to worry about consuming all of Domain 0's space. Now that the directory is there we can change directory to it: 7a6e4e3dafbe/ISO_Storage" Then re-issue the wget command from earlier - "cd /var/run/sr-mount/1b042bc0-16b3-fa45-f94d- "wget GRMSXEVAL_EN_DVD.iso?lcid=1033&cprod=WinSvr2" One thing to note is that this particular ISO will not have a.iso extension once downloaded it will be.iso?lcid=1033, thankfully this is easily recti ed by renaming the le: "mv 7601.17514.101119- GRMSXEVAL_EN_DVD.iso?lcid=1033 7601.17514.101119- GRMSXEVAL_EN_DVD.iso" Finally we add the new ISO_Storage folder as an ISO library:
"xe sr-create name-label=iso_storage type=iso devicecon g:location=/var/run/sr-mount/1b042bc0-16b3-fa45- f94d-7a6e4e3dafbe/iso_storage devicecon g:legacy_mode=true content-type=iso" XenCenter will then display our newly created ISO library with any available.iso les: Topics: Blog Subscribe to Email Updates Email* SUBSCRIBE Subscribe to RSS feeds