salt.modules.glance

Module for handling openstack glance calls.

optdepends:
  • glanceclient Python adapter
configuration:

This module is not usable until the following are specified either in a pillar or in the minion's config file:

glance.user: admin
glance.password: verybadpass
glance.tenant: admin
glance.insecure: False   #(optional)
glance.auth_url: 'http://127.0.0.1:5000/v2.0/'

If configuration for multiple openstack accounts is required, they can be set up as different configuration profiles: For example:

openstack1:
  glance.user: admin
  glance.password: verybadpass
  glance.tenant: admin
  glance.auth_url: 'http://127.0.0.1:5000/v2.0/'

openstack2:
  glance.user: admin
  glance.password: verybadpass
  glance.tenant: admin
  glance.auth_url: 'http://127.0.0.2:5000/v2.0/'

With this configuration in place, any of the keystone functions can make use of a configuration profile by declaring it explicitly. For example:

salt '*' glance.image_list profile=openstack1
salt.modules.glance.image_create(name, location, profile=None, visibility='public', container_format='bare', disk_format='raw')

Create an image (glance image-create)

CLI Example:

salt '*' glance.image_create name=f16-jeos visibility=public \
         disk_format=qcow2 container_format=ovf \
         copy_from=http://berrange.fedorapeople.org/                    images/2012-02-29/f16-x86_64-openstack-sda.qcow2

For all possible values, run glance help image-create on the minion.

salt.modules.glance.image_delete(id=None, name=None, profile=None)

Delete an image (glance image-delete)

CLI Examples:

salt '*' glance.image_delete c2eb2eb0-53e1-4a80-b990-8ec887eae7df
salt '*' glance.image_delete id=c2eb2eb0-53e1-4a80-b990-8ec887eae7df
salt '*' glance.image_delete name=f16-jeos
salt.modules.glance.image_list(id=None, profile=None)

Return a list of available images (glance image-list)

CLI Example:

salt '*' glance.image_list
salt.modules.glance.image_schema(profile=None)

Returns names and descriptions of the schema "image"'s properties for this profile's instance of glance

CLI Example:

salt '*' glance.image_schema
salt.modules.glance.image_show(id=None, name=None, profile=None)

Return details about a specific image (glance image-show)

CLI Example:

salt '*' glance.image_show
salt.modules.glance.schema_get(name, profile=None)
Known valid names of schemas are:
  • image
  • images
  • member
  • members

CLI Example:

salt '*' glance.schema_get name=f16-jeos