salt.modules.nova

Module for handling openstack nova calls.

depends:
  • novaclient Python module
configuration:

This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:

keystone.user: admin
keystone.password: verybadpass
keystone.tenant: admin
keystone.auth_url: 'http://127.0.0.1:5000/v2.0/'
salt.modules.nova.flavor_create(name, id=0, ram=0, disk=0, vcpus=1)

Add a flavor to nova (nova flavor-create). The following parameters are required:

<name> Name of the new flavor (must be first) <id> Unique integer ID for the new flavor <ram> Memory size in MB <disk> Disk size in GB <vcpus> Number of vcpus

CLI Example:

salt '*' nova.flavor_create myflavor id=6 ram=4096 disk=10 vcpus=1
salt.modules.nova.flavor_delete(id)

Delete a flavor from nova by id (nova flavor-delete)

CLI Example:

salt '*' nova.flavor_delete 7'
salt.modules.nova.flavor_list()

Return a list of available flavors (nova flavor-list)

CLI Example:

salt '*' nova.flavor_list
salt.modules.nova.image_list(name=None)

Return a list of available images (nova images-list + nova image-show) If a name is provided, only that image will be displayed.

CLI Examples:

salt '*' nova.image_list
salt '*' nova.image_list myimage
salt.modules.nova.image_meta_delete(id=None, name=None, keys=None)

Delete a key=value pair from the metadata for an image (nova image-meta set)

CLI Examples:

salt '*' nova.image_meta_delete id=6f52b2ff-0b31-4d84-8fd1-af45b84824f6 keys=cheese
salt '*' nova.image_meta_delete name=myimage keys=salad,beans
salt.modules.nova.image_meta_set(id=None, name=None, **kwargs)

Sets a key=value pair in the metadata for an image (nova image-meta set)

CLI Examples:

salt '*' nova.image_meta_set id=6f52b2ff-0b31-4d84-8fd1-af45b84824f6 cheese=gruyere
salt '*' nova.image_meta_set name=myimage salad=pasta beans=baked
salt.modules.nova.keypair_add(name, pubfile=None, pubkey=None)

Add a keypair to nova (nova keypair-add)

CLI Examples:

salt '*' nova.keypair_add mykey pubfile='/home/myuser/.ssh/id_rsa.pub'
salt '*' nova.keypair_add mykey pubkey='ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuGj4A7HcPLPl/etc== myuser@mybox'
salt.modules.nova.keypair_delete(name)

Add a keypair to nova (nova keypair-delete)

CLI Example:

salt '*' nova.keypair_delete mykey'
salt.modules.nova.keypair_list()

Return a list of available keypairs (nova keypair-list)

CLI Example:

salt '*' nova.keypair_list
salt.modules.nova.list()

To maintain the feel of the nova command line, this function simply calls the server_list function.

salt.modules.nova.secgroup_create(name, description)

Add a secgroup to nova (nova secgroup-create)

CLI Example:

salt '*' nova.secgroup_create mygroup 'This is my security group'
salt.modules.nova.secgroup_delete(name)

Delete a secgroup to nova (nova secgroup-delete)

CLI Example:

salt '*' nova.secgroup_delete mygroup
salt.modules.nova.secgroup_list()

Return a list of available security groups (nova items-list)

CLI Example:

salt '*' nova.secgroup_list
salt.modules.nova.server_list()

Return detailed information for an active server

CLI Example:

salt '*' nova.show
salt.modules.nova.server_show(server_id)

Return detailed information for an active server

CLI Example:

salt '*' nova.show
salt.modules.nova.show(server_id)

To maintain the feel of the nova command line, this function simply calls the server_show function.

Previous topic

salt.modules.nginx

Next topic

salt.modules.npm