Merge ~rodrigo-barbieri2010/stsstack-bundles:openstack-on-lxd into stsstack-bundles:master

Proposed by Rodrigo Barbieri
Status: Rejected
Rejected by: Edward Hope-Morley
Proposed branch: ~rodrigo-barbieri2010/stsstack-bundles:openstack-on-lxd
Merge into: stsstack-bundles:master
Diff against target: 104 lines (+86/-0)
3 files modified
openstack-on-lxd/1_prepare.sh (+25/-0)
openstack-on-lxd/2_configure.sh (+31/-0)
openstack-on-lxd/README (+30/-0)
Reviewer Review Type Date Requested Status
Edward Hope-Morley Disapprove
Review via email: mp+387898@code.launchpad.net
To post a comment you must log in.
8233f8f... by Rodrigo Barbieri

Add scripts for easily set up of openstack-on-lxd

Adding new scripts that help getting openstack-on-lxd
easily set up either on a baremetal or a VM.

Please refer to the README for more details.

Revision history for this message
Edward Hope-Morley (hopem) wrote :

Does this belong in stsstack-bundles? It isn't using any of the stsstack-bundles functionality and is using upstream bundles as opposed to generating them like the other modules.

Revision history for this message
Edward Hope-Morley (hopem) :
review: Disapprove
Revision history for this message
Edward Hope-Morley (hopem) wrote :

The repository has moved to https://github.com/canonical/stsstack-bundles/. Please resubmit there if you are still working on this patch.

Unmerged commits

8233f8f... by Rodrigo Barbieri

Add scripts for easily set up of openstack-on-lxd

Adding new scripts that help getting openstack-on-lxd
easily set up either on a baremetal or a VM.

Please refer to the README for more details.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/openstack-on-lxd/1_prepare.sh b/openstack-on-lxd/1_prepare.sh
2new file mode 100755
3index 0000000..92432fb
4--- /dev/null
5+++ b/openstack-on-lxd/1_prepare.sh
6@@ -0,0 +1,25 @@
7+#!/bin/bash
8+set -xe
9+sudo snap install juju --classic
10+sudo snap install openstackclients --classic
11+sudo snap install lxd
12+sudo apt purge -y liblxc1 lxcfs lxd lxd-client
13+git clone https://github.com/openstack-charmers/openstack-on-lxd.git ~/openstack-on-lxd
14+echo fs.inotify.max_queued_events=1048576 | sudo tee -a /etc/sysctl.conf
15+echo fs.inotify.max_user_instances=1048576 | sudo tee -a /etc/sysctl.conf
16+echo fs.inotify.max_user_watches=1048576 | sudo tee -a /etc/sysctl.conf
17+echo vm.max_map_count=262144 | sudo tee -a /etc/sysctl.conf
18+echo vm.swappiness=1 | sudo tee -a /etc/sysctl.conf
19+sudo sysctl -p
20+lxd init --auto
21+lxc network set lxdbr0 ipv4.address 10.0.8.1/24
22+lxc network set lxdbr0 ipv4.dhcp.ranges 10.0.8.2-10.0.8.200
23+lxc network set lxdbr0 bridge.mtu 9000
24+lxc network unset lxdbr0 ipv6.address
25+lxc network unset lxdbr0 ipv6.nat
26+juju bootstrap localhost lxd
27+cd ~/openstack-on-lxd
28+cat lxd-profile.yaml | lxc profile edit juju-default
29+echo "Choose your deployment and run: juju deploy ~/openstack-on-lxd/<bundle>.yaml"
30+ls ~/openstack-on-lxd
31+
32diff --git a/openstack-on-lxd/2_configure.sh b/openstack-on-lxd/2_configure.sh
33new file mode 100755
34index 0000000..e15827c
35--- /dev/null
36+++ b/openstack-on-lxd/2_configure.sh
37@@ -0,0 +1,31 @@
38+#!/bin/bash
39+set -xe
40+cd ~/openstack-on-lxd
41+set +e
42+source openrc
43+set -e
44+openstack catalog list
45+juju run-action --wait ceilometer/0 ceilometer-upgrade
46+curl http://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img | \
47+ openstack image create --public --container-format=bare --disk-format=qcow2 \
48+ bionic-amd64
49+wget https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
50+openstack image create --public --file cirros-0.4.0-x86_64-disk.img cirros
51+rm cirros-0.4.0-x86_64-disk.img
52+openstack network create ext_net --external --share --default \
53+ --provider-network-type flat --provider-physical-network physnet1
54+openstack subnet create ext_subnet --allocation-pool start=10.0.8.201,end=10.0.8.254 \
55+ --subnet-range 10.0.8.0/24 --no-dhcp --gateway 10.0.8.1 --network ext_net
56+openstack network create int_net --internal
57+openstack subnet create int_subnet \
58+ --allocation-pool start=192.168.20.10,end=192.168.20.99 \
59+ --subnet-range 192.168.20.0/24 \
60+ --gateway 192.168.20.1 --dns-nameserver 10.0.8.1 \
61+ --network int_net
62+openstack router create router1
63+openstack router add subnet router1 int_subnet
64+openstack router set router1 --external-gateway ext_net
65+openstack flavor create --public --id 1 --ram 64 --disk 1 --ephemeral 0 --vcpus 1 m1.tiny
66+openstack flavor create --public --id 2 --ram 2048 --disk 20 --vcpus 1 m1.small
67+echo "Start using the cloud by sourcing ~/openstack-on-lxd/openrc"
68+
69diff --git a/openstack-on-lxd/README b/openstack-on-lxd/README
70new file mode 100644
71index 0000000..cb1122b
72--- /dev/null
73+++ b/openstack-on-lxd/README
74@@ -0,0 +1,30 @@
75+This collection of scripts provides an almost one-liner alternative
76+to deploy openstack-on-lxd for your convenience.
77+
78+For more information, refer to openstack-on-lxd documentation
79+at [1].
80+
81+How to use
82+----------
83+
84+Download this set of scripts to the node where you intend to install
85+openstack-on-lxd. It can be a 16GB VM in sts-stack or a bare-metal
86+machine from the MaaS cluster.
87+
88+Run "1_prepare.sh".
89+
90+Then, choose your deployment from the ones included in the
91+openstack-on-lxd folder and deploy it using
92+"juju deploy ~/openstack-on-lxd/<bundle>.yaml".
93+
94+Monitor the deployment using "juju status".
95+
96+Finally, when all units are idle (except for ceilometer, which
97+should be blocked waiting for 'ceilometer-upgrade' action),
98+run "2_configure.sh". At the end of this script you should be
99+all set to use the cloud.
100+
101+
102+[1] https://docs.openstack.org/charm-guide/latest/openstack-on-lxd.html
103+
104+

Subscribers

People subscribed via source and target branches