salt.cloud.clouds.nova

OpenStack Nova Cloud Module

PLEASE NOTE: This module is currently in early development, and considered to be experimental and unstable. It is not recommended for production use. Unless you are actively developing code in this module, you should use the OpenStack module instead.

OpenStack is an open source project that is in use by a number a cloud providers, each of which have their own ways of using it.

The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack module for Salt Cloud, which uses a libcloud-based connection. The Nova module is designed to use the nova and glance modules already built into Salt.

These modules use the Python novaclient and glanceclient libraries, respectively. In order to use this module, the proper salt configuration must also be in place. This can be specified in the master config, the minion config, a set of grains or a set of pillars.

my_openstack_profile:
  keystone.user: admin
  keystone.password: verybadpass
  keystone.tenant: admin
  keystone.auth_url: 'http://127.0.0.1:5000/v2.0/'

Note that there is currently a dependency upon netaddr. This can be installed on Debian-based systems by means of the python-netaddr package.

This module currently requires the latest develop branch of Salt to be installed.

This module has been tested to work with HP Cloud and Rackspace. See the documentation for specific options for either of these providers. These examples could be set up in the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/openstack.conf:

my-openstack-config:
  # The ID of the minion that will execute the salt nova functions
  auth_minion: myminion
  # The name of the configuration profile to use on said minion
  config_profile: my_openstack_profile

  ssh_key_name: mykey

  provider: nova
  userdata_file: /tmp/userdata.txt

For local installations that only use private IP address ranges, the following option may be useful. Using the old syntax:

Note: For api use, you will need an auth plugin. The base novaclient does not support apikeys, but some providers such as rackspace have extended keystone to accept them

my-openstack-config:
  # Ignore IP addresses on this network for bootstrap
  ignore_cidr: 192.168.50.0/24

my-nova:
  identity_url: 'https://identity.api.rackspacecloud.com/v2.0/'
  compute_region: IAD
  user: myusername
  password: mypassword
  tenant: <userid>
  provider: nova

my-api:
  identity_url: 'https://identity.api.rackspacecloud.com/v2.0/'
  compute_region: IAD
  user: myusername
  api_key: <api_key>
  os_auth_plugin: rackspace
  tenant: <userid>
  provider: nova
  networks:
    - net-id: 47a38ff2-fe21-4800-8604-42bd1848e743
    - net-id: 00000000-0000-0000-0000-000000000000
    - net-id: 11111111-1111-1111-1111-111111111111

Note: You must include the default net-ids when setting networks or the server will be created without the rest of the interfaces

Note: For rackconnect v3, rackconnectv3 needs to be specified with the rackconnect v3 cloud network as it's variable

salt.cloud.clouds.nova.attach_volume(name, server_name, device='/dev/xvdb', **kwargs)

Attach block volume

salt.cloud.clouds.nova.avail_images()

Return a dict of all available VM images on the cloud provider.

salt.cloud.clouds.nova.avail_locations(conn=None, call=None)

Return a list of locations

salt.cloud.clouds.nova.avail_sizes()

Return a dict of all available VM sizes on the cloud provider.

salt.cloud.clouds.nova.create(vm_)

Create a single VM from a data dict

salt.cloud.clouds.nova.create_attach_volumes(name, call=None, **kwargs)

Create and attach volumes to created node

salt.cloud.clouds.nova.create_volume(name, size=100, snapshot=None, voltype=None, **kwargs)

Create block storage device

salt.cloud.clouds.nova.destroy(name, conn=None, call=None)

Delete a single VM

salt.cloud.clouds.nova.get_configured_provider()

Return the first configured instance.

salt.cloud.clouds.nova.get_conn()

Return a conn object for the passed VM data

salt.cloud.clouds.nova.get_image(conn, vm_)

Return the image object to use

salt.cloud.clouds.nova.get_salt_interface(vm_)

Return the salt_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.

salt.cloud.clouds.nova.get_size(conn, vm_)

Return the VM's size object

salt.cloud.clouds.nova.ignore_cidr(vm_, ip)

Return True if we are to ignore the specified IP. Compatible with IPv4.

salt.cloud.clouds.nova.list_nodes(call=None, **kwargs)

Return a list of the VMs that in this location

salt.cloud.clouds.nova.list_nodes_full(call=None, **kwargs)

Return a list of the VMs that in this location

salt.cloud.clouds.nova.list_nodes_select(call=None)

Return a list of the VMs that are on the provider, with select fields

salt.cloud.clouds.nova.managedcloud(vm_)

Determine if we should wait for the managed cloud automation before running. Either 'False' (default) or 'True'.

salt.cloud.clouds.nova.network_create(name, **kwargs)

Create private networks

salt.cloud.clouds.nova.network_list(call=None, **kwargs)

List private networks

salt.cloud.clouds.nova.preferred_ip(vm_, ips)

Return the preferred Internet protocol. Either 'ipv4' (default) or 'ipv6'.

salt.cloud.clouds.nova.rackconnect(vm_)

Determine if we should wait for rackconnect automation before running. Either 'False' (default) or 'True'.

salt.cloud.clouds.nova.reboot(name, conn=None)

Reboot a single VM

salt.cloud.clouds.nova.request_instance(vm_=None, call=None)

Put together all of the information necessary to request an instance through Novaclient and then fire off the request the instance.

Returns data about the instance

salt.cloud.clouds.nova.script(vm_)

Return the script deployment object

salt.cloud.clouds.nova.show_instance(name, call=None)

Show the details from the provider concerning an instance

salt.cloud.clouds.nova.ssh_interface(vm_)

Return the ssh_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.

salt.cloud.clouds.nova.virtual_interface_create(name, net_name, **kwargs)

Create private networks

salt.cloud.clouds.nova.virtual_interface_list(name, **kwargs)

Create private networks

salt.cloud.clouds.nova.volume_attach(name, server_name, device='/dev/xvdb', **kwargs)

Attach block volume

salt.cloud.clouds.nova.volume_create(name, size=100, snapshot=None, voltype=None, **kwargs)

Create block storage device

salt.cloud.clouds.nova.volume_create_attach(name, call=None, **kwargs)

Create and attach volumes to created node

salt.cloud.clouds.nova.volume_delete(name, **kwargs)

Delete block storage device

salt.cloud.clouds.nova.volume_detach(name, **kwargs)

Detach block volume

salt.cloud.clouds.nova.volume_list(**kwargs)

List block devices