Add prototype vhd-format VDI.{import,export} #1832

Merged
merged 14 commits into from Jul 23, 2014

Conversation

Projects
None yet
1 participant
@johnelse
Collaborator

johnelse commented Jul 16, 2014

We add 'xe vdi-export' to the existing 'xe vdi-import' (still using HTTP GET and PUT underneath). We support format=raw as well as format=vhd. We support import and export of delta disks. For good measure we include a nice progress bar for the CLI.

The actual .vhd processing is offloaded to the vhd-tool utility.

Backported from #1782

David Scott and others added some commits Nov 21, 2013

Add 'xe vdi-export' for symmetry with 'xe vdi-import'
  xe vdi-export uuid=<VDI> filename=<filename>

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit c1f8bf5)
{import,export}_raw_vdi: update Task.progress
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit b89c237)
xe vdi-{export,import}: display a progress bar if "--progress" is given
Note we now send 'PrintStderr' commands to the CLI while it is busy
downloading or uploading disk images. A multithreaded CLI is necessary
for this to work.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 752287c)
VDI.export: allow the user to specify a format; currently either 'raw…
…' or 'vhd'

The HTTP handler accepts an additional argument:

  GET /export_raw_vdi?vdi=<vdi>&format=<raw|vhd>...

The content-disposition HTTP header is used to suggest a useful filename, and
the content-type HTTP header is set to either application/octet-stream or
application/vhd.

The CLI accepts an optional argument:

  xe vdi-export uuid=<uuid> filename=<filename> [format=(raw|vhd)]

.vhd format export will require a newer vhd-tool (>= 0.6.5)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 59fa5ee)
import_raw_vdi: normalise whitespace
$ camlp4o -printer o -no_comments ocaml/xapi/import_raw_vdi.ml | md5sum
e74faa7367f4c06d818a04fd87dfeeb5
$ git checkout HEAD^
$ camlp4o -printer o -no_comments ocaml/xapi/import_raw_vdi.ml | md5sum
e74faa7367f4c06d818a04fd87dfeeb5

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 6c16a13)

Conflicts:
	ocaml/xapi/import_raw_vdi.ml
import_raw_vdi: support importing vhd-format data
This requires vhd-tool >= 0.6.6

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 99abc50)

Conflicts:
	ocaml/xapi/import_raw_vdi.ml
xe vdi-import: add support for [type=(raw|vhd)]
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit be7acec)
VDI.export: add /dev/mapper to the vhd parent search path
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 7f60bff)
VDI.export: add a 'base' argument to export only VDI differences
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 62590b8)
{import,export}_raw_vdi use vhd-tool via vhd_tool_wrapper
This allows both functions to use O_DIRECT.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
(cherry picked from commit 7de0ede)

Conflicts:
	ocaml/xapi/OMakefile
	ocaml/xapi/import_raw_vdi.ml
Use Uuid instead of Uuidm
Signed-off-by: John Else <john.else@citrix.com>
Remove Re_str
Signed-off-by: John Else <john.else@citrix.com>
Fix xenstore
Signed-off-by: John Else <john.else@citrix.com>

johnelse added a commit that referenced this pull request Jul 23, 2014

Merge pull request #1832 from johnelse/vdi-export-xs64bit
Add prototype vhd-format VDI.{import,export}

@johnelse johnelse merged commit d2711d8 into xapi-project:xs64bit-ring3 Jul 23, 2014

1 check failed

default Merged build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment