[et-mgmt-tools] VM images

David Lutterkort dlutter at redhat.com
Fri Jun 8 23:22:10 UTC 2007


Hi,

I wrote some patches against virt-install that make it possible to run
virtual machines from VM images (aka appliances)

Patches and additional docs are at
http://people.redhat.com/dlutter/virt-image/

I'd appreciate comments/suggestions, both on the XML metadata format
used to describe images and on the actual patches.

David

The README from the above URL:

VM Image Support for virt-install
=================================

This set of patches adds support for creating image-based virtual machines
to virt-install. Image-based virtual machines make it possible to
distribute VM images and allow users of such images to create VM's safely
and with minimal understanding of the image.

A VM image consists of an XML metadata file 'image.xml' and the disk images
that back the VM's storage. The metadata format is described in detail in
the file image.rng

Some important points:

* The metadata format allows specifying alternative ways of booting the VM,
  depending on the host platform. The code tries to find a matching boot
  descriptor using libvirt's capabilities; that matching code probably
  needs some love

* Disk images can either be raw disk images or ISO images

* Files referenced in the metadata (disk files, kernel, initrd etc.) are
  relative to the location of the metadata file. As a convention, they
  should be in the same directory as the metadata file.

Trying it out
-------------

To try out these patches you need to (a) apply the patches to virtinst and
(b) create a metadata file for an existing VM image. 

To apply the patches:

(1) Checkout virt-inst from mercurial:
    hg clone http://hg.et.redhat.com/virt/applications/virtinst--devel virt-install

(2) Put the patches into that directory:
    cd virt-install
    rsync -av http://people.redhat.com/virt-image/patches .

(3) Apply them with quilt:
    quilt push -a

(4) Run virt-image:
    chmod a+x ./virt-image
    ./virt-image --help

The easiest way to create a VM image is to use your favorite existing VM
with file-backed disks, and write an image.xml description file. Once you
have that, you can look at the libvirt XML that would be used to start the
VM with

    virt-image --image image.xml --print -name test --vnc

and start it with

    virt-image --image image.xml -name test --vnc




More information about the et-mgmt-tools mailing list