4 Use launcher.py to deploy and clean up example environments. These examples are described in YAML files.
6 #. Add your OpenStack connection information to the deploy-complex-network.yaml.
8 Edit <path to repo>/examples/complex-network/deploy-complex-network.yaml
10 - openstack: the top level tag that denotes configuration for the OpenStack components
12 - connection: - contains the credentials and endpoints required to
13 connect with OpenStack
14 - username: - the project's user (required)
15 - password: - the tentant's user password (required)
16 - auth\_url: - the URL to the OpenStack APIs (required)
17 - project\_name: - the name of the OpenStack project for the user
19 - http\_proxy: - the {{ host }}:{{ port }} of the proxy server the
20 HTTPPhotoman01(optional)
22 #. Go to the examples directory.
26 cd <snaps repo>/examples/
28 #. Deploy the launcher.
32 python launch.py -t ./complex-network/deploy-complex-network.yaml -d
34 #. Clean the deployment.
38 python launch.py -t ./complex-network/deploy-complex-network.yaml -c
40 #. Customize the deployment by changing the yaml file.
42 The configuration file used to deploy and provision a virtual environment has been designed to describe the required
43 images, networks, SSH public and private keys, associated VMs, as well as any required post deployment provisioning
46 - openstack: the top level tag that denotes configuration for the
49 - connection: - contains the credentials and endpoints required to
50 connect with OpenStack
51 - username: - the project's user (required)
52 - password: - the tentant's user password (required)
53 - auth\_url: - the URL to the OpenStack APIs (required)
54 - project\_name: - the name of the OpenStack project for the user
56 - http\_proxy: - the {{ host }}:{{ port }} of the proxy server the
57 HTTPPhotoman01(optional)
58 - images: - describes each image
61 - name: The unique image name. If the name already exists for
62 your project, a new one will not be created (required)
63 - format: The format type of the image i.e. qcow2 (required)
64 - download\_url: The HTTP download location of the image file
66 - nic\_config\_pb\_loc: The file location relative to the CWD
67 (python directory) to the Ansible Playbook used to configure
68 VMs with more than one port. VMs get their first NIC configured
69 for free while subsequent ones are not. This value/script will
70 only be leveraged when necessary. Centos has been supported
72 "provisioning/ansible/centos-network-setup/configure\_host.yml".
77 - name: The name of the network to be created. If one already
78 exists, a new one will not be created (required)
79 - admin\_state\_up: T\|F (default True)
81 - project\_name: Name of the project who owns the network. Note:
82 only administrative users can specify projects other than their
84 - external: T\|F whether or not network is external (default
86 - network\_type: The type of network to create. (optional)
90 - name: The name of the network to be created. If one already
91 exists, a new one will not be created. Note: although
92 OpenStack allows for multiple subnets to be applied to any
93 given network, we have not included support as our current
94 use cases does not utilize this functionality (required)
95 - cidr: The subnet mask value (required)
96 - dns\_nameservers: A list of IP values used for DNS
97 resolution (default: 8.8.8.8)
98 - ip\_version: 4\|6 (default: 4)
99 - project\_name: Name of the project who owns the network.
100 Note: only administrative users can specify projects other
101 than their own (optional)
102 - start: The start address for allocation\_pools (optional)
103 - end: The ending address for allocation\_pools (optional)
104 - gateway\_ip: The IP address to the gateway (optional)
105 - enable\_dhcp: T\|F (optional)
106 - dns\_nameservers: List of DNS server IPs
107 - host\_routes: A list of host route dictionaries (optional)
109 ``yaml "host_routes":[ { "destination":"0.0.0.0/0", "nexthop":"123.456.78.9" }, { "destination":"192.168.0.0/24", "nexthop":"192.168.0.1" } ]``
110 - destination: The destination for a static route (optional)
111 - nexthop: The next hop for the destination (optional)
112 - ipv6\_ra\_mode: Valid values: "dhcpv6-stateful",
113 "dhcpv6-stateless", and "slaac" (optional)
114 - ipv6\_address\_mode: Valid values: "dhcpv6-stateful",
115 "dhcpv6-stateless", and "slaac" (optional)
120 - name: The name of the router to be created. If one already
121 exists, a new one will not be created (required)
122 - project\_name: Name of the project who owns the network. Note:
123 only administrative users can specify projects other than their
125 - internal\_subnets: A list of subnet names on which the router
126 will be placed (optional)
127 - external\_gateway: A dictionary containing the external gateway
128 parameters: "network\_id", "enable\_snat",
129 "external\_fixed\_ips" (optional)
130 - interfaces: A list of port interfaces to create to other
133 - port (Leverages the same class/structure as port objects on
134 VM instances. See port definition below for a
135 full accounting of the port attributes. The ones listed
136 below are generally used for routers)
138 - name: The name given to the new port (must be unique for
140 - network\_name: The name of the new port's network
142 - ip\_addrs: A list of k/v pairs (optional)
143 - subnet\_name: the name of a subnet that is on the port's
145 - ip: An IP address of the associated subnet to assign to
146 the new port (optional but generally required for router
152 - name: The name of the keypair to be created. If one already
153 exists, a new one will not be created but simply loaded from
154 its configured file location (required)
155 - public\_filepath: The path to where the generated public key
156 will be stored if it does not exist (optional but really
157 required for provisioning purposes)
158 - private\_filepath: The path to where the generated private key
159 will be stored if it does not exist (optional but really
160 required for provisioning purposes)
165 - name: The unique instance name for project. (required)
166 - flavor: Must be one of the preconfigured flavors (required)
167 - imageName: The name of the image to be used for deployment
169 - keypair\_name: The name of the keypair to attach to instance
170 (optional but required for NIC configuration and Ansible
172 - sudo\_user: The name of a sudo\_user that is attached to the
173 keypair (optional but required for NIC configuration and
174 Ansible provisioning)
175 - vm\_boot\_timeout: The number of seconds to block waiting for
176 an instance to deploy and boot (default 900)
177 - vm\_delete\_timeout: The number of seconds to block waiting for
178 an instance to be deleted (default 300)
179 - ssh\_connect\_timeout: The number of seconds to block waiting
180 for an instance to achieve an SSH connection (default 120)
181 - ports: A list of port configurations (should contain at least
183 - port: Denotes the configuration of a NIC
185 - name: The unique port name for project (required)
186 - network\_name: The name of the network to which the port is
188 - ip\_addrs: Static IP addresses to be added to the port by
190 - subnet\_name: The name of the subnet
191 - ip: The assigned IP address (when null, OpenStack will
192 assign an IP to the port)
193 - admin\_state\_up: T\|F (default True)
194 - project\_name: The name of the project who owns the network.
195 Only administrative users can specify a the project ID other
196 than their own (optional)
197 - mac\_address: The desired MAC for the port (optional)
198 - fixed\_ips: A dictionary that allows one to specify only a
199 subnet ID, OpenStack Networking allocates an available IP
200 from that subnet to the port. If you specify both a subnet
201 ID and an IP address, OpenStack Networking tries to allocate
202 the specified address to the port. (optional)
203 - seurity\_groups: A list of security group IDs (optional)
204 - allowed\_address\_pairs: A dictionary containing a set of
205 zero or more allowed address pairs. An address pair contains
206 an IP address and MAC address. (optional)
207 - opt\_value: The extra DHCP option value (optional)
208 - opt\_name: The extra DHCP option name (optional)
209 - device\_owner: The ID of the entity that uses this port. For
210 example, a DHCP agent (optional)
211 - device\_id: The ID of the device that uses this port. For
212 example, a virtual server (optional)
214 - floating\_ips: list of floating\_ip configurations (optional)
217 - name: Must be unique for VM instance (required)
218 - port\_name: The name of the port requiring access to the
219 external network (required)
220 - subnet\_name: The name of the subnet contains the IP address on
221 the port on which to create the floating IP (optional)
222 - router\_name: The name of the router connected to an external
223 network used to attach the floating IP (required)
224 - provisioning: (True\|False) Denotes whether or not this IP can
225 be used for Ansible provisioning (default True)
227 - ansible: Each set of attributes below are contained in a list
229 - playbook\_location: Full path or relative to the directory in
230 which the deployment file resides (required)
231 - hosts: A list of hosts to which the playbook will be executed
233 - variables: Should your Ansible scripts require any substitution
234 values to be applied with Jinga2templates, the values defined here
235 will be used to for substitution
236 - tag name = substitution variable names. For instance, for any file
237 being pushed to the host being provisioned containing a value such
238 as {{ foo }}, you must specify a tag name of "foo"
241 - type: string\|port\|os\_creds\|vm-attr (note: will need to make
242 changes to deploy\_venv.py#\_\_get\_variable\_value() for
244 - when type == string, an tag name "value" must exist and its
245 value will be used for template substituion
246 - when type == port, custom code has been written to extract
247 certain assigned values to the port:
249 - vm\_name: must correspond to a VM's name as configured in
251 - port\_name: The name of the port from which to extract the
252 substitution values (required)
253 - port\_value: The port value. Currently only supporting
254 "mac\_address" and "ip\_address" (only the first)
256 - when type == os\_creds, custom code has been written to extract
257 the file's connection values:
259 - username: connection's user
260 - password: connection's password
261 - auth\_url: connection's URL
262 - project\_name: connection's project
264 - when type == vm-attr, custom code has been written to extract
265 the following attributes from the vm:
267 - vm\_name: must correspond to a VM's name as configured in
269 - value -> floating\_ip: is currently the only vm-attr