Can’t boot ISO as HVM in Apache CloudStack

Recently while trying to boot from an ISO in Apache CloudStack I received the error “Unable to start instance ‘hostname’ (UUID), see management server log for details”. The ISO media did not support installation as a PV guest in XenServer 6.2, it needed to be installed in PVHVM mode which required the following work around in order to boot correctly.

As the original error suggested I had a look at the management server logs and found the below error.

2015-04-24 20:53:02,143 WARN  [c.c.h.x.r.CitrixResourceBase] (DirectAgent-123:ctx-ba34b259) (logid:c106bd42) Unable to start VM(i-1-50-VM) on host(67bf3786-d8aa-569e-bcbf-123bc567b67b) due to Task failed! Task record:                 uuid: 38b2cbee-4c03-9389-403f-806ad63459ed
           nameLabel: Async.VM.start_on
     nameDescription: 
   allowedOperations: []
   currentOperations: {}
             created: Fri Apr 24 20:53:10 AEST 2015
            finished: Fri Apr 24 20:53:12 AEST 2015
              status: failure
          residentOn: com.xensource.xenapi.Host@3cb0f1c8
            progress: 1.0
                type: 
              result: 
           errorInfo: [BOOTLOADER_FAILED, OpaqueRef:ed846391-76ea-429d-ed38-37a7552528f8, INVALID_SOURCE
Unable to access a required file in the specified repository: file:///tmp/cdrom-repo-P8F-B1/install/vmlinuz.

The particular ISO that I was attempting to boot was based on SLES 12, to try and rule out CloudStack as the problem I created a virtual machine directly through Citrix XenCenter onto XenServer 6.2 and booted from the same ISO. When trying to power it on, the below error was displayed.

Starting VM 'hostname'
The bootloader for this VM returned an error -- did the VM installation succeed? INVALID_SOURCE
Unable to access a required file in the specified repository: file:///tmp/cdrom-repo-FMlQEz/install/vmlinuz.

This happened because I had selected the OS type when creating the VM to one that closely matched the install media, when instead creating it and selecting “Other install media” it booted correctly. To get the VM to boot with the OS type selected you can perform these modifications through XenServer if required.

Once the virtual machine is correctly booting, install the operating system from the ISO and configure it as required. Once complete power off the virtual machine.

Next we need to copy the VHD file of this virtual machine and put it on a web server. Apache CloudStack currently allows us to create templates from .VHD files served over HTTP/HTTPS.

To get the UUID of the virtual machine run the below command in XenServer.

xe vm-disk-list name-label=[VM-NAME]

Disk 0 will be the primary disk, get the VDI UUID and then run the below command.

xe vdi-list uuid=[VDI-UUID]

This will show the sr-uuid of the storage repository, if the storage repository is ext3 or NFS based the mount point will be /var/run/sr-mount/[SR-UUID]. The VHD file for the virtual machine can be found at /var/run/sr-mount/[SR-UUID]/[VDI-UUID].vhd

Copy this file and place it on a web server, it needs to be accessible to CloudStack over HTTP/HTTPS for download.

Through CloudStack under Templates, select the Register template button. Provide the URL to the VHD file, and ensure that OS type is set to something appropriate such as Other Linux. The HVM option must also be ticked, this is important.

Register template in Apache CloudStack

Once the template finishes downloading and installing, you should be able to create a new instance through CloudStack which will boot the OS that you installed directly in XenServer from the ISO that would not otherwise boot directly through CloudStack.

Conclusion

I have had some success with the ISO being added to CloudStack as “Other Linux” however there were a few instances where this did not boot correctly and the above process had to be followed in order to get a running virtual machine from the ISO media.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>