An Xandr instance image is a gzipped tarball containing the whole filesystem of a Linux host. These instructions will help you create an image from an external instance. To create an image of an offline Xandr instance, please use the "
manage-instance bundle" command.
Prerequisites for Creating an Image
/etc/fstab satisfies the partitioning scheme and contains the following:
2. Kernels and Modules
You must select a Xen compatible kernel to use. Here is a link to supported kernels: http://wiki.xen.org/wiki/DomU_Support_for_Xen There may be other restrictions as well. For instance, Ubuntu requires selecting the EC2 kernel and bootloader in order to function properly.
The imaged operating system must be configured to use a single network interface with DHCP enabled. Additionally, since MAC addresses vary between different instances, network configuration files must contain no old MAC addresses (
/etc/sysconfig/network-scripts/ifcfg-eth0 for RedHat based distros).
Moreover, some services may produce problems, if they detect that a MAC address has changed. For example the "
kudzu" service should be disabled by running the following script for RedHat based distros:
For Debian based distros, "
udev" service has the same caveat. Run the following script before imaging:
4. Avoid File Modification While an Creating Image
Stop all services that may make important changes to any files during the reading of filesystem while imaging (like
ftp servers, …). Alternate ways to do this are: reboot to single-user mode (pass "
-s" kernel parameter via bootloader), or boot from Live CD and mount a Linux partition to the image.
Creating the Image
First, select the partition in which to store the image; it must have enough free space to keep the tarred image before gzipping and the final gzipped tarball (about 120% of total disk space used by the operating system before imaging).
/ and run
The directories list must exclude dirs that contain special files and pseudo-filesystems. For CentOS, the
/tmp dirs should be excluded. Exclude
/mnt if you have any data mounted there and don't want them to go to the image.
The next step is to add excluded directories without files in them:
The last operation is compressing the image:
For CentOS and
/mnt partition as destination, commands are as follows:
As a result, you'll get a file named
.gz is added by gzip by default). Now, the image can be uploaded to storage. Note that the image extension doesn't matter, but we recommend changing it to
.fs.tgz (meaning: "gzipped tarball of a filesystem").
Uploading to Xandr Storage
Private shared storage accessible from all your instances has been created for you with a name like
custXXX, where XXX is a number of your share.
If you don't have this share mounted on your management instance:
Replace XXX with the share number, set the proper username, and type share_password when prompted.
Click here for directions on starting an instance from a custom image.