Write a new provider¶
The actual implementation gives providers for Static resources, Vagrant, Grid‘5000 and Openstack itself. If you want to support another testbed, then implementing a new provider is easy as 500 lines of Python code.
init method provides resources and provisions the environment.
To let the provider knows what kind and how many resources should be
provided, the method is fed with the
config object that maps the
reservations file. So a provider can access the resource description
rsc = config['resources'] # Use rsc to book resources ...
At the end of the
init, the provider should return a list of
host.py that Enos can SSH on,
together with a pool of available IP for OpenStack Network.
destoy method destroys resources that have been used for the
deployment. The provider can rely on the environment variable to get
information related to its deployment.
Default Provider Configuration Methods¶
default_config specifies keys used to configure the provider
dict. A key could be optional and so should be provided
with a default value, or required and so should be set to
The user then can override these keys in the reservation file, under
provider key. Keys marked as
None in the
default_config are automatically tested for overriding in the
Enos automatically instantiates a provider based on the name specified
reservation.yaml. For instance, based on the following
Enos seeks for a file called
and instantiates its main class. But sometimes, the provider requires
extra information for its initialisation. The good place for this
information is to put it under the provider key. In this case, the
provider name should be accessible throughout the
provider: type: "my-provider" extra-var: ... ...
Then the provider can access
config['provider']['extra-var']. Supported extra information is
documented into the provider documentation.