VHD to OpenStack using a XAPI host plugin

The goal was to use an existing OpenStack XAPI plugin to upload a VHD to OpenStack. For this demo, I was using two XenServers, one controlled by OpenStack, and the other holding a stopped instance. See the introduction on YouTube: Part 1 – Intro

Create a Glance Image
First, an image needs to be created on glance. Log in to the devstack box, and issue:

cd devstack
. openrc admin
glance image-create --name importedimage

The result is a table showing you the details of the created image. The id of the created image will be used later, to upload the real content. Follow this step on YouTube: Part 2 – Create Glance Image

Install OpenStack plugins on your XenServer
Follow this step on YouTube: Part 3 – Prepare for Plugin Installation
Installing openstack plugins to your XAPI box could be easily done manually, however, we have a small python script for doing that.

Next step is to determine the VHD’s uuid on our XenServer
It could be done manually, however we have a script, that is using XAPI to retrieve this information. To use that script, install that python package as well (Follow this step on YouTube: Part 5 – Install OpenStack-XAPI helper):