Skip to content

Commit 5cdea12

Browse files
author
Deepinder Setia
committed
Merge pull request #16 from noelbk/contrail
Fix nova 401 and redis
2 parents 7d91a47 + 32e8e45 commit 5cdea12

7 files changed

Lines changed: 81 additions & 6 deletions

File tree

contrail/localrc-multinode-compute

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
HOST_IP=172.18.4.10 # publicly routable ip to me
2+
13
# change this to your master node's ip
2-
SERVICE_HOST=172.18.3.6
4+
SERVICE_HOST=172.18.4.18 # contrail0
5+
6+
# allow floating ips from 172.18.4.240 to 172.18.4.255
7+
CONTRAIL_VGW_INTERFACE=vgw
8+
CONTRAIL_VGW_PUBLIC_SUBNET=172.18.4.240/28 # .240 to .255
9+
CONTRAIL_VGW_PUBLIC_NETWORK=default-domain:admin:public:public
310

411
# the interface that contrail's vhost0 should take over
512
PHYSICAL_INTERFACE=eth0

contrail/localrc-multinode-server

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# CONTRAIL MULTI_NODE master
2+
HOST_IP=192.168.122.251
3+
4+
# allow floating ips from 192.168.122.240 to 192.168.122.255
5+
CONTRAIL_VGW_INTERFACE=vgw
6+
CONTRAIL_VGW_PUBLIC_SUBNET=192.168.122.240/28 # .240 to .255
7+
CONTRAIL_VGW_PUBLIC_NETWORK=default-domain:admin:public:public
28

39
ENABLE_CONTRAIL=yes
410
PHYSICAL_INTERFACE=eth0
@@ -8,19 +14,23 @@ Q_PLUGIN=contrail
814

915
STACK_DIR=$(cd $(dirname $0) && pwd)
1016

17+
# log all screen output to this directory
18+
SCREEN_LOGDIR=$STACK_DIR/log/screens
1119
LOG=True
1220
DEBUG=True
1321
LOGFILE=$STACK_DIR/log/stack.log
1422
LOGDAYS=1
1523

1624
disable_service n-net
1725
enable_service q-svc
18-
enable_service q-agt
1926
enable_service q-dhcp
20-
enable_service q-l3
2127
enable_service q-meta
2228
enable_service neutron
2329
enable_service rabbit
30+
31+
# not used by contrail
32+
disable_service q-l3
33+
disable_service q-agt
2434
enable_service contrail
2535

2636
DATABASE_PASSWORD=contrail123

contrail/redis.conf.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--- /etc/redis/redis.conf 2011-07-27 17:26:50.000000000 +0000
2+
+++ redis.conf 2013-11-19 19:28:06.266187000 +0000
3+
@@ -14,7 +14,7 @@
4+
5+
# By default Redis does not run as a daemon. Use 'yes' if you need it.
6+
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
7+
-daemonize yes
8+
+#daemonize yes
9+
10+
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
11+
# default. You can specify a custom pid file location here.
12+
@@ -22,7 +22,8 @@
13+
14+
# Accept connections on the specified port, default is 6379.
15+
# If port 0 is specified Redis will not listen on a TCP socket.
16+
-port 6379
17+
+# contrail uses redis on 6382
18+
+port 6382
19+
20+
# If you want you can bind a single interface, if the bind option is not
21+
# specified all the interfaces will listen for incoming connections.

functions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function apt_get() {
6363
$sudo DEBIAN_FRONTEND=noninteractive \
6464
http_proxy=$http_proxy https_proxy=$https_proxy \
6565
no_proxy=$no_proxy \
66-
apt-get --option "Dpkg::Options::=--force-confold" --assume-yes "$@"
66+
apt-get --option "Dpkg::Options::=--force-confold" --force-yes --assume-yes "$@"
6767
}
6868

6969

lib/keystone

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,18 @@ function init_keystone() {
333333
sudo chown $STACK_USER $KEYSTONE_AUTH_CACHE_DIR
334334
rm -f $KEYSTONE_AUTH_CACHE_DIR/*
335335
fi
336+
337+
# Nova always speaks HTTPS, so keystone needs SSL certs
338+
if [ ${KEYSTONE_SERVICE_PROTOCOL} == 'https' ]; then
339+
$KEYSTONE_DIR/bin/keystone-manage ssl_setup
340+
iniset $KEYSTONE_CONF ssl enable True
341+
iniset $KEYSTONE_CONF ssl certfile ${KEYSTONE_CONF_DIR}/ssl/certs/keystone.pem
342+
iniset $KEYSTONE_CONF ssl keyfile ${KEYSTONE_CONF_DIR}/ssl/private/keystonekey.pem
343+
iniset $KEYSTONE_CONF ssl ca_certs ${KEYSTONE_CONF_DIR}/ssl/certs/ca.pem
344+
iniset $KEYSTONE_CONF ssl ca_key ${KEYSTONE_CONF_DIR}/ssl/private/cakey.pem
345+
else
346+
iniset $KEYSTONE_CONF ssl enable False
347+
fi
336348
}
337349

338350
# install_keystoneclient() - Collect source and prepare
@@ -372,7 +384,7 @@ function start_keystone() {
372384
fi
373385

374386
echo "Waiting for keystone to start..."
375-
if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= curl -s http://$SERVICE_HOST:$service_port/v$IDENTITY_API_VERSION/ >/dev/null; do sleep 1; done"; then
387+
if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= curl -k -s ${KEYSTONE_SERVICE_PROTOCOL}://$SERVICE_HOST:$service_port/v$IDENTITY_API_VERSION/ >/dev/null; do sleep 1; done"; then
376388
die $LINENO "keystone did not start"
377389
fi
378390

lib/neutron_thirdparty/contrail

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,17 @@ function start_contrail() {
282282
# Set a reasonable status bar
283283
screen -r $SCREEN_NAME -X hardstatus alwayslastline "$SCREEN_HARDSTATUS"
284284

285+
# redis: rebuild /etc/contrail/redis.conf to listen on port 6382
286+
rm -f /etc/contrail/redis.conf
287+
for f in /etc/redis.conf /etc/redis/redis.conf; do
288+
if [ -e $f ]; then
289+
cp -f $f /etc/contrail/redis.conf
290+
fi
291+
done
292+
patch -p0 -N -r - -d /etc/contrail < $TOP_DIR/contrail/redis.conf.patch
293+
285294
# launch ...
286-
screen_it redis "sudo redis-server /etc/redis.conf"
295+
screen_it redis "sudo redis-server /etc/contrail/redis.conf"
287296
screen_it cass "sudo /usr/sbin/cassandra -f"
288297
screen_it zk "cd $CONTRAIL_SRC/third_party/zookeeper-3.4.5; ./bin/zkServer.sh start"
289298
screen_it ifmap "cd $CONTRAIL_SRC/third_party/irond-0.3.0-bin; java -jar ./irond.jar"

lib/nova

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,22 @@ function create_nova_conf() {
566566
iniset $NOVA_CONF DEFAULT ec2_dmz_host "$EC2_DMZ_HOST"
567567
iniset_rpc_backend nova $NOVA_CONF DEFAULT
568568
iniset $NOVA_CONF DEFAULT glance_api_servers "$GLANCE_HOSTPORT"
569+
570+
# [keystone_authtoken]
571+
# Host providing the admin Identity API endpoint
572+
iniset $NOVA_CONF keystone_authtoken auth_host $KEYSTONE_SERVICE_HOST
573+
# Port of the admin Identity API endpoint
574+
iniset $NOVA_CONF keystone_authtoken auth_port $KEYSTONE_SERVICE_PORT
575+
# Protocol of the admin Identity API endpoint
576+
iniset $NOVA_CONF keystone_authtoken auth_protocol $KEYSTONE_SERVICE_PROTOCOL
577+
# Keystone service account tenant name to validate user tokens
578+
iniset $NOVA_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
579+
# Keystone account username
580+
iniset $NOVA_CONF keystone_authtoken admin_user nova
581+
# Keystone account password
582+
iniset $NOVA_CONF keystone_authtoken admin_password $ADMIN_PASSWORD
583+
iniset $NOVA_CONF keystone_authtoken auth_version v2.0
584+
569585
}
570586

571587
function init_nova_cells() {

0 commit comments

Comments
 (0)