xenapi: Use supported interfaces for image upload/download

Registered by Mate Lakat on 2013-07-30

Use supported interfaces for image upload / download to/from XenAPI compute nodes.
At the moment XenServer is using tarballs of vhd chains as images, and using a dom0 plugin to download/upload them.
This is a non-supported way, and using non-supported tools. This blueprint is about to come up with an image upload/download method through a supported interface.

Blueprint information

Status:
Complete
Approver:
Russell Bryant
Priority:
Low
Drafter:
Mate Lakat
Direction:
Approved
Assignee:
Mate Lakat
Definition:
Approved
Series goal:
Accepted for havana
Implementation:
Implemented
Milestone target:
milestone icon 2013.2
Started by
Russell Bryant on 2013-07-31
Completed by
Russell Bryant on 2013-09-05

Related branches

Sprints

Whiteboard

Can we be clear about the required steps to create an "supported" import mechanism? Glance is planning to do image conversion, so you could assume a raw image is available from glance, rather than doing the conversion on the DomU -- johngarbutt

The proposed solution is:

Glance images are raw disk image files inside a tar.gz. This is how we get sparse format, and "metadata" information. We are expecting only one raw disk image file per glance image.

Download - import an image to the hypervisor:
  - Look at the beginning of the image, and get hold of the size of the raw file
  - Create a VDI with a size retrieved in the previous step
  - Attach the VDI to domU, and unpack the raw disk image to the vdi
Upload - upload an image to glance:
  - Attach the VDI
  - On-line compress its contents and stream it to glance.

Gerrit topic: https://review.openstack.org/#q,topic:bp/xenapi-supported-image-import-export,n,z

Addressed by: https://review.openstack.org/40906
    xenapi: refactor - extract get_stream_funct_for

Addressed by: https://review.openstack.org/40907
    xenapi: refactor - extract get_virtual_size

Addressed by: https://review.openstack.org/40908
    xenapi: ovf - virtual size retrieved from stream

Addressed by: https://review.openstack.org/40909
    xenapi: ovf - decompress image stream

Addressed by: https://review.openstack.org/40708
    xenapi: test functions for _stream_disk

Image upload is implemented here:
    https://review.openstack.org/41651

All code submitted, waiting for review.

Addressed by: https://review.openstack.org/44034
    xenapi: refactor - extract image_utils

(?)

Work Items

Work items:
Implement image download: INPROGRESS
Implement image upload: INPROGRESS

This blueprint contains Public information 
Everyone can see this information.