Merge lp:~cpe-sa/sademos/16.04-nc-lxd-fix-20160506-1 into lp:sademos/16.04

Proposed by Michael Iatrou
Status: Approved
Approved by: Scott Croft
Approved revision: 95
Proposed branch: lp:~cpe-sa/sademos/16.04-nc-lxd-fix-20160506-1
Merge into: lp:sademos/16.04
Diff against target: 147 lines (+32/-33)
3 files modified
openstack/nclxd/configure-openstack (+29/-30)
openstack/nclxd/nclxd.yaml (+2/-2)
openstack/openstack-liberty.yaml (+1/-1)
To merge this branch: bzr merge lp:~cpe-sa/sademos/16.04-nc-lxd-fix-20160506-1
Reviewer Review Type Date Requested Status
Scott Croft (community) Approve
Review via email: mp+294059@code.launchpad.net

Description of the change

This is a superset of fixes for NC-LXD that have appeared during the preparation for ODS.

- Enables ZFS for NC-LXD
- Fixes LXD networking (the instances can now be accessed from the OB and have outbound connectivity)
- Cleanup of the OpenStack configuration script

Thanks to Massimo Morana for the initial patch set, Omar Lara for troubleshooting the LXD networking and Francisco Hernandez for sharing his OB for testing.

To post a comment you must log in.
Revision history for this message
Nicolas Thomas (thomnico) wrote :

Big +1 for me .. worked without any tricks .. could deploy on it good job

Revision history for this message
Scott Croft (secroft) :
review: Approve

Unmerged revisions

95. By Michael Iatrou

Fix NC-LXD demo

94. By Michael Iatrou

Fix OpenStack Liberty bundle (keystone)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openstack/nclxd/configure-openstack'
2--- openstack/nclxd/configure-openstack 2016-04-22 01:26:27 +0000
3+++ openstack/nclxd/configure-openstack 2016-05-06 23:33:11 +0000
4@@ -21,23 +21,22 @@
5
6 echo "This command is run to configure an Orange-Box Openstack deployment"
7
8-obnum=`hostname | cut -c 10- -`
9-external_net=`expr ${obnum} + 1`
10+obnum=$(hostname | cut -c 10- -)
11+external_net=$((obnum+3))
12
13-#QUANTUM_EXT_NET_GW="172.27.${external_net}.254"
14-QUANTUM_EXT_NET_GW="172.27.${obnum}.1"
15-QUANTUM_EXT_NET_CIDR="172.27.${obnum}.0/23"
16-QUANTUM_EXT_NET_NAME="ext_net"
17-QUANTUM_DNS="172.27.${obnum}.1"
18+QUANTUM_EXT_NET_GW="172.27.${external_net}.254"
19+#QUANTUM_EXT_NET_GW="172.27.${obnum}.1"
20+QUANTUM_EXT_NET_CIDR="172.27.${external_net}.0/23"
21+#QUANTUM_EXT_NET_NAME="ext_net" # Unused
22+QUANTUM_DNS="172.27.$((obnum+2)).1"
23 QUANTUM_FLOAT_RANGE_START="172.27.${external_net}.200"
24 QUANTUM_FLOAT_RANGE_END="172.27.${external_net}.253"
25
26 QUANTUM_FIXED_NET_CIDR="192.168.14.0/22"
27-QUANTUM_FIXED_NET_NAME="admin_net"
28+#QUANTUM_FIXED_NET_NAME="admin_net" # Unused
29
30 #keystone=$(juju status keystone | grep public-address | head -1 | awk '{print $2}')
31-keystone1=$(juju status keystone |grep Unit|awk '{print $6}')
32-keystone=`echo $keystone1||tr '\n' ' '`
33+keystone=$(juju status keystone | grep Unit | awk '{print $6}' | tr -d '\n')
34
35 echo "export SERVICE_ENDPOINT=http://$keystone:35357/v2.0/
36 export SERVICE_TOKEN=admin
37@@ -51,7 +50,7 @@
38 source ~/nova.rc
39
40 # Determine the tenant id for the configured tenant name.
41-export TENANT_ID="$(keystone tenant-list | grep $OS_TENANT_NAME | awk '{ print $2 }')"
42+export TENANT_ID="$(keystone tenant-list | grep "$OS_TENANT_NAME" | awk '{ print $2 }')"
43
44 if [ "$TENANT_ID" = "" ]; then
45 echo "Unable to find tenant ID, keystone auth problem"
46@@ -61,33 +60,33 @@
47 echo "Configuring Openstack Neutron Networking"
48
49 #create ext network with neutron for floating IPs
50-neutron net-show ext_net > /dev/null 2>&1 || neutron net-create ext_net --tenant-id $TENANT_ID -- --router:external=True
51+neutron net-show ext_net > /dev/null 2>&1 || neutron net-create ext_net --tenant-id "$TENANT_ID" -- --router:external=True
52 EXTERNAL_NETWORK_ID=$(neutron net-show ext_net | grep " id" | awk '{print $4}')
53-neutron subnet-show ext_net_subnet > /dev/null 2>&1 || neutron subnet-create ext_net $QUANTUM_EXT_NET_CIDR --name ext_net_subnet --tenant-id $TENANT_ID \
54---allocation-pool start=$QUANTUM_FLOAT_RANGE_START,end=$QUANTUM_FLOAT_RANGE_END \
55---gateway $QUANTUM_EXT_NET_GW --disable-dhcp --dns_nameservers $QUANTUM_DNS list=true
56+neutron subnet-show ext_net_subnet > /dev/null 2>&1 || neutron subnet-create ext_net "$QUANTUM_EXT_NET_CIDR" --name ext_net_subnet --tenant-id "$TENANT_ID" \
57+--allocation-pool start="$QUANTUM_FLOAT_RANGE_START",end="$QUANTUM_FLOAT_RANGE_END" \
58+--gateway "$QUANTUM_EXT_NET_GW" --disable-dhcp --dns_nameservers "$QUANTUM_DNS" list=true
59
60 #Create private network for neutron for tenant VMs
61 neutron net-show private > /dev/null 2>&1 || neutron net-create private
62-neutron subnet-show private_subnet > /dev/null 2>&1 || neutron subnet-create private $QUANTUM_FIXED_NET_CIDR -- --name private_subnet --dns_nameservers list=true $QUANTUM_DNS
63+neutron subnet-show private_subnet > /dev/null 2>&1 || neutron subnet-create private "$QUANTUM_FIXED_NET_CIDR" -- --name private_subnet --dns_nameservers list=true "$QUANTUM_DNS"
64 SUBNET_ID=$(neutron subnet-show private_subnet | grep " id" | awk '{print $4}')
65
66 #creating private network router
67
68
69 #Create router for external network and private network
70-neutron router-show cloud-router > /dev/null 2>&1 || neutron router-create --tenant-id $TENANT_ID cloud-router
71+neutron router-show cloud-router > /dev/null 2>&1 || neutron router-create --tenant-id "$TENANT_ID" cloud-router
72 ROUTER_ID=$(neutron router-show cloud-router | grep " id" | awk '{print $4}')
73
74-PORT_ID=$(neutron port-list | grep $SUBNET_ID | awk '{print $2}')
75+#PORT_ID=$(neutron port-list | grep "$SUBNET_ID" | awk '{print $2}') # Unused
76
77 #if [ "$PORT_ID" != "" ]; then
78 # neutron router-interface-delete $ROUTER_ID port=$PORT_ID
79 #fi
80-neutron router-interface-add $ROUTER_ID $SUBNET_ID
81+neutron router-interface-add "$ROUTER_ID" "$SUBNET_ID"
82
83 neutron router-gateway-clear cloud-router
84-neutron router-gateway-set $ROUTER_ID $EXTERNAL_NETWORK_ID
85+neutron router-gateway-set "$ROUTER_ID" "$EXTERNAL_NETWORK_ID"
86
87 echo "Configuring security groups for access to ICMP, SSH and RDP by default"
88
89@@ -117,19 +116,19 @@
90 nova flavor-create --is-public true m1.large auto 3072 10 2 > /dev/null 2>&1
91 nova flavor-create --is-public true m1.xlarge auto 4096 10 2 > /dev/null 2>&1
92
93-echo "modifying default quotas for admin user"
94+echo "Modifying default quotas for admin user"
95
96 #Modify quotas for the tenant to allow large deployments
97-nova quota-update --instances -1 $TENANT_ID
98-nova quota-update --cores -1 $TENANT_ID
99-nova quota-update --ram -1 $TENANT_ID
100-nova quota-update --security-groups -1 $TENANT_ID
101-nova quota-update --fixed-ips -1 $TENANT_ID
102-nova quota-update --security-group-rules -1 $TENANT_ID
103-nova quota-update --security-groups -1 $TENANT_ID
104-nova quota-update --floating-ips -1 $TENANT_ID
105+nova quota-update --instances -1 "$TENANT_ID"
106+nova quota-update --cores -1 "$TENANT_ID"
107+nova quota-update --ram -1 "$TENANT_ID"
108+nova quota-update --security-groups -1 "$TENANT_ID"
109+nova quota-update --fixed-ips -1 "$TENANT_ID"
110+nova quota-update --security-group-rules -1 "$TENANT_ID"
111+nova quota-update --security-groups -1 "$TENANT_ID"
112+nova quota-update --floating-ips -1 "$TENANT_ID"
113
114-echo "Uploading images to glance"
115+#echo "Uploading images to glance"
116
117 #Upload images to glance
118 #glance image-show "Precise x86_64" > /dev/null 2>&1 || glance add name="Precise x86_64" is_public=true container_format=ovf disk_format=qcow2 < /srv/data/precise-server-cloudimg-amd64-disk1.img
119
120=== modified file 'openstack/nclxd/nclxd.yaml'
121--- openstack/nclxd/nclxd.yaml 2016-04-22 00:18:27 +0000
122+++ openstack/nclxd/nclxd.yaml 2016-05-06 23:33:11 +0000
123@@ -13,9 +13,9 @@
124 charm: "cs:xenial/lxd"
125 series: xenial
126 options:
127- "block-device": /dev/sdb
128+ "block-devices": /dev/sdb
129 overwrite: true
130- "storage-type": lvm
131+ "storage-type": zfs
132 annotations:
133 "gui-x": "750"
134 "gui-y": "250"
135
136=== modified file 'openstack/openstack-liberty.yaml'
137--- openstack/openstack-liberty.yaml 2016-04-08 18:03:47 +0000
138+++ openstack/openstack-liberty.yaml 2016-05-06 23:33:11 +0000
139@@ -159,7 +159,7 @@
140 annotations:
141 gui-x: '500'
142 gui-y: '0'
143- charm: cs:trusty/keystone-33
144+ charm: cs:trusty/keystone-254
145 num_units: 1
146 options:
147 admin-password: openstack

Subscribers

People subscribed via source and target branches

to all changes: