Provision VMs on an exiting OpenStack cloud, using native ansible’s cloud modules.
OpenStack Cloud Details¶
--cloud: reference to OpenStack cloud credentials, using os-client-config
This library expects properly configured
clouds: cloud_name: auth_url: http://openstack_instance:5000/v2.0 username: <username> password: <password> project_name: <project_name>
cloud_namecan be then referenced with
infrared openstack --cloud cloud_name ...
clouds.ymlis expected in either
/etc/openstackdirectories according to documentation:
You can also omit the cloud parameter, and infrared will sourced openstackrc file:
source keystonerc infrared openstack openstack ...
--key-file: Private key that will be used to ssh to the provisioned VMs.
Chosen matching public key will be uploaded to the OpenStack account, unless
--key-name: Name of an existing keypair under the OpenStack account.
keypair should hold the public key that matches the provided private
openstack --os-cloud cloud_name keypair listto list available keypairs.
--dns: A Local DNS server used for the provisioned networks and VMs.
If not provided, OpenStack will use default DNS settings, which, in most cases, will not resolve internal URLs.
--prefix: prefix all resources with a string.
Use this with shared tenants to have unique resource names.
--prefix "XYZ"will create router named
--prefix "XYZ-"to create
--topology-network: Description of the network topology.
By default, 3 networks will be provisioned with 1 router. 2 of them will be connected via the router to an external network discovered automatically (when more than 1 external network is found, the first will be chosen):
The following is an example of a
--topology-nodes: KeyValueList description of the nodes.
- A floating IP will be provisioned on a designated network.
--image: default image name or id for the VMs
openstack --os-cloud cloud_name image listto see a list of available images
--cleanupBoolean. Whether to provision resources, or clean them from the tenant.
Infrared registers all provisioned resources to the workspace on creation, and will clean only registered resources:
infrared openstack --cleanup yes