Update start.sh
Clean up start.sh and make more functional Change-Id: If9cb8a6a621991a28cf9b95c4fd0e5b7e780272a
This commit is contained in:
parent
ac930b33dd
commit
b8a67110c7
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash -x
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# This script can be used to start a minimal set of containers that allows
|
# This script can be used to start a minimal set of containers that allows
|
||||||
# you to boot an instance. Note that it requires that you have some openstack
|
# you to boot an instance. Note that it requires that you have some openstack
|
||||||
@ -6,9 +6,16 @@
|
|||||||
# services are up. You will also need these in order to interact with the
|
# services are up. You will also need these in order to interact with the
|
||||||
# installation once started.
|
# installation once started.
|
||||||
|
|
||||||
setenforce 0
|
# Set SELinux to permissive
|
||||||
|
setenforce permissive
|
||||||
|
|
||||||
|
# This directory is shared with the host to allow qemu instance
|
||||||
|
# configs to remain accross restarts. This is needed in the event libvirt
|
||||||
|
# is not installed in the system.
|
||||||
|
mkdir -p /etc/libvirt/qemu
|
||||||
|
|
||||||
# This should probably go into nova-networking or nova-compute containers.
|
# This should probably go into nova-networking or nova-compute containers.
|
||||||
|
# but you can't modprobe from a container for some reason
|
||||||
modprobe ebtables
|
modprobe ebtables
|
||||||
|
|
||||||
MY_IP=$(ip route get $(ip route | awk '$1 == "default" {print $3}') |
|
MY_IP=$(ip route get $(ip route | awk '$1 == "default" {print $3}') |
|
||||||
@ -17,52 +24,22 @@ MY_IP=$(ip route get $(ip route | awk '$1 == "default" {print $3}') |
|
|||||||
# Source openrc for commands
|
# Source openrc for commands
|
||||||
source openrc
|
source openrc
|
||||||
|
|
||||||
echo Starting rabbitmq and mariadb
|
echo Starting rabbitmq.
|
||||||
docker-compose -f rabbitmq.yml up -d
|
docker-compose -f rabbitmq.yml up -d
|
||||||
|
|
||||||
|
echo Starting mariadb.
|
||||||
docker-compose -f mariadb.yml up -d
|
docker-compose -f mariadb.yml up -d
|
||||||
|
|
||||||
until mysql -u root --password=kolla --host=$MY_IP mysql -e "show tables;"
|
echo Starting keystone.
|
||||||
do
|
|
||||||
echo waiting for mysql..
|
|
||||||
sleep 3
|
|
||||||
done
|
|
||||||
|
|
||||||
echo Starting keystone
|
|
||||||
docker-compose -f keystone.yml up -d
|
docker-compose -f keystone.yml up -d
|
||||||
|
|
||||||
until keystone user-list
|
echo Starting glance.
|
||||||
do
|
|
||||||
echo waiting for keystone..
|
|
||||||
sleep 3
|
|
||||||
done
|
|
||||||
|
|
||||||
echo Starting glance
|
|
||||||
docker-compose -f glance-api-registry.yml up -d
|
docker-compose -f glance-api-registry.yml up -d
|
||||||
|
|
||||||
echo Starting nova
|
echo Starting nova.
|
||||||
docker-compose -f nova-api-conductor-scheduler.yml up -d
|
docker-compose -f nova-api-conductor-scheduler.yml up -d
|
||||||
|
|
||||||
# I think we'll need this..
|
echo Starting nova compute with nova networking.
|
||||||
#
|
|
||||||
# until mysql -u root --password=kolla --host=$MY_IP mysql -e "use nova;"
|
|
||||||
# do
|
|
||||||
# echo waiting for nova db.
|
|
||||||
# sleep 3
|
|
||||||
# done
|
|
||||||
|
|
||||||
echo "Waiting for nova-api to create keystone user.."
|
|
||||||
until keystone user-list | grep nova
|
|
||||||
do
|
|
||||||
echo waiting for keystone nova user
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
# This directory is shared with the host to allow qemu instance
|
|
||||||
# configs to remain accross restarts.
|
|
||||||
mkdir -p /etc/libvirt/qemu
|
|
||||||
|
|
||||||
echo Starting nova compute
|
|
||||||
|
|
||||||
docker-compose -f nova-compute-network.yml up -d
|
docker-compose -f nova-compute-network.yml up -d
|
||||||
|
|
||||||
IMAGE_URL=http://download.cirros-cloud.net/0.3.3/
|
IMAGE_URL=http://download.cirros-cloud.net/0.3.3/
|
||||||
@ -71,15 +48,23 @@ if ! [ -f "$IMAGE" ]; then
|
|||||||
curl -o $IMAGE $IMAGE_URL/$IMAGE
|
curl -o $IMAGE $IMAGE_URL/$IMAGE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating glance image.."
|
until keystone user-list | grep glance
|
||||||
glance image-create --name "puffy_clouds" --is-public true --disk-format qcow2 --container-format bare --file $IMAGE
|
do
|
||||||
|
echo "Waiting for OpenStack services to become available"
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
# Example usage:
|
sleep 3
|
||||||
#
|
|
||||||
# nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
|
echo Creating glance image.
|
||||||
# nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
|
glance image-create --name cirros --is-public false --disk-format qcow2 --container-format bare --file $IMAGE
|
||||||
# nova network-create vmnet --fixed-range-v4=10.0.0.0/24 --bridge=br100 --multi-host=T
|
|
||||||
#
|
echo Example usage:
|
||||||
# nova keypair-add mykey > mykey.pem
|
echo
|
||||||
# chmod 600 mykey.pem
|
echo nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
|
||||||
# nova boot --flavor m1.medium --key_name mykey --image puffy_clouds newInstanceName
|
echo nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
|
||||||
|
echo nova network-create vmnet --fixed-range-v4=10.0.0.0/24 --bridge=br100 --multi-host=T
|
||||||
|
echo
|
||||||
|
echo nova keypair-add mykey > mykey.pem
|
||||||
|
echo chmod 600 mykey.pem
|
||||||
|
echo nova boot --flavor m1.medium --key_name mykey --image cirros kolla_vm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user