5 juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"machines\"][\"$1\"][\"agent-state\"]" 2> /dev/null
10 juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"agent-state\"]" 2> /dev/null
18 export OS_TENANT_NAME=$3
20 export OS_REGION_NAME=$5
26 juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"public-address\"]" 2> /dev/null
31 juju status | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"machine\"]" 2> /dev/null
37 while [ "$(agentState $machine)" != started ]; do
46 while [ "$(agentStateUnit "$service" 0)" != started ]; do
59 spare_cpus=$(($(grep processor /proc/cpuinfo | wc -l) - 5))
60 if [ $spare_cpus -gt 0 ]; then
61 spare_cpus=$(((spare_cpus * 3) / 4))
67 [ $spare_cpus -ne 0 ] && extra_cpus=$((1 + (((spare_cpus - 1) * 3) / 4))) && spare_cpus=$((spare_cpus - extra_cpus))
68 juju add-machine --constraints "cpu-cores=$((1 + extra_cpus)) mem=8G root-disk=20G" --series $DEFAULT_SERIES
70 juju deploy --constraints mem=1G $CHARM_NEUTRON_GATEWAY_DEPLOY_OPTS "${CHARM_NEUTRON_GATEWAY:-quantum-gateway}" neutron-gateway
72 juju deploy --constraints "cpu-cores=$((1 + spare_cpus)) mem=4G root-disk=20G" $CHARM_NOVA_COMPUTE_DEPLOY_OPTS "${CHARM_NOVA_COMPUTE:-nova-compute}"
75 juju scp lxc-network.sh 1:
76 juju run --machine 1 "sudo ./lxc-network.sh"
77 juju deploy --to lxc:1 $CHARM_MYSQL_DEPLOY_OPTS "${CHARM_MYSQL:-mysql}"
78 juju deploy --to lxc:1 $CHARM_RABBITMQ_SERVER_DEPLOY_OPTS "${CHARM_RABBITMQ_SERVER:-rabbitmq-server}"
79 juju deploy --to lxc:1 $CHARM_KEYSTONE_DEPLOY_OPTS "${CHARM_KEYSTONE:-keystone}"
80 juju deploy --to lxc:1 $CHARM_NOVA_CLOUD_CONTROLLER_DEPLOY_OPTS "${CHARM_NOVA_CLOUD_CONTROLLER:-nova-cloud-controller}"
81 juju deploy --to lxc:1 $CHARM_NEUTRON_API_DEPLOY_OPTS "${CHARM_NEUTRON_API:-neutron-api}"
82 juju deploy --to lxc:1 $CHARM_GLANCE_DEPLOY_OPTS "${CHARM_GLANCE:-glance}"
83 juju deploy --to lxc:1 $CHARM_OPENSTACK_DASHBOARD_DEPLOY_OPTS "${CHARM_OPENSTACK_DASHBOARD:-openstack-dashboard}"
85 juju deploy --to lxc:1 $CHARM_ODL_CONTROLLER_DEPLOY_OPTS "${CHARM_ODL_CONTROLLER:-odl-controller}"
86 juju deploy $CHARM_NEUTRON_ODL_DEPLOY_OPTS "${CHARM_NEUTRON_ODL:-neutron-odl}"
88 # relation must be set first
89 # no official way of knowing when this relation hook will fire
90 waitForService mysql keystone
91 juju add-relation keystone mysql
94 waitForService rabbitmq-server nova-cloud-controller glance
95 juju add-relation nova-cloud-controller mysql
96 juju add-relation nova-cloud-controller rabbitmq-server
97 juju add-relation nova-cloud-controller glance
98 juju add-relation nova-cloud-controller keystone
101 waitForService neutron-api
102 juju add-relation neutron-api mysql
103 juju add-relation neutron-api rabbitmq-server
104 juju add-relation neutron-api keystone
105 juju add-relation neutron-api nova-cloud-controller
108 waitForService openstack-dashboard neutron-gateway nova-compute
109 juju add-relation neutron-gateway mysql
110 juju add-relation neutron-gateway:amqp rabbitmq-server:amqp
111 juju add-relation neutron-gateway nova-cloud-controller
112 juju add-relation neutron-gateway neutron-api
113 juju add-relation nova-compute:shared-db mysql:shared-db
114 juju add-relation nova-compute:amqp rabbitmq-server:amqp
115 juju add-relation nova-compute glance
116 juju add-relation nova-compute nova-cloud-controller
117 juju add-relation glance mysql
118 juju add-relation glance keystone
119 juju add-relation openstack-dashboard keystone
123 waitForService odl-controller
124 juju add-relation neutron-api odl-controller
125 juju add-relation neutron-gateway odl-controller
126 juju add-relation nova-compute neutron-odl
127 juju add-relation neutron-odl odl-controller
130 # enable kvm on compute
131 machine=$(unitMachine nova-compute 0)
132 juju scp compute.sh $machine:
133 juju run --machine $machine "sudo ./compute.sh"
135 mkdir -m 0700 -p cloud
136 controller_address=$(unitAddress keystone 0)
137 configOpenrc admin password Admin http://$controller_address:5000/v2.0 RegionOne > cloud/admin-openrc
138 chmod 0600 cloud/admin-openrc
140 machine=$(unitMachine nova-cloud-controller 0)
141 juju scp cloud-setup.sh cloud/admin-openrc ~/.ssh/id_rsa.pub $machine:
142 juju run --machine $machine ./cloud-setup.sh
144 machine=$(unitMachine glance 0)
145 juju scp glance.sh cloud/admin-openrc $machine:
146 juju run --machine $machine ./glance.sh