Merge lp:~bbaqar/charms/bundles/plumgrid-ons/liberty into lp:~plumgrid-team/charms/bundles/plumgrid-ons/liberty
- Charm Bundles (0.0)
- liberty
- Merge into liberty
Proposed by
Bilal Baqar
Status: | Merged |
---|---|
Merged at revision: | 11 |
Proposed branch: | lp:~bbaqar/charms/bundles/plumgrid-ons/liberty |
Merge into: | lp:~plumgrid-team/charms/bundles/plumgrid-ons/liberty |
Diff against target: |
413 lines (+234/-35) 4 files modified
README.md (+9/-8) assign_tag.sh (+26/-0) bundles.yaml (+81/-27) setup_lcm.sh (+118/-0) |
To merge this branch: | bzr merge lp:~bbaqar/charms/bundles/plumgrid-ons/liberty |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Plum grid team | Pending | ||
Review via email: mp+285288@code.launchpad.net |
Commit message
Description of the change
Changes:
1. Divided the bundle into 3 different bundles inside the same file
2. All plumgrid config parameters are in the same place
3. Added support to pull packages from LCM
4. Added assign_tags.sh to assign tags to controller, compute and gateway nodes
5. Added setup_lcm.sh to enable pg-tools
To post a comment you must log in.
- 11. By Bilal Baqar
-
1. Divided the bundle into 3 different bundles inside the same file
2. All plumgrid config parameters are in the same place
3. Added support to pull packages from LCM
4. Added assign_tags.sh to assign tags to controller, compute and gateway nodes
5. Added setup_lcm.sh to enable pg-tools
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'README.md' |
2 | --- README.md 2015-08-24 20:08:26 +0000 |
3 | +++ README.md 2016-02-10 16:35:43 +0000 |
4 | @@ -6,7 +6,7 @@ |
5 | |
6 | The distributed architecture can scale to multi-rack or geographically distributed OpenStack deployments while the high availability features ensure maximum service uptime while minimizing downtime during maintenance windows. The product suite also simplifies ongoing operations with built-in monitoring, analytics and troubleshooting tools. By providing a comprehensive suite of capabilities, PLUMgrid ONS for OpenStack overcomes the scale, availability, feature set and lifecycle limitations of OpenStack Networking. |
7 | |
8 | -This bundle deploys a OpenStack Cloud (Kilo release) on Ubuntu 14.04 LTS, providing Dashboard, Compute, Network (PLUMgrid), Block Storage (Cinder), Identity and Image services. |
9 | +This bundle deploys a OpenStack Cloud (Liberty release) on Ubuntu 14.04 LTS, providing Dashboard, Compute, Network (PLUMgrid), Block Storage (Cinder), Identity and Image services. |
10 | |
11 | ## PLUMgrid Components |
12 | |
13 | @@ -30,14 +30,15 @@ |
14 | |
15 | - A minimum of 8GB of physical RAM. |
16 | - Enough CPU cores to support your capacity requirements. |
17 | - - Two cabled network ports on eth0 and eth1 (see below). |
18 | + - Two cabled network ports on eth0 and eth1 on all nodes and eth2 as well on the plumgrid-gateway node (see below). |
19 | - MTU of atleast 1580 needs to be supported by the managment network of MAAS. |
20 | |
21 | -Servers should have two physical network ports cabled; the first is used for general communication between services in the Cloud, the second is used for 'public' network traffic to and from instances (North/South traffic) running within the Cloud. |
22 | +Servers should have two physical network ports cabled; the first is used for general communication between services in the Cloud, the second is used overlay fabric connectivity and the third is required on the PLUMgrid gateway node for 'public' network traffic to and from instances (North/South traffic) running within the Cloud. |
23 | |
24 | ## Deployment |
25 | |
26 | - juju quickstart bundle:plumgrid-ons |
27 | + juju quickstart -i |
28 | + juju-deployer -c bundles.yaml plumgrid-liberty |
29 | juju set neutron-api plumgrid-virtual-ip="<Any IP in subnet>" |
30 | juju set plumgrid-director plumgrid-virtual-ip="<Same IP as above>" |
31 | |
32 | @@ -60,9 +61,10 @@ |
33 | |
34 | ## Components |
35 | |
36 | - - 1 Node for PLUMgrid Director and Mysql, Rabbitmq Server, Keystone, Nova Cloud Controller, Glance, Horizon and Cinder under LXC containers. |
37 | - - 1 Node for Nova Compute and PLUMgrid Edge. |
38 | - - 1 Node for PLUMgrid Gateway. |
39 | + - 1 Node for JUJU state server |
40 | + - 1 Node for PLUMgrid Director and Mysql, Rabbitmq Server, Keystone, Nova Cloud Controller, Glance, Horizon and Cinder under LXC containers |
41 | + - 2 Nodes for Nova Compute and PLUMgrid Edge |
42 | + - 1 Node for PLUMgrid Gateway |
43 | |
44 | PLUMgrid Open Networking Suite (ONS) is built with the ability to scale and support high availability across the PLUMgrid Platform. PLUMgrid ONS supports high availability across multiple components within a PLUMgrid Zone. PLUMgrid Director, PLUMgrid edge running on Nova Compute and PLUMgrid Gateway are designed to be horizontally scalable. |
45 | |
46 | @@ -86,7 +88,6 @@ |
47 | ##Contact Information |
48 | |
49 | Bilal Baqar <bbaqar@plumgrid.com> |
50 | -Bilal Ahmad <bilal@plumgrid.com> |
51 | |
52 | PLUMgrid, Inc. |
53 | 5155 Old Ironsides Dr, Suite 200, Santa Clara, CA 95054, U.S.A | Ph:+1-408-800-7586 |
54 | |
55 | === added file 'assign_tag.sh' |
56 | --- assign_tag.sh 1970-01-01 00:00:00 +0000 |
57 | +++ assign_tag.sh 2016-02-10 16:35:43 +0000 |
58 | @@ -0,0 +1,26 @@ |
59 | +#!/bin/bash |
60 | +set +e |
61 | + |
62 | +function usage() { |
63 | + cat <<DELIM__ |
64 | +usage: $(basename $0) [Parameter 1] [Parameter 2] [Parameter 3] |
65 | + [Parameter 1]: Registered MAAS Profile Name |
66 | + [Parameter 2]: Node FQDN |
67 | + [Parameter 3]: Tag Name |
68 | + |
69 | +Example: |
70 | + ./assign_tag.sh maas-cli node0.maas compute |
71 | +DELIM__ |
72 | +} |
73 | + |
74 | +if [[ $# -ne 3 ]]; then |
75 | + echo "Incorrect input" |
76 | + usage |
77 | + exit 1 |
78 | +fi |
79 | + |
80 | +dpkg -l "jq" > /dev/null || sudo apt-get install -y "jq" |
81 | +nodes_json=$(maas $1 nodes list) |
82 | +node_id=$(echo $nodes_json | jq '.[] | select(.hostname=="'$2'")' | jq .system_id | sed 's/"//g') |
83 | +maas $1 tags new name="$3" comment="$3 Tag" |
84 | +maas $1 tag update-nodes $3 add="$node_id" |
85 | |
86 | === modified file 'bundles.yaml' |
87 | --- bundles.yaml 2016-02-01 07:08:58 +0000 |
88 | +++ bundles.yaml 2016-02-10 16:35:43 +0000 |
89 | @@ -1,4 +1,35 @@ |
90 | -plumgrid-ons: |
91 | +# This bundle file containts the following bundles: |
92 | +# 1. plumgrid-ons-phase1: |
93 | +# This bundle deploys 4 nodes in total: |
94 | +# - 2 x Compute |
95 | +# - 1 x Controller |
96 | +# - 1 x Gateways |
97 | +# Please note that the first compute is on the JUJU Bootstrap node i.e. JUJU machine 0 |
98 | +# This bundle waits for all the nodes to be deployed before it exits |
99 | +# |
100 | +# 2. plumgrid-ons-phase2: |
101 | +# This bundle deploys all the required charms to bring up OpenStack Liberty with PLUMgrid |
102 | +# |
103 | +# 3. plumgrid-liberty: |
104 | +# This bundle overwrites the configs in plumgrid-ons-phase2 |
105 | + |
106 | +plumgrid-ons-phase1: |
107 | + series: trusty |
108 | + services: |
109 | + controller-node: |
110 | + charm: "cs:trusty/ubuntu" |
111 | + num_units: 1 |
112 | + constraints: tags=controller |
113 | + compute-node: |
114 | + charm: "cs:trusty/ubuntu" |
115 | + num_units: 2 |
116 | + constraints: tags=compute |
117 | + gateway-node: |
118 | + charm: "cs:trusty/ubuntu" |
119 | + num_units: 1 |
120 | + constraints: tags=gateway |
121 | +plumgrid-ons-phase2: |
122 | + inherits: plumgrid-ons-phase1 |
123 | series: 'trusty' |
124 | relations: |
125 | - ['mysql', 'keystone'] |
126 | @@ -34,18 +65,18 @@ |
127 | annotations: |
128 | "gui-x": "-250" |
129 | "gui-y": "250" |
130 | - to: 'lxc:plumgrid-director=0' |
131 | + to: 'lxc:controller-node=0' |
132 | rabbitmq-server: |
133 | - charm: cs:trusty/rabbitmq-server |
134 | + charm: cs:trusty/rabbitmq-server-43 |
135 | num_units: 1 |
136 | options: |
137 | source: cloud:trusty-liberty |
138 | annotations: |
139 | "gui-x": "-750" |
140 | "gui-y": "250" |
141 | - to: 'lxc:plumgrid-director=0' |
142 | + to: 'lxc:controller-node=0' |
143 | keystone: |
144 | - charm: cs:trusty/keystone |
145 | + charm: cs:trusty/keystone-33 |
146 | num_units: 1 |
147 | options: |
148 | admin-password: plumgrid |
149 | @@ -53,9 +84,9 @@ |
150 | annotations: |
151 | "gui-x": "0" |
152 | "gui-y": "0" |
153 | - to: 'lxc:plumgrid-director=0' |
154 | + to: 'lxc:controller-node=0' |
155 | nova-cloud-controller: |
156 | - charm: cs:trusty/nova-cloud-controller |
157 | + charm: cs:trusty/nova-cloud-controller-66 |
158 | num_units: 1 |
159 | options: |
160 | console-access-protocol: novnc |
161 | @@ -65,34 +96,34 @@ |
162 | annotations: |
163 | "gui-x": "-500" |
164 | "gui-y": "0" |
165 | - to: 'lxc:plumgrid-director=0' |
166 | + to: 'lxc:controller-node=0' |
167 | glance: |
168 | - charm: cs:trusty/glance |
169 | + charm: cs:trusty/glance-30 |
170 | num_units: 1 |
171 | options: |
172 | openstack-origin: cloud:trusty-liberty |
173 | annotations: |
174 | "gui-x": "-250" |
175 | "gui-y": "-250" |
176 | - to: 'lxc:plumgrid-director=0' |
177 | + to: 'lxc:controller-node=0' |
178 | openstack-dashboard: |
179 | - charm: cs:trusty/openstack-dashboard |
180 | + charm: cs:trusty/openstack-dashboard-21 |
181 | num_units: 1 |
182 | options: |
183 | openstack-origin: cloud:trusty-liberty |
184 | annotations: |
185 | "gui-x": "0" |
186 | "gui-y": "-500" |
187 | - to: 'lxc:plumgrid-director=0' |
188 | + to: 'lxc:controller-node=0' |
189 | cinder: |
190 | - charm: cs:trusty/cinder |
191 | + charm: cs:trusty/cinder-34 |
192 | num_units: 1 |
193 | options: |
194 | openstack-origin: cloud:trusty-liberty |
195 | annotations: |
196 | "gui-x": "250" |
197 | "gui-y": "-250" |
198 | - to: 'lxc:plumgrid-director=0' |
199 | + to: 'lxc:controller-node=0' |
200 | neutron-api: |
201 | branch: lp:~bbaqar/charms/trusty/neutron-api/liberty |
202 | num_units: 1 |
203 | @@ -102,15 +133,13 @@ |
204 | openstack-origin: cloud:trusty-liberty |
205 | plumgrid-password: plumgrid |
206 | plumgrid-username: plumgrid |
207 | - plumgrid-virtual-ip: 192.168.100.250 |
208 | annotations: |
209 | "gui-x": "500" |
210 | "gui-y": "0" |
211 | - to: 'lxc:plumgrid-director=0' |
212 | + to: 'lxc:controller-node=0' |
213 | neutron-api-plumgrid: |
214 | branch: lp:~bbaqar/charms/trusty/neutron-api-plumgrid/liberty |
215 | options: |
216 | - install_sources: "deb http://37.48.126.173/ build413b18/" |
217 | enable-metadata: True |
218 | annotations: |
219 | "gui-x": "750" |
220 | @@ -118,15 +147,14 @@ |
221 | plumgrid-director: |
222 | branch: lp:~bbaqar/charms/trusty/plumgrid-director/liberty |
223 | num_units: 1 |
224 | - options: |
225 | - install_sources: "deb http://37.48.126.173/ build413b18/" |
226 | - plumgrid-virtual-ip: 192.168.100.250 |
227 | annotations: |
228 | "gui-x": "0" |
229 | "gui-y": "500" |
230 | + to: |
231 | + - "controller-node=0" |
232 | nova-compute: |
233 | - charm: cs:trusty/nova-compute |
234 | - num_units: 1 |
235 | + charm: cs:trusty/nova-compute-36 |
236 | + num_units: 2 |
237 | options: |
238 | enable-live-migration: true |
239 | enable-resize: true |
240 | @@ -137,19 +165,45 @@ |
241 | annotations: |
242 | "gui-x": "250" |
243 | "gui-y": "250" |
244 | - to: '0' |
245 | + to: |
246 | + - "compute-node=0" |
247 | + - "compute-node=1" |
248 | plumgrid-edge: |
249 | branch: lp:~bbaqar/charms/trusty/plumgrid-edge/liberty |
250 | - options: |
251 | - install_sources: "deb http://37.48.126.173/ build413b18/" |
252 | annotations: |
253 | "gui-x": "500" |
254 | "gui-y": "500" |
255 | plumgrid-gateway: |
256 | branch: lp:~bbaqar/charms/trusty/plumgrid-gateway/liberty |
257 | num_units: 1 |
258 | - options: |
259 | - install_sources: "deb http://37.48.126.173/ build413b18/" |
260 | annotations: |
261 | "gui-x": "-500" |
262 | "gui-y": "500" |
263 | + to: |
264 | + - "gateway-node=0" |
265 | + |
266 | +plumgrid-liberty: |
267 | + inherits: plumgrid-ons-phase2 |
268 | + overrides: |
269 | + plumgrid-virtual-ip: 192.168.100.250 |
270 | + #plumgrid-license-key: "ENTER KEY CONTENT HERE" |
271 | + |
272 | + # Provide apt repository for PLUMgrid packages |
273 | + install_sources: "deb http://37.48.126.173/ build413b18/" |
274 | + |
275 | + # Use this value if pulling packages from LCM |
276 | + #install_sources: | |
277 | + # - "deb http://192.168.100.5:81/plumgrid plumgrid fuji-413" |
278 | + # - "deb http://192.168.100.5:81/plumgrid-images plumgrid fuji-413" |
279 | + |
280 | + #plumgrid-build: |
281 | + #iovisor-build: |
282 | + |
283 | + # Interfaces on gateway node for external connectivity |
284 | + #external-interfaces: '{"node2":"eth2"}' |
285 | + |
286 | + # Uncomment for seperate fabric/data network |
287 | + # Interfaces on all PLUMgrid nodes connected to fabric/data network |
288 | + #fabric-interfaces: '{"DEFAULT":"eth1"}' |
289 | + # Fabric/data network |
290 | + #os-data-network: "192.168.102.0/24" |
291 | |
292 | === added file 'setup_lcm.sh' |
293 | --- setup_lcm.sh 1970-01-01 00:00:00 +0000 |
294 | +++ setup_lcm.sh 2016-02-10 16:35:43 +0000 |
295 | @@ -0,0 +1,118 @@ |
296 | +#!/bin/bash |
297 | +set -e |
298 | + |
299 | +if [ "$EUID" -ne 0 ] |
300 | + then echo "Please run script with sudo" |
301 | + exit |
302 | +fi |
303 | + |
304 | +function usage() { |
305 | + cat <<DELIM__ |
306 | +usage: $(basename $0) [options] |
307 | + |
308 | +Options: |
309 | + --clobber Will clear stored configurations and do a fresh run |
310 | +DELIM__ |
311 | +} |
312 | + |
313 | +TEMP=$(getopt -o c --long ,clobber -- "$@") |
314 | +if [[ $? -ne 0 ]]; then |
315 | + usage |
316 | + exit 1 |
317 | +fi |
318 | + |
319 | +eval set -- "$TEMP" |
320 | + |
321 | +while true; do |
322 | + case "$1" in |
323 | + --clobber) clobber=1; shift ;; |
324 | + --) shift; break ;; |
325 | + *) usage; exit 1 |
326 | + ;; |
327 | + esac |
328 | +done |
329 | + |
330 | +mkdir -p $HOME/.pginstall |
331 | + |
332 | +function read_raw() { |
333 | + eval "local=\$${2}" |
334 | + if [[ -n "$local" && "$local" =~ $3 ]]; then |
335 | + ## the value stored in the destination variable is already OK |
336 | + echo "Using provided value [${local}] for: $1" |
337 | + return 0 |
338 | + fi |
339 | + |
340 | + if [[ $# -eq 5 ]]; then |
341 | + echo -n "${1} (default [${5}])" |
342 | + dfl="$5" |
343 | + else |
344 | + echo -n "${1}" |
345 | + dfl="" |
346 | + fi |
347 | + |
348 | + while true; do |
349 | + local="" |
350 | + echo -n ": " |
351 | + read local |
352 | + [[ $local == "" ]] && local="$dfl" |
353 | + if [[ "$local" =~ $3 ]]; then |
354 | + break |
355 | + fi |
356 | + echo " Please try again. [${local}] is not a valid value: $4" |
357 | + done |
358 | + eval $2="\"$local\"" |
359 | +} |
360 | + |
361 | +function read_nonempty() { |
362 | + if [[ $# -eq 3 ]]; then |
363 | + read_raw "$1" "$2" "[^ ]+" "must be non-empty" "$3" |
364 | + else |
365 | + read_raw "$1" "$2" "[^ ]+" "must be non-empty" |
366 | + fi |
367 | +} |
368 | + |
369 | +function read_alnum() { |
370 | + if [[ $# -eq 3 ]]; then |
371 | + read_raw "$1" "$2" "^[0-9a-zA-Z]+$" "must use alphanumeric characters only" "$3" |
372 | + else |
373 | + read_raw "$1" "$2" "^[0-9a-zA-Z]+$" "must use alphanumeric characters only" |
374 | + fi |
375 | +} |
376 | + |
377 | +function read_url() { |
378 | + read_raw "$1" "$2" "^(ftp|http|https)://[^ ]+" "invalid schema (e.g. http://IP)" |
379 | +} |
380 | + |
381 | +function write_default_file() { |
382 | + cat > $HOME/.pginstall/config <<DELIM__ |
383 | +MAAS_CONTROLLER_REGION_ADMIN_USERNAME="${MAAS_CONTROLLER_REGION_ADMIN_USERNAME}" |
384 | +plumgrid_repo_url="${plumgrid_repo_url}" |
385 | +lvm_keypath_content="${lvm_keypath_content}" |
386 | +zone_name="${zone_name}" |
387 | +DELIM__ |
388 | + return 0 |
389 | +} |
390 | + |
391 | +function lcm_key_check() { |
392 | + zone_name_=${zone_name} |
393 | + while true; do |
394 | + zone_name="${zone_name_}" |
395 | + read_alnum 'Enter LCM Canonical zone name' zone_name |
396 | + read_url "Enter LCM repository base url" plumgrid_repo_url |
397 | + echo -n "Checking ssh key on LCM for your deployment..." |
398 | + ret=$(curl -Lks ${plumgrid_repo_url}/files/ssh_keys/zones/$zone_name/id_rsa.pub -o /tmp/id_rsa.pub -w '%{http_code}' || true) |
399 | + [ $ret -eq 200 ] && break |
400 | + echo "Unable to get ssh key from LCM for your deployment." |
401 | + echo "Check zone name or retry after running canonical-pg-refresh.sh --key-only script on LCM and make sure your deployment shows up." |
402 | + zone_name_="" |
403 | + done |
404 | + echo "OK" |
405 | + mkdir -p /var/lib/plumgrid/zones/$zone_name |
406 | + mv /tmp/id_rsa.pub /var/lib/plumgrid/zones/$zone_name/id_rsa.pub |
407 | + lvm_keypath_content="/var/lib/plumgrid/zones/${zone_name}/id_rsa.pub" |
408 | +} |
409 | + |
410 | +[[ -r $HOME/.pginstall/config && $clobber != 1 ]] && . $HOME/.pginstall/config |
411 | +read_nonempty "Username of MAAS Region Admin User" MAAS_CONTROLLER_REGION_ADMIN_USERNAME "root" |
412 | +lcm_key_check |
413 | +write_default_file |