blob: 6b190f00bf99829c200a4eaaa763739d5821aed5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
#!/bin/bash
#
# This script can be used to interact with kolla.
if [[ $EUID -ne 0 ]]; then
echo "You must execute this script as root." 1>&2
exit 1
fi
# Move to top level directory
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
cd "$(dirname "$REAL_PATH")/.."
NETWORK_MANAGER=$(grep -sri NETWORK_MANAGER ./compose/openstack.env | cut -f2 -d'=')
if [[ -z "$NETWORK_MANAGER" ]]; then
echo 'No network manager defined in ./compose/openstack.env, defaulting to "neutron".'
NETWORK_MANAGER="neutron"
fi
function process {
local service=$1
echo "$ACTION $service"
docker-compose -f ./compose/${service}.yml $COMPOSE_CMD
}
function process_all {
process rabbitmq
process mariadb
process keystone
process glance-api-registry
process nova-api-conductor-scheduler
if [[ "${NETWORK_MANAGER}" == "nova" ]] ; then
process nova-compute-network
else
# Defaulting to neutron
process nova-compute
process neutron-server
process neutron-agents
fi
process heat-api-engine
process horizon
}
function check_selinux {
# Check for SELinux in Enforcing mode and exit if found
if [[ -x /usr/sbin/getenforce ]]; then
if [[ $(/usr/sbin/getenforce) == "Enforcing" ]]; then
echo "You must execute this script without SELinux enforcing mode."
echo "Turn off SELinux enforcing mode by running:"
echo "$ sudo setenforce permissive"
exit 1
fi
fi
}
function pre_start {
check_selinux
if [[ -r ./openrc ]]; then
# Source openrc for commands
source ./openrc
else
echo 'Could not find ./openrc; bootstrap your environment with "./tools/genenv".'
exit 1
fi
}
function post_start {
IMAGE_URL=http://download.cirros-cloud.net/0.3.3/
IMAGE=cirros-0.3.3-x86_64-disk.img
if ! [ -f "$IMAGE" ]; then
curl -L -o ./$IMAGE $IMAGE_URL/$IMAGE
fi
until keystone user-list | grep glance
do
echo "Waiting for OpenStack services to become available"
sleep 2
done
sleep 3
echo Example Usage:
echo source openrc # source keystone credentials
echo Configure your environment once by running:
echo tools/conf-novanet # configure OpenStack with Nova Networking
}
function usage {
cat <<EOF
Usage: $0 COMMAND
Commands:
pull Pull all of the Docker images
start Start all kolla containers
status List running kolla containers
stop Stop all kolla containers
EOF
}
case "$1" in
(pull)
ACTION="Pulling"
COMPOSE_CMD="pull"
process_all
;;
(start)
ACTION="Starting"
COMPOSE_CMD="up -d"
pre_start
process_all
post_start
;;
(status)
ACTION="Status of"
COMPOSE_CMD="ps"
process_all
;;
(stop)
ACTION="Stopping"
COMPOSE_CMD="stop"
process_all
;;
(*) usage
exit 0
;;
esac
|