XVM
First Draft
VMcasting Virtual Machine format
Table of Contents
XVM 1
First Draft 1
Xen Virtual Machine format 1
(Enomalism native efficient XEN image format) 1
Synopsis: 2
File format: 3
xvm.xml configuration file format: 4
Entities and nodes: 5
Library Functionality 6
TODO LIST: 6
Synopsis:
Due to the popularity of the hypervisor technology, combined with the Linux kernel, virtualization has become a popular method of deploying network services. Unfortunately, the field is still immature, and is missing several core tools that are required in order to easily deploy applications on virtual machines.
In combination with the VMcasting capably management tools such as Enomalism, we have designed a simple file format (based upon some very good work from other vendors) which provides the simplest possible file format for wrapping up and deploying virtual machines. This format can be easily created with standard gnu utilities, and is easy to understand and use. The format is supplied with sample Makefiles, and a standard Python library which should run on nothing more than the standard (as of 2.4 or higher) Python libraries. The format is designed to work on any POSIX compliant (except windows) platform.
The concept of VMcasting is based on the similar concept of Podcasting, the popular trend of audio content delivered via an RSS feed presenting a downloadable or streaming file (often an MP3). With VMcasting, a developer publishes an RSS 2.0 feed where each item describes a release of a particular Virtual Machine Image or Virtual Appliance. The items descriptions may contain release notes or other information about what's new in a particular release. Therefore developers can be easily upgrade or install using a virtual server management system such as Enomalism.
File format:
Each XVM file is a simple unix standard tarfile, containing the following items:
-
xvm.xml : The xml file describing the archive
-
manifest.txt : The contents of the archive with sha1 sums per file
-
mf-signature.asc : gpg signature for the manifest.txt file
-
signature.asc : gpg signature for the xvm.xml file
-
imagefile : hard disk partition image
-
imagefile2 : next disk partition image
-
... etc ... : more partition images (no limit)
The xvm.xml file format is described later in this document.
The manifest.txt file is a standard sha1sum file, generated with a command line as follows:
sha1sum xvm.xml image image ... image > manifest.txt
The files signed here consist of only the xvm.xml file, and then all of the partition image files. The signature files are not hashed at this point, and are never listed in the manifest.txt
The mf-signature.asc file is a standard gnupg signature file, create with a command line as follows:
gpg -sba -o mf-signature.asc manifest.txt
The public ket for the user signing the archive should be publicly available at wwwkeys.pgp.net so that users can easily check keys and ensure that they are still valid. Future versions of the file format should recognize revoked keys, and prevent installing.
The signature.asc file is identical to the mf-signature file, except that it signs the xvm.xml file instead.
gpg -sba -o signature.asc xvm.xml
The image files are duplicates of a working partition, created by “dd”ing the original disk partition over to a new file. The disk image files can be compressed using alternately the bzip2 or gzip format. File extensions of .bz2 or .gz should be added to designate these files are compressed.
xvm.xml configuration file format:
The xvm.xml file is designed to resemble as much as possible another (soon to be) open source file format. The differences are mostly in the much simpler layout and contents. This format contains no doctype, no multiple machines, and no method for performing modifications or queries against the running VM. This format is designed in order to provide the absolute minimum amount of data required to generate a virtual machine, and to do it very quickly, and easily. It is also designed to be human editable.
Below is a sample xvm.xml file.
<?xml version="1.0" ?>
<appliance>
<name xml:lang="en">
<label>Debian 3.1</label>
<shortdesc>Debian 3.1</shortdesc>
<longdesc>
Debian 3.1 minimal install optimized for XEN
</longdesc>
<detail>
Debian 3.1 minimal install optimized for XEN
</detail>
</name>
<version>1.0</version>
<vm name="debian 3.1">
<name xml:lang="en">
<label>debian 3.1</label>
<shortdesc>debian 3.1</shortdesc>
<longdesc>
debian 3.1
</longdesc>
<detail>
debian 3.1
</detail>
</name>
<memory static_min="128 MiB" />
<vbd name="sda1" vdi="sda1" mode="RW" />
</vm>
<vdi name="sda1" src="file:///sda1.img.gz" variety="system" compression='gzip'>
<name>
<label>debian 3.1 scsi disk 1</label>
</name>
</vdi>
</appliance>
Download xvm.xml
Entities and nodes:
The name node specifies the name and description of the entire VM archive. The label is a short name used when displaying a list of machines to provision. The shortdesc, longdesc , and detail fields provide a one line, paragraph, and extremely detailed description respectively. All three of these description fields are optional.
The version entity specifies the version of the VM image. when sorting, progressive machines should appear after the first machine when sorted numerically separated by the points. ie: only the following order is legal:
1.0
2.0
9.8.7.6.5.4.3.2
10.2
The vm node contains a single machine definition. There should be only one machine in the archive. The name attribute and label subnode should both match, and the shortdesc,longdesc,and detail fields should match the name node described previously (although the last three are again optional). The memory subnode should contain at the least the attribute static_min, which describes the minimum memory required for the machine to run correctly. The optional attribute static_max can also be entered, which describes the maximum memory the machine can make use of. The vbd nodes each represent a virtual machine partition image, and should have the attributes:
-
name: refers to the /dev/name (ie sda1) where the block device appears in the /dev fs.
- vdi: should match the name, and match the vdi for this partition (as below)
The vdi nodes detail a partition image, which links an archived tar file item to a specific partition image, and should contain the following attributes.
-
name: refers to the /dev/name (ie sda1) where the block device appears in the /dev fs.
- src: the file url which gives the path relative to the tarfile root where the image is kept.
- variety: ignored in this version.
- compression: the compression format used on the image file.
- size: optional, and used to estimate installed size.
All sizes will be either a number of bytes, or comply to the following shorthand:
B,BYTES 1
KIB 1024
K,KB 1000
MIB 1048576
M,MB 1000000
GIB 1073741824
G,GB 10e9
TIB 1099511627776
T,TB 10e12
PIB 1125899906842624
P,PB 10e15
Note that a space should appear between the number and it's multiplier suffix.
Library Functionality
Creating a working XEN configuration from an image file is very simple. Just follow the following procedure (in the python interpreter, starting from a folder where both the enomalism tools libraries are in the python path, and on a machine where there is a working xvm archive):
from XVMFile import *
foo=XVMFile('path/to/xvm/archive.xvm')
foo.create_xen_folder('/path/to/target/machine/instance')
This will generate a workable xen machine folder which contains a file named xen.cfg, which can be started using the xm create xen.cfg command.
RSS FEED
<?xml version="1.0" encoding="utf-8"?><rss version="2.0">
<channel>
<title>Enomalism VMCasting Test Feed</title>
<link>http://jamaica/files/test.rss</link>
<description>Enomalism VMCasting Test Feed</description>
<language>en-us</language>
<item>
<title>Debian 3.1 Base Image</title>
<link>http://www.vmcasting.org/</link>
<enclosure url="http://www.vmcasting.org/fileadmin/vmimages/debian_3.1.xvm" length="1" type="application/octet-stream"/>
<description>
<![CDATA[
Debian 3.1 Base Image with minimal components required for growing to a more complete solution.
]]>
</description>
<pubDate>Fri, 16 Feb 2007 14:43:18 -0800</pubDate>
</item>
</channel>
</rss>
- Download Sample VMcast XML Feed
- Download Sample XVM Package Format : (53 MB) debian_3.1, Xen DomU.
TODO LIST:
-
Test chunking of the vdi images. The code is there, but as of yet, untested.
- Support qcow images when creating vm directories
- Create machines in a given LVM volume. Code not written, but API supports it.
- Support command line options on the library so that it can be called as a script.

This work is licensed under a Creative Commons Attribution 2.5 License.

