beaker-openstack 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/release.yml +41 -0
- data/.github/workflows/release.yml +95 -20
- data/.github/workflows/test.yml +33 -6
- data/CHANGELOG.md +24 -0
- data/Gemfile +1 -1
- data/README.md +202 -45
- data/beaker-openstack.gemspec +25 -20
- data/lib/beaker/hypervisor/openstack.rb +363 -369
- data/lib/beaker-openstack/version.rb +1 -1
- data/openstack.md +98 -68
- data/spec/beaker/hypervisor/openstack_spec.rb +246 -177
- metadata +63 -76
data/openstack.md
CHANGED
|
@@ -1,62 +1,64 @@
|
|
|
1
1
|
# Openstack
|
|
2
2
|
|
|
3
|
-
OpenStack is a free and open-source software platform for cloud computing.
|
|
4
|
-
|
|
5
|
-
Considered **EXPERIMENTAL**, may break without notice.
|
|
3
|
+
OpenStack is a free and open-source software platform for cloud computing.
|
|
4
|
+
[Their Site](http://www.openstack.org/)
|
|
6
5
|
|
|
7
6
|
# Getting Started
|
|
8
7
|
|
|
9
8
|
### Requirements
|
|
10
9
|
|
|
11
|
-
Get
|
|
10
|
+
Get OpenStack access & security credentials:
|
|
12
11
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
12
|
+
- `openstack_api_key`
|
|
13
|
+
- `openstack_auth_url`
|
|
14
|
+
- `openstack_username`
|
|
15
|
+
- `openstack_project_name`
|
|
16
|
+
- `openstack_network`
|
|
17
|
+
- `openstack_keyname`
|
|
19
18
|
|
|
20
|
-
If you are using [OpenStack Dashboard "Horizon"](https://wiki.openstack.org/wiki/Horizon)
|
|
21
|
-
you can find these keys in next places:
|
|
19
|
+
If you are using [OpenStack Dashboard "Horizon"](https://wiki.openstack.org/wiki/Horizon), you can find these values in the following places:
|
|
22
20
|
|
|
23
|
-
1.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
2.
|
|
28
|
-
3.
|
|
29
|
-
4.
|
|
21
|
+
1. Login to Horizon / "Project" / "Compute" / "Access & Security" / "API Access" / "Download OpenStack RC File":
|
|
22
|
+
- `openstack_auth_url` = `OS_AUTH_URL` (ensure it ends with `/v3`)
|
|
23
|
+
- `openstack_username` = `OS_USERNAME`
|
|
24
|
+
- `openstack_project_name` = `OS_PROJECT_NAME`
|
|
25
|
+
2. `openstack_network`: "Project" / "Network" / "Networks"
|
|
26
|
+
3. `openstack_keyname`: "Project" / "Compute" / "Access & Security" / "Key Pairs"
|
|
27
|
+
4. `openstack_api_key`: Your user password
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
---
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
except that there are a number of required properties that need to be added to every host
|
|
35
|
-
in order for the Openstack hypervisor to provision hosts properly.
|
|
31
|
+
### Setup an OpenStack Hosts File
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
An OpenStack hosts file looks like a typical Beaker hosts file, but includes additional required properties.
|
|
38
34
|
|
|
35
|
+
**Basic Openstack hosts file**
|
|
36
|
+
```
|
|
39
37
|
HOSTS:
|
|
40
|
-
centos-
|
|
38
|
+
centos-9-master:
|
|
41
39
|
roles:
|
|
42
40
|
- master
|
|
43
41
|
- agent
|
|
44
42
|
- database
|
|
45
43
|
- dashboard
|
|
46
|
-
platform: el-
|
|
44
|
+
platform: el-9-x86_64
|
|
47
45
|
hypervisor: openstack
|
|
48
|
-
image: centos-
|
|
46
|
+
image: centos-9-x86_64-nocm
|
|
49
47
|
flavor: m1.large
|
|
50
|
-
|
|
48
|
+
|
|
51
49
|
CONFIG:
|
|
52
50
|
nfs_server: none
|
|
53
51
|
consoleport: 443
|
|
54
52
|
openstack_api_key: Pas$w0rd
|
|
55
53
|
openstack_username: user
|
|
56
|
-
openstack_auth_url: http://10.10.10.10:5000/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
openstack_auth_url: http://10.10.10.10:5000/v3
|
|
55
|
+
openstack_project_name: testing
|
|
56
|
+
openstack_user_domain: Default
|
|
57
|
+
openstack_project_domain: Default
|
|
58
|
+
openstack_network: testing
|
|
59
|
+
openstack_floating_ip: true
|
|
60
|
+
floating_ip_pool: external_network_name
|
|
61
|
+
```
|
|
60
62
|
|
|
61
63
|
The `image` - image name.
|
|
62
64
|
|
|
@@ -67,8 +69,7 @@ The `flavor` - templates for VMs, defining sizes for RAM, disk, number of cores,
|
|
|
67
69
|
|
|
68
70
|
### user-data
|
|
69
71
|
|
|
70
|
-
"user data" - a blob of data that the user can specify when they launch an instance.
|
|
71
|
-
The instance can access this data through the metadata service or config drive with one of the next requests:
|
|
72
|
+
"user data" - a blob of data that the user can specify when they launch an instance. The instance can access this data through the metadata service or config drive with one of the next requests:
|
|
72
73
|
|
|
73
74
|
- curl http://169.254.169.254/2009-04-04/user-data
|
|
74
75
|
- curl http://169.254.169.254/openstack/2012-08-10/user_data
|
|
@@ -79,16 +80,16 @@ Examples of `user_data` you can find here: http://cloudinit.readthedocs.io/en/la
|
|
|
79
80
|
Also if you plan use `user-data` make sure that 'cloud-init' package installed in your VM `image` and 'cloud-init' service is running.
|
|
80
81
|
|
|
81
82
|
**Example Openstack hosts file with user_data**
|
|
82
|
-
|
|
83
|
+
```
|
|
83
84
|
HOSTS:
|
|
84
|
-
centos-
|
|
85
|
+
centos-9-master:
|
|
85
86
|
roles:
|
|
86
87
|
- master
|
|
87
88
|
- agent
|
|
88
89
|
- database
|
|
89
90
|
- dashboard
|
|
90
|
-
platform: el-
|
|
91
|
-
image: centos-
|
|
91
|
+
platform: el-9-x86_64
|
|
92
|
+
image: centos-9-x86_64-nocm
|
|
92
93
|
flavor: m1.large
|
|
93
94
|
hypervisor: openstack
|
|
94
95
|
user_data: |
|
|
@@ -98,51 +99,64 @@ Also if you plan use `user-data` make sure that 'cloud-init' package installed i
|
|
|
98
99
|
CONFIG:
|
|
99
100
|
nfs_server: none
|
|
100
101
|
consoleport: 443
|
|
101
|
-
openstack_api_key:
|
|
102
|
+
openstack_api_key: Pas$w0rd
|
|
102
103
|
openstack_username: user
|
|
103
|
-
openstack_auth_url: http://10.10.10.10:5000/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
openstack_auth_url: http://10.10.10.10:5000/v3
|
|
105
|
+
openstack_project_name: testing
|
|
106
|
+
openstack_user_domain: Default
|
|
107
|
+
openstack_project_domain: Default
|
|
108
|
+
openstack_network: testing
|
|
109
|
+
openstack_floating_ip: true
|
|
110
|
+
floating_ip_pool: external_network_name
|
|
111
|
+
```
|
|
108
112
|
### Security groups
|
|
109
113
|
|
|
110
|
-
A security group is a set of rules for incoming and outgoing traffic to
|
|
111
|
-
an instance. You can associate a host with one or many security groups
|
|
112
|
-
in the `CONFIG` section of your hosts file:
|
|
114
|
+
A security group is a set of rules for incoming and outgoing traffic to an instance. You can associate a host with one or many security groups in the `CONFIG` section of your hosts file:
|
|
113
115
|
|
|
114
|
-
security_group: ['my_sg', 'default']
|
|
116
|
+
`security_group: ['my_sg', 'default']`
|
|
115
117
|
|
|
116
118
|
This is an optional config parameter.
|
|
117
119
|
|
|
118
|
-
### Floating
|
|
120
|
+
### Floating IPs
|
|
121
|
+
|
|
122
|
+
Floating IPs provide external access to instances.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
openstack_floating_ip: true
|
|
126
|
+
floating_ip_pool: 'my_pool_name'
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Important behaviour:**
|
|
119
130
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
- Instances will have **two IPs**:
|
|
132
|
+
- Internal (fixed) IP from the project network
|
|
133
|
+
- External Floating IP (NAT mapped)
|
|
134
|
+
- This is **expected OpenStack behaviour**
|
|
135
|
+
- Beaker will use the **floating IP for connectivity**
|
|
124
136
|
|
|
125
|
-
|
|
137
|
+
**Requirement:**
|
|
138
|
+
- `floating_ip_pool` must reference an **external network**
|
|
126
139
|
|
|
127
140
|
### Volumes
|
|
128
141
|
|
|
129
|
-
|
|
130
|
-
supported to cater for differences in the APIs. To create and attach volumes simply add hash
|
|
131
|
-
called 'volumes' to a host in the HOSTS section. Each key is the name given to the volume upon
|
|
132
|
-
resource creation. The value is a hash with a single integer parameter 'size' which defines the
|
|
133
|
-
volume size in MB.
|
|
142
|
+
Volumes are provisioned via Cinder.
|
|
134
143
|
|
|
135
|
-
|
|
144
|
+
To attach volumes, define a `volumes` hash under a host. The value is a hash with a single integer parameter 'size' which defines the volume size in GB.
|
|
136
145
|
|
|
146
|
+
**Example OpenStack hosts file with non-ephemeral root volume and additional volumes**
|
|
147
|
+
```
|
|
137
148
|
HOSTS:
|
|
138
149
|
ceph:
|
|
139
150
|
roles:
|
|
140
151
|
- master
|
|
141
|
-
platform: ubuntu-16.04-amd64
|
|
142
152
|
hypervisor: openstack
|
|
153
|
+
platform: ubuntu-16.04-amd64
|
|
154
|
+
user: ubuntu
|
|
143
155
|
flavor: m1.large
|
|
144
156
|
image: xenial-server-cloudimg-amd64-scsi
|
|
145
|
-
|
|
157
|
+
root_volume:
|
|
158
|
+
size: 30
|
|
159
|
+
delete_on_termination: true
|
|
146
160
|
volumes:
|
|
147
161
|
osd0:
|
|
148
162
|
size: 10000
|
|
@@ -152,15 +166,31 @@ volume size in MB.
|
|
|
152
166
|
size: 10000
|
|
153
167
|
journal:
|
|
154
168
|
size: 1000
|
|
169
|
+
```
|
|
155
170
|
|
|
171
|
+
### Behaviour
|
|
156
172
|
|
|
157
|
-
|
|
173
|
+
- Root volume:
|
|
174
|
+
- Created from image
|
|
175
|
+
- Controlled by `delete_on_termination` (default: `true`)
|
|
176
|
+
- Additional volumes:
|
|
177
|
+
- Created and attached
|
|
178
|
+
- **Never deleted automatically**
|
|
179
|
+
- Must be cleaned up manually if required
|
|
158
180
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
181
|
+
## Disabling Volume Support
|
|
182
|
+
|
|
183
|
+
If your OpenStack deployment does not support Cinder:
|
|
184
|
+
|
|
185
|
+
`openstack_volume_support: false`
|
|
162
186
|
|
|
163
187
|
You can also configure this setting via an environment variable:
|
|
164
188
|
|
|
165
|
-
|
|
166
|
-
|
|
189
|
+
`export OS_VOLUME_SUPPORT=false`
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
## Notes
|
|
193
|
+
|
|
194
|
+
- Keystone v3 is required (`/v3` auth URL)
|
|
195
|
+
- Do not mix `_id` and non-`_id` domain/project fields
|
|
196
|
+
- Floating IP networks must be marked as **external**
|