« Previous -
Version 20/39
(diff) -
Next » -
Current version
Nikos Skalkotos, 11/24/2011 04:29 pm
Image Format¶
The image format (img_format
) is a required OS Provider parameter and snf-image will complain if not foundRight now we support 4 different types of image formats:
extdump
ntfsdump
diskdump
custom
(unstable)
extdump & ntfsdump image formats¶
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.
Partitions hosting a Windows or Linux system that are suitable for dumping should have the following properties:- Be the first partition in the filesystem
- The OS they host should not depend on any other partitions
- Start at sector 2048
- Have a bootloader installed in the boot sector of the partition (not MBR)
- Have the root device in /etc/fstab specified in a persistent way, using UUID or LABEL (for extdump only)
Known Issues¶
- For linux systems, having grub installed in the partition is fragile and things can go wrong when resizing the partitions, especially when shrinking.
- Swap space is not supported.
- More complicated partition schemes are not supported.
diskdump image format¶
Diskdump is a newer format that overcomes most of the aforementioned issues. This format is a raw copy (dd) of a whole disk.
This design decision has the following benefits:- Swap partitions are supported
- The system may use multiple partitions:
- dedicated partitions for /boot, /home etc in linux
- system and boot partition in Windows
- There are no restrictions on starting sectors of partitions
- All devices in fstab should be specified by persistent names (UUID or LABEL)
- LVMs and extended partitions should be avoided.
- The support for extended partitions is partial. snf-image does not support resizing logical partitions.
- Logical volumes are not supported at all
- In Linux disks only ext{2,3,4} filesystems are supported
custom image format¶
For now, a custom image is a diskdump image whose img_id
OS Parameter (see Ganeti OS Interface) is a URL that points to the image file. Do not use this image format. It may change in the future
Image Properties¶
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 {ext,ntfs}dump formats all image properties are optional.
- Mandatory properties (
diskdump
only)- OSFAMILY={linux,windows}
This specifies whether the image is a Linux or a Windows Image. {ext,ntfs}dump formats are self descriptive regarding this property. - ROOT_PARTITION={1,2,3,4}
This specifies the partition number of the root partition. As mentioned earlier, for now, only primary partitions are supported. This property is trivial for {ext,ntfs}dump formats (they only host one partition).
- OSFAMILY={linux,windows}
- Optional properties
- USERS="username1 username2...."
This is a space-seperated list of users, whose password will be reset by snf-image. If this is missing then those users are chosen according to a set of rules, but please do not depend on this. Those rules may change or even be dropped in the future. Do directly specify theUSERS
list, just to be on the safe side.
The rules we currently use are listed below:- For Windows images, the
Administrator
's password is reset. - For Linux images, the root password is reset for all distribution. If
snf-image
detects the system as a Fedora or an Ubuntu Linux, then it also resets the password of the user with usernameuser
.
- For Windows images, the
- USERS="username1 username2...."
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.