« Previous | Next » 

Revision 5d805533

ID5d80553360b232a31cf89fa560f73849cd3ea42c

Added by Christos Stavrakakis over 9 years ago

cyclades: Create servers with volumes

Extend Cyclades POST /servers API endpoint to support specifying volumes
when creating a server. The call is extended with the
'block_device_mapping_v2' field that contains a list of dictionaries,
each of which contains the following information about the devices that
the server must have:

  • source_type: One of'image', 'snapshot', 'volume' or 'blank'
  • uuid: The UUID of the object that is specified by source_type (if
    source_type is not blank)
  • size: The size of the volume
  • delete_on_termination: Whether the volumes will be preserved or
    automaticaly deleted when the server is deleted

If no volume is specified, then a volume is automatically created with
the size of the flavor and with source the image that is specified in
the 'imageRef' field of the API call.

The follow restrictions apply:
  • Source_type can be other than 'blank', only if the disk template is
    ext_ or if the volume is created as that root volume of a server, so
    that it will filled with data by snf-image.
  • The root volume cannot be blank.
  • In order to use a volume, it must be in AVAILABLE status. This will
    never happend until detachable volumes. However the user can "clone"
    a user volume either by creating a new volume from cinder and then
    using this new volume or by taking a snapshot and then use the
    snapshot as a source.
  • The size field is required if the source is image, snapshot or blank.
    Also, the size of the volume must be equal or bigger from the source
    size (if any)

Finally move some code from 'servers' module to 'server_attachments' and
'commands' to avoid cyclic imports.

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences