RapidCloning

= Rapid Cloning=

This proposal is tracked in blueprint rapid-cloning

Feature Summary
The feature aims at providing boot from volume capability in an automated fashion when enabled by a configuration flag in nova. It does not necessitate the user to prepare a bootable volume by copying the image manually into it and then specifying volume details while booting the instance. It is planned to take advantage of the volume cloning feature supported by cinder in two steps i.e. create snapshot and then create volume from snapshot. It will reduce the boot time of instances considerably in case of images of large size, hence giving a performance boost. Following section describes more detailed operations in sequence to be performed. It requires the Rapid Cloning config option to be turned on in nova.

Sequence of operations

 * User boots an instance specifying the image stored in glance.
 * Nova needs to maintain a table in database containing image to volume snapshot mapping. A new database table is proposed in nova to achieve it. Internally upon recieving the request nova checks if a mapping exists for the same image.
 * If mapping exists then it would do operations to facilitate creating volume from snapshot by calling appropriate cinder api and present it as a boot device for the instance.
 * If no mapping exists then it would facilitate for creating a new cinder volume and copying image into it by calling cinder api. It could be achieved by one cinder api or combination of multiple cinder apis. After creating the volume its snapshot will be taken before booting with it to maintain the image snapshot mapping in database. Its done to ignore any changes to copied image after instance boot up.
 * The instance boots up after all above operations are performed.
 * The first time call to boot with an image involves copying image from glance and then writing to volume, which is similar to normal boot from volume operation but with no performance benefit. But the second time onwards for the same image specified while booting, image need not be copied or downloaded from glance and a simple create volume from snapshot would present a new bootable volume. This achieves in saving a lot of operations and time which will be significant for large size images.
 * The feature will support raw disk image format. Supporting other format will require specifying appropriate io driver to the instance at the hypervisor and guest configuration.

Advantages

 * This feature will be storage vendor independent as it will make use of standard cinder apis.
 * It will save end users from the hassle of preparing bootable volumes manually and hence providing some level of automation.
 * It will be a performance enhancing feature in case of large sized images. Also saving CPU cycles of multiple operations in nova, glance and the middleware infrastructure.

Decisions to be made

 * Supported disk image formats. Support starting with RAW disk image format.
 * Hypervisors to be supported.