Image Format

Version 10 (Nikos Skalkotos, 11/24/2011 02:40 pm)

1 1 Nikos Skalkotos
h1. Image Format
2 1 Nikos Skalkotos
3 9 Constantinos Venetsanopoulos
The image format (@img_format@) is a required OS Provider parameter and snf-image will complain if not found
4 8 Constantinos Venetsanopoulos
Right now we support 3 different types of image formats:
5 8 Constantinos Venetsanopoulos
* @extdump@
6 8 Constantinos Venetsanopoulos
* @ntfsdump@
7 8 Constantinos Venetsanopoulos
* @diskdump@
8 1 Nikos Skalkotos
9 4 Nikos Skalkotos
h2. extdump & ntfsdump
10 4 Nikos Skalkotos
11 4 Nikos Skalkotos
Those two formats are raw copies (using dd) of partitions hosting Linux systems on ext{2,3,4} and Windows systems on ntfs filesystems respectively.
12 4 Nikos Skalkotos
13 5 Nikos Skalkotos
Partitions hosting a Windows or Linux system that are suitable for dumping should have the following properties:
14 1 Nikos Skalkotos
* Be the first partition in the filesystem
15 5 Nikos Skalkotos
* The OS they host should not depend on any other partitions
16 1 Nikos Skalkotos
* Start at sector 2048
17 1 Nikos Skalkotos
* Have a bootloader installed in the partition
18 5 Nikos Skalkotos
* Have the root device in /etc/fstab specified in a persistent way, using UUID or LABEL (for extdump only)
19 3 Nikos Skalkotos
20 4 Nikos Skalkotos
h3. Known Issues
21 1 Nikos Skalkotos
22 1 Nikos Skalkotos
* For linux systems, having grub installed in the partition is fragile and things can go wrong when resizing the partitions, especially when shrinking.
23 3 Nikos Skalkotos
* Swap space is not supported.
24 3 Nikos Skalkotos
* More complicated partition schemes are not supported.
25 3 Nikos Skalkotos
26 1 Nikos Skalkotos
h2. diskdump
27 1 Nikos Skalkotos
28 7 Nikos Skalkotos
Diskdump is a newer format that overcomes most of the aforementioned issues. This format is a raw copy (dd) of a whole disk.
29 1 Nikos Skalkotos
30 7 Nikos Skalkotos
This design decision has the following benefits:
31 5 Nikos Skalkotos
* Swap partitions are supported
32 5 Nikos Skalkotos
* The system may use multiple partitions:
33 5 Nikos Skalkotos
** dedicated partitions for /boot, /home etc in linux
34 5 Nikos Skalkotos
** system and boot partition in Windows
35 7 Nikos Skalkotos
* There are no restrictions on starting sectors of partitions
36 5 Nikos Skalkotos
37 8 Constantinos Venetsanopoulos
Although diskdump is a lot more flexible than the older formats, there are still some rules to follow:
38 5 Nikos Skalkotos
* All devices in fstab should be specified by persistent names (UUID or LABEL)
39 6 Nikos Skalkotos
* LVMs and extended partitions should be avoided.
40 6 Nikos Skalkotos
** The support for extended partitions is partial. snf-image does not support resizing logical partitions.
41 6 Nikos Skalkotos
** Logical volumes are not supported at all
42 6 Nikos Skalkotos
* In Linux disks only ext{2,3,4} filesystems are supported
43 6 Nikos Skalkotos
44 6 Nikos Skalkotos
h3. Image Properties
45 6 Nikos Skalkotos
46 10 Nikos Skalkotos
In order for snf-image to be able to properly configure an image, it may make use of a set of image properties. Those image properties are passed to snf-image by Ganeti through the @img_poroperties@ OS parameter. For the @diskdump@ format some properties are *mandatory*. For older formats ({ext,ntfs}dump) all image properties are optional.
47 1 Nikos Skalkotos
48 10 Nikos Skalkotos
A list of mandatory and optional properties follows:
49 10 Nikos Skalkotos
* Mandatory properties (for @diskdump@ only)
50 10 Nikos Skalkotos
** *OSFAMILY={linux,windows}*
51 10 Nikos Skalkotos
This specifies whether the image is a Linux or a Windows Image. {ext,ntfs}dump formats are self descriptive regarding this property.
52 10 Nikos Skalkotos
** *ROOT_PARTITION={1,2,3,4}*
53 10 Nikos Skalkotos
This specifies the partition number of the root partition. As mentioned earlier, for now we only support primary partitions. For {ext,ntfs}dump formats this property is trivial (they host only one partition).
54 10 Nikos Skalkotos
* Optional properties
55 10 Nikos Skalkotos
** *USERS="username1 username2...."*
56 8 Constantinos Venetsanopoulos
This is a list of users, whose password will be reset by snf-image.
57 8 Constantinos Venetsanopoulos
58 8 Constantinos Venetsanopoulos
All image properties are passed to snf-image through the @img_properties@ OS parameter. The @img_properties@ parameter is *mandatory* when trying to deploy an image of @diskdump@ format. @img_properties@ should be a json file dumped as a string. When trying to deploy an image of type @{ext,ntfs}dump@ then @img_properties@ are not necessary.