Revision 97c60815

b/doc/design-ovf-support.rst
38 38
distribution (e.g. by allowing usage of public key infrastructure and
39 39
providing tools for management of basic software licensing).
40 40

  
41
There are no limitations regarding hard drive images used, as long as
42
the description is provided. Any hardware described in a proper
43
i.e. CIM - Common Information Model) format is accepted, although
44
there is no guarantee that every virtualization software will support
45
all types of hardware.
41
There are no limitations regarding disk images used, as long as the
42
description is provided. Any hardware described in a proper format
43
(i.e. CIM - Common Information Model) is accepted, although there is no
44
guarantee that every virtualization software will support all types of
45
hardware.
46 46

  
47
OVF package should contain one file with ``.ovf`` extension, which is an
48
XML file specifying the following (per virtual machine):
47
OVF package should contain exactly one file with ``.ovf`` extension,
48
which is an XML file specifying the following (per virtual machine):
49 49

  
50 50
- virtual disks
51 51
- network description
......
58 58
Additionally, the package may have some disk image files and other
59 59
additional resources (e.g. ISO images).
60 60

  
61
In order to provide secure means of distribution for OVF packages, the
62
manifest and certificate are provided. Manifest (``.mf`` file) contains
63
checksums for all the files in OVF package, whereas certificate
64
(``.cert`` file) contains X.509 certificate and a checksum of manifest
65
file. Both files are not compulsory, but certificate requires manifest
66
to be present.
67

  
61 68
Supported disk formats
62 69
----------------------
63 70

  
64 71
Although OVF is claimed to support 'any disk format', what we are
65
interested in is which of the formats are supported by VM managers
66
that currently use OVF.
72
interested in is which formats are supported by VM managers that
73
currently use OVF.
67 74

  
68 75
- VMWare: ``.vmdk`` (which comes in at least 3 different flavours:
69 76
  ``sparse``, ``compressed`` and ``streamOptimized``)
......
74 81
- Red Hat Enterprise Virtualization: ``.raw`` (raw disk format),
75 82
  ``.cow`` (qemu's ``QCOW2``)
76 83
- other: AbiCloud, OpenNode Cloud, SUSE Studio, Morfeo Claudia,
77
  OpenStack
84
  OpenStack: mostly ``.vmdk``
78 85

  
79
In our implementation of the OVF we plan to allow a choice between
80
raw, cow and vmdk disk formats for export. We will not limit the import
81
formats in any way, but the used format has to be supported by qemu-img.
86
In our implementation of the OVF we allow a choice between raw, cow and
87
vmdk disk formats for both import and export. Other formats covertable
88
using ``qemu-img`` are allowed, but not tested.
82 89
The justification is the following:
83 90

  
84 91
- Raw format is supported as it is the main format of disk images used
......
88 95
  has the advantage of producing relatively small disk images, which
89 96
  is extremely important advantage when moving instances.
90 97

  
91
The conversion between RAW and the other formats will be done using
92
qemu-img, which transforms, among other, raw disk images to monolithic
93
sparse vmdk images.
94

  
95 98
Import and export - the closer look
96 99
===================================
97 100

  
......
122 125
            <gnt:DiskTemplate</gnt:DiskTemplate>
123 126
            <gnt:OperatingSystem>
124 127
                <gnt:Name/>
125
                <gnt:Parameters>
126
                </gnt:Parameters>
128
                <gnt:Parameters></gnt:Parameters>
127 129
            </gnt:OperatingSystem>
128 130
            <gnt:Hypervisor>
129 131
                <gnt:Name/>
130
                <gnt:Parameters>
131
                </gnt:Parameters>
132
                <gnt:Parameters></gnt:Parameters>
132 133
            </gnt:Hypervisor>
133 134
            <gnt:Network>
134 135
            <gnt:Mode/>
......
151 152
  [instance]
152 153
      disk0_dump = filename     => File in References
153 154
      disk0_ivname = name       => generated automatically
154
      disk0_size = size_in_mb   => calculated after conversion to RAW
155
      disk0_size = size_in_mb   => calculated after disk conversion
155 156
      disk_count = number       => generated automatically
156 157
      disk_template = disk_type => gnt:DiskTemplate
157 158
      hypervisor = hyp-name     => gnt:Name in gnt:Hypervisor
......
195 196
If this happens you can specify all the missing parameters in
196 197
the command line. Please refer to `Command Line`_ section.
197 198

  
198
In the `user's manual <TODO: link to manual>`_ we provide examples of
199
In the :doc:`ovfconverter` we provide examples of
199 200
options when converting from VirtualBox, VMWare and OpenSuseStudio.
200 201

  
201 202
Export to other virtualization software
......
247 248
Disks
248 249
-----
249 250

  
250
As mentioned, Ganeti will allow exporting only ``raw``, ``cow`` and
251
``vmdk`` formats.  As for import, we will support all that
252
``qemu-img`` can convert to raw format. At this point this means
253
``raw``, ``cow``, ``qcow``, ``qcow2``, ``vmdk`` and ``cloop``.  We do
254
not plan for now to support ``vdi`` or ``vhd``.
251
As mentioned, Ganeti will allow export in  ``raw``, ``cow`` and ``vmdk``
252
formats.  This means i.e. that the appropriate ``ovf:format``
253
will be provided. It does not mean that other formats cannot be used,
254
rather that we did not test them.
255
As for import, we will support all formats that ``qemu-img`` can convert
256
to ``raw``. At this point this means ``raw``, ``cow``, ``qcow``,
257
``qcow2``, ``vmdk`` and ``cloop``.  We do not plan for now to support
258
``vdi`` or ``vhd`` unless they become part of qemu-img supported formats.
255 259

  
256
We plan to support compression both for import and export - in tar.gz
260
We plan to support compression both for import and export - in gzip
257 261
format. There is also a possibility to provide virtual disk in chunks
258 262
of equal size. The latter will not be implemented in the first version,
259 263
but we do plan to support it eventually.
260 264

  
261
The ``ovf:format`` tag is not used in our case. Instead we use
262
``qemu-img info``, which provides enough information for our purposes
263
and is better standardized.
265

  
266
The ``ovf:format`` tag is not used in our case when importing. Instead
267
we use ``qemu-img info``, which provides enough information for our
268
purposes and is better standardized.
264 269

  
265 270
Please note, that due to security reasons we require the disk image to
266 271
be in the same directory as the ``.ovf`` description file.
......
278 283
present, we perform a simple check - if network name specified in
279 284
``NetworkSection`` contains words ``bridged`` or ``routed``, we consider
280 285
this to be the network type. Otherwise option ``auto`` is chosen, in
281
which case the clusters' default value for that field will be used when
282
importing. This provides a safe fallback in case of NAT networks usage,
283
which are commonly used e.g. in VirtualBox.
286
which case the cluster's default value for that field will be used when
287
importing.
288
This provides a safe fallback in case of NAT networks usage, which are
289
commonly used e.g. in VirtualBox.
284 290

  
285 291
Hardware
286 292
--------
......
299 305
Other
300 306
-----
301 307

  
302
The instance name (``gnt:VirtualSystem\gnt:Name``) has to be resolvable
303
in order for successful import using ``gnt-backup import``.
308
The instance name (``gnt:VirtualSystem\gnt:Name`` or command line's
309
``--name`` option ) has to be resolvable in order for successful import
310
using ``gnt-backup import``.
311

  
304 312

  
305 313
_`Command Line`
306 314
===============
......
308 316
The basic usage of the ovf tool is one of the following::
309 317

  
310 318
    ovfconverter import filename
311
    ovfconverter export filename
319
    ovfconverter export --format=<format> filename
312 320

  
313 321
This will result in a conversion based solely on the content of provided
314 322
file. In case some information required to make the conversion is
......
339 347
Disks
340 348
^^^^^
341 349
``--disk-template=diskless`` causes the converter to ignore all other
342
disk option - both from .ovf file and the command line.
350
disk option - both from .ovf file and the command line. Other disk
351
template options include ``plain``, ``drdb``, ``file``, ``sharedfile``
352
and ``blockdev``.
343 353

  
344 354
``--disk=number:size=value`` causes to create disks instead of
345 355
converting them from OVF package; numbers should start with ``0`` and be
......
370 380
``--tags=tag1,tag2,tag3`` is a means of providing tags specific for the
371 381
instance.
372 382

  
383

  
373 384
After the conversion is completed, you may use ``gnt-backup import`` to
374 385
import the instance into Ganeti.
375 386

  
376 387
Example::
377 388

  
378
	ovfconverter file.ovf --disk-template=diskless \
379
                        --os-type=lenny-image \
380
                        --backend=vcpus=1,memory=512,auto_balance \
381
                        -H:xen-pvm \
382
                        --net=0:mode=bridged,link=xen-br0 \
383
                        --name=xen.i1 \
384
                        -v
385
	[output]
389
	ovfconverter import file.ovf --disk-template=diskless \
390
          --os-type=lenny-image \
391
          --backend=vcpus=1,memory=512,auto_balance \
392
          -H:xen-pvm \
393
          --net=0:mode=bridged,link=xen-br0 \
394
          --name=xen.i1
395
	[...]
386 396
	gnt-backup import xen.i1
387
	[output]
397
	[...]
388 398
	gnt-instance list
389 399

  
390 400
Export options
391 401
--------------
392 402
Export options include choice of disk formats to convert the disk image
393
(``--format``; default=``raw`` with no conversion) and compression of
394
the disk into tar.gz format (``--compress``).
395
User has also the choice of allowing to skip the Ganeti-specific part of
396
the OVF document (``--external``).
403
(``--format``) and compression of the disk into gzip format
404
(``--compress``). User has also the choice of allowing to skip the
405
Ganeti-specific part of the OVF document (``--external``).
397 406

  
398 407
By default, exported OVF package will not be contained in the OVA
399 408
package, but this may be changed by adding ``--ova`` option.
400 409

  
401
[TODO: examples of usage]
402

  
403 410
Please note that in order to create an OVF package, it is first
404 411
required that you export your VM using ``gnt-backup export``.
405 412

  
406
[TODO: complete example of export]
413
Example::
414

  
415
	gnt-backup export -n node1.xen xen.i1
416
	[...]
417
	ovfconverter export --format=vmdk --ova --external \
418
	  --output-dir=~/xen.i1 \
419
	  /srv/ganeti/export/xen.i1.node1.xen/config.ini
407 420

  
408 421
Implementation details
409 422
======================
......
412 425
---------------
413 426

  
414 427
Disk conversion for both import and export is done using external tool
415
called qemu-tools. The same tool is used to determine the type of disks.
428
called qemu-tools. The same tool is used to determine the type of disk,
429
as well as its virtual size.
416 430

  
417 431

  
418 432
Import
......
454 468

  
455 469
- save gathered information in ``config.ini`` file
456 470

  
457
ToDo
458
====
459

  
460
This lists functionalities for import that are not yet implemented, but
461
should be before the initial release:
462

  
463
- Support for compressed disks
464

  
465 471

  
466 472
.. vim: set textwidth=72 :
467 473
.. Local Variables:
b/doc/index.rst
29 29
   iallocator.rst
30 30
   rapi.rst
31 31
   move-instance.rst
32
   ovfconverter.rst
32 33
   devnotes.rst
33 34
   news.rst
34 35
   glossary.rst
b/doc/ovfconverter.rst
1
=============
2
OVF converter
3
=============
4

  
5
Using ``ovfconverter`` from the ``tools`` directory, one can easily
6
convert previously exported Ganeti instance into OVF package, supported
7
by VMWare, VirtualBox and some other virtualization software. It is
8
also possible to use instance exported from such a tool and convert it
9
to Ganeti config file, used by ``gnt-backup import`` command.
10

  
11
For the internal design of the converter and more detailed description,
12
including listing of available command line options, please refer to
13
:doc:`design-ovf-support`
14

  
15
As the amount of Ganeti-specific details, that need to be provided in
16
order to import an external instance, is rather large, we will present
17
here some examples of importing instances from different sources.
18
It is also worth noting that there are some limitations regarding
19
support for different hardware.
20

  
21
Limitations on import
22
=====================
23

  
24
Network
25
-------
26
Available modes for the network include ``bridged`` and ``routed``.
27
There is no ``NIC`` mode, which is typically used e.g. by VirtualBox.
28
For most usecases this should not be of any effect, since if
29
``NetworkSection`` contains any networks which are not discovered as
30
``bridged`` or ``routed``, the network mode is assigned automatically,
31
using Ganeti's cluster defaults.
32

  
33
Backend
34
-------
35
The only values that are taken into account regarding Virtual Hardware
36
(described in ``VirtualHardwareSection`` of the ``.ovf`` file) are:
37

  
38
- number of virtual CPUs
39
- RAM memory
40
- hard disks
41
- networks
42

  
43
Neither USB nor CD-ROM drive are used in Ganeti. We decided to simply
44
ignore unused elements of this section, so their presence won't raise
45
any warnings.
46

  
47

  
48
Operating System
49
----------------
50
List of operating systems available on a cluster is viewable using
51
``gnt-os list`` command. When importing from external source, providing
52
OS type in a command line (``--os-type=...``) is **required**. This is
53
because rven if the type is given in OVF description, it is not detailed
54
enough for Ganeti to know which os-specific scripts to use.
55

  
56

  
57
Import examples
58
===============
59

  
60
Ganeti's OVF
61
------------
62
If you are importing instance created using ``ovfconverter export`` --
63
you most probably will not have to provide any additional information.
64
In that case, the following is all you need (unless you wish to change
65
some configuration options)::
66

  
67
	ovfconverter import ganeti.ovf
68
	[...]
69
	gnt-instance import -n <node> <instance name>
70

  
71

  
72
Virtualbox, VMWare and other external sources
73
---------------------------------------------
74
In case of importing from external source, you will most likely have to
75
provide the following details:
76

  
77
- ``os-type`` can be any operating system listed on ``gnt-os list``
78
- ``name`` that has to be resolvable, as it will be used as instance
79
  name (even if your external instance has a name, it most probably is
80
  not resolvable to an IP address)
81

  
82
These are not the only options, but the recommended ones. For the
83
complete list of available options please refer to
84
`Command Line description <design-ovf-support.rst>`
85

  
86
Minimalistic but complete example of importing Virtualbox's OVF
87
instance may look like::
88

  
89
    ovfconverter virtualbox.ovf --os-type=lenny-image \
90
      --name=xen.test.i1 --disk-template=diskless
91
    [...]
92
    gnt-instance import -n node1.xen xen.test.i1
93

  
94

  
95
.. vim: set textwidth=72 :
96
.. Local Variables:
97
.. mode: rst
98
.. fill-column: 72
99
.. End:

Also available in: Unified diff