Jump to: navigation, search


Revision as of 11:07, 29 May 2013 by Phil Day (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Currently all image size checks are made against the root disk size in the flavor, which is then treated as the absolute size of the root disk to create, overriding the min_disk value of the image and the image size itself. However when working with a range of images (for example a mix of Windows and Linux) it would be better to be able to use a single set of flavours whilst still honouring the min_disk value of the image. This would allow, for example, more efficient snapshots for images that do not need the full size of root_gb.

There are in effect two sets of values here that we want to bring clarity to:

The Image Creator can set:

  • min_disk in image metadata to be the size root disk of the resulting instance. Can be set to 0 if they want to use the maximum size supported by the cloud provider
  • image_size (in the way the image is created). If min_disk=0 this determines the size of the root disk, otherwise it must be less than min_disk

The Cloud Provider can set (via flavours)

  • root_gb: The maximum size for a root disk (or 0 if they don’t care). This provides an upper bound to the size of a root disk and protects against snapshot sizes and images which re larger that the declared min_disk
  • ephemeral_gb: How much additional disc space will allocate to the instance

The resulting logic will be:

  • Total instance storage is always limited to be root_gb + ephemeral_gb
  • In the API the min_disk is not 0 it is checked to be <= root_gb, or if root_gb is 0 then it is checked to be <=ephemeral_gb (i.e must fit into the storage defined by the flavor, and must fit into root_gb if specified)
  • The size of the root disk for the instance (instance['root_gb']) is then set to be:
min_disk=0 min_disk ≠ 0
root_gb = 0 0* min_disk
root_gb ≠0 root_gb min_disk
\* image_size can only be determined on the compute host, so in this case instance.root_gb will be set to 0 at the API layer. The resulting root disc size will be determined by the image size.
  • The size of the ephemeral disk for the instance (instance['ephemeral_gb']) is created to be (flavor.root_gb + flavor.ephemeral_gb) – instance.root_gb
  • In the compute manager, the size of the downloaded image is checked to be <= size of instance.root_gb, or <= ephemeral_gb if root_gb = 0

In this way root_gb and ephemeral_gb together define the amount of disk to be allocated to an instance, but images do not have to expand to full size of root_gb of the instance_type. Equally the cloud provide can define an upper bound on size of a root disc.