teuthology.provision package


teuthology.provision.downburst module

class teuthology.provision.downburst.Downburst(name, os_type, os_version, status=None, user='ubuntu', logfile=None)

Bases: object

A class that provides methods for creating and destroying virtual machine instances using downburst: https://github.com/ceph/downburst


Assemble a configuration to pass to downburst, and write it to a file.


Launch a virtual machine instance.

If creation fails because an instance with the specified name is already running, first destroy it, then try again. This process will repeat two more times, waiting 60s between tries, before giving up.


Destroy (shutdown and delete) a virtual machine instance.


Remove the downburst configuration file created by build_config()


First check for downburst in the user’s path. Then check in ~/src, ~ubuntu/src, and ~teuthology/src. Return ‘’ if no executable downburst is found.


Return a table of valid distros.

If downburst is in path use it. If either downburst is unavailable, or if downburst is unable to produce a json list, then use a default table.

teuthology.provision.fog module

class teuthology.provision.fog.FOG(name, os_type, os_version)

Bases: object

Reimage bare-metal machines with https://fogproject.org/


Cancel an active deploy task


Initiate deployment and wait until completion

Parameters:task_id – The id of the task to query
Returns:True if the task is active

A no-op; we just leave idle nodes as-is

do_request(url_suffix, data=None, method='GET', verify=True)

A convenience method to submit a request to the FOG server :param url_suffix: The portion of the URL to append to the endpoint,

e.g. ‘/system/info’
  • data – Optional JSON data to submit with the request
  • method – The HTTP method to use for the request (default: ‘GET’)
  • verify – Whether or not to raise an exception if the request is unsuccessful (default: True)

A requests.models.Response object

Returns:A list of deploy tasks which are active on our host

Locate the host we want to use, and return the FOG object which represents it :returns: A dict describing the host


Locate the image we want to use, and return the FOG object which represents it :returns: A dict describing the image

Parameters:host_id – The id of the host to deploy
Returns:The id of the scheduled task

Tell FOG to use the proper image on the next deploy :param host_id: The id of the host to deploy

timestamp_format = '%Y-%m-%d %H:%M:%S'

Wait until the specified task is no longer active (i.e., it has completed)


Check for required FOG settings

Parameters:warn – Whether or not to log a message containing unset parameters
Returns:True if they are present; False if they are not

Fetch and parse config.fog[‘machine_types’]

Returns:The list of FOG-configured machine types. An empty list if FOG is not configured.

teuthology.provision.openstack module

class teuthology.provision.openstack.ProvisionOpenStack

Bases: teuthology.openstack.OpenStack

A class that provides methods for creating and destroying virtual machine instances using OpenStack

attach_volumes(server_name, volumes)

Create and attach volumes to the named OpenStack instance. If attachment is failed, make another try.

create(num, os_type, os_version, arch, resources_hint)

Create num OpenStack instances running os_type os_version and return their names. Each instance has at least the resources described in resources_hint.

init_user_data(os_type, os_version)

Get the user-data file that is fit for os_type and os_version. It is responsible for setting up enough for ansible to take over.

static ip2name(prefix, ip)

return the instance name suffixed with the IP address.

Module contents

teuthology.provision.create_if_vm(ctx, machine_name, _downburst=None)

Use downburst to create a virtual machine

Parameters:_downburst – Only used for unit testing.
teuthology.provision.destroy_if_vm(ctx, machine_name, user=None, description=None, _downburst=None)

Use downburst to destroy a virtual machine

Return False only on vm downburst failures.

Parameters:_downburst – Only used for unit testing.
teuthology.provision.reimage(ctx, machine_name)