Skip to content

Commit b097cb1

Browse files
author
Deepinder Setia
committed
1. rename LOGFILE in config files to avoid conflict with stach.sh
2. Enable launch of discovery server 3. cleanup setup file slightly 4. Fix launch of agent as it was failing 5. support unstack.sh which cleans up vhost0 and removes the vrouter module
1 parent 9d458c8 commit b097cb1

5 files changed

Lines changed: 35 additions & 72 deletions

File tree

‎contrail_config_templates.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
HOSTIP=$__contrail_host_ip__
112112
BGP_PORT=$__contrail_bgp_port__
113113
CERT_OPTS=$__contrail_cert_ops__
114-
LOGFILE=$__contrail_logfile__
114+
CONTROL_LOGFILE=$__contrail_logfile__
115115
LOG_LOCAL=$__contrail_log_local__
116116
""")
117117

@@ -125,7 +125,7 @@
125125
DISCOVERY=$__contrail_discovery_ip__
126126
HOSTIP=$__contrail_host_ip__
127127
CERT_OPTS=$__contrail_cert_ops__
128-
LOGFILE=$__contrail_logfile__
128+
DNS_LOGFILE=$__contrail_logfile__
129129
LOG_LOCAL=$__contrail_log_local__
130130
""")
131131

@@ -229,7 +229,7 @@
229229
pname=vnswad
230230
LIBDIR=/usr/lib64
231231
VHOST_CFG=/etc/sysconfig/network-scripts/ifcfg-vhost0
232-
LOGFILE=--log-file=/var/log/contrail/vrouter.log
232+
VROUTER_LOGFILE=--log-file=/var/log/contrail/vrouter.log
233233
COLLECTOR=$__contrail_collector__
234234
$__contrail_dev__
235235
""")

‎setup_contrail.py‎

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _parse_args(self, args_str):
167167
# dsetia
168168
self._args.openstack_ip = self._args.cfgm_ip
169169
self._args.collector_ip = self._args.cfgm_ip
170-
# self._args.discovery_ip = self._args.cfgm_ip
170+
self._args.discovery_ip = self._args.cfgm_ip
171171
self._args.control_ip = self._args.cfgm_ip
172172
self._args.compute_ip = self._args.cfgm_ip
173173
self._args.openstack_mgmt_ip = self._args.cfgm_ip
@@ -756,20 +756,6 @@ def fixup_config_files(self):
756756

757757
self.run_shell("sudo chkconfig network on")
758758
self.run_shell("sudo chkconfig supervisor-vrouter on")
759-
else: # of if dev and dev != 'vhost0'
760-
# allow for updating anything except self-ip/gw and eth-port
761-
self.run_shell("sudo sed 's/COLLECTOR=.*/COLLECTOR=%s/g' /etc/contrail/agent_param > agent_param.new" %(collector_ip))
762-
self.run_shell("sudo mv agent_param.new /etc/contrail/agent_param")
763-
764-
self.run_shell("sudo cp /etc/contrail/agent.conf %s/agent.conf" %(temp_dir_name))
765-
agent_tree = ET.parse('%s/agent.conf' %(temp_dir_name))
766-
agent_root = agent_tree.getroot()
767-
agent_elem = agent_root.find('agent')
768-
self._replace_discovery_server(agent_elem, discovery_ip, ncontrols)
769-
770-
agent_tree = agent_tree.write('%s/agent.conf' %(temp_dir_name))
771-
self.run_shell("sudo cp %s/agent.conf /etc/contrail/agent.conf" %(temp_dir_name))
772-
self.run_shell("sudo rm %s/agent.conf" %(temp_dir_name))
773759
#end if dev and dev != 'vhost0' :
774760

775761
# role == compute && !cfgm
@@ -828,52 +814,6 @@ def do_setup(self):
828814
self.cleanup()
829815
#end do_setup
830816

831-
def run_services(self):
832-
if 'database' in self._args.role:
833-
local("sudo ./contrail_setup_utils/database-server-setup.sh %s" % (self._args.database_listen_ip))
834-
835-
if 'openstack' in self._args.role:
836-
local("sudo ./contrail_setup_utils/keystone-server-setup.sh")
837-
local("sudo ./contrail_setup_utils/glance-server-setup.sh")
838-
local("sudo ./contrail_setup_utils/cinder-server-setup.sh")
839-
local("sudo ./contrail_setup_utils/nova-server-setup.sh")
840-
841-
if 'config' in self._args.role:
842-
openstack_ip = self._args.openstack_ip
843-
quantum_ip = self._args.cfgm_ip
844-
local("sudo ./contrail_setup_utils/config-server-setup.sh")
845-
local("sudo ./contrail_setup_utils/quantum-server-setup.sh")
846-
with settings(host_string = 'root@%s' %(openstack_ip), password = env.password):
847-
put("/opt/contrail/contrail_installer/contrail_setup_utils/setup-quantum-in-keystone.py",
848-
"/root/setup-quantum-in-keystone.py")
849-
quant_args = "--quant_server_ip %s --tenant %s --user %s --password %s --svc_password %s" \
850-
%(quantum_ip, ks_admin_tenant_name, ks_admin_user, ks_admin_password, self.service_token)
851-
run("python /root/setup-quantum-in-keystone.py %s" %(quant_args))
852-
853-
if 'collector' in self._args.role:
854-
if self._args.num_collector_nodes:
855-
local("sudo ./contrail_setup_utils/collector-server-setup.sh multinode")
856-
else:
857-
local("sudo ./contrail_setup_utils/collector-server-setup.sh")
858-
859-
if 'control' in self._args.role:
860-
local("sudo ./contrail_setup_utils/control-server-setup.sh")
861-
862-
if 'compute' in self._args.role:
863-
if self._fixed_qemu_conf:
864-
local("sudo service libvirtd restart")
865-
866-
if self._args.compute_ip :
867-
# running compute-server-setup.sh on cfgm sets nova.conf's
868-
# sql access from ip instead of localhost, causing privilege
869-
# degradation for nova tables
870-
local("sudo ./contrail_setup_utils/compute-server-setup.sh")
871-
872-
if 'webui' in self._args.role:
873-
local("sudo ./contrail_setup_utils/webui-server-setup.sh")
874-
875-
#end run_services
876-
877817
#end class Setup
878818

879819
def main(args_str = None):

‎stack.sh‎

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,17 @@ function insert_vrouter() {
13711371
sudo service network restart
13721372
}
13731373

1374+
function test_insert_vrouter ()
1375+
{
1376+
lsmod | grep -q vrouter
1377+
if [ $? == 0 ]; then
1378+
echo "vrouter module already inserted."
1379+
else
1380+
insert_vrouter
1381+
echo "vrouter kernel module inserted."
1382+
fi
1383+
}
1384+
13741385
# Create the destination directory and ensure it is writable by the user
13751386
DEST=${DEST:-/opt/contrail}
13761387
sudo mkdir -p $DEST
@@ -1481,6 +1492,8 @@ screen_it cass "sudo /usr/sbin/cassandra -f"
14811492
screen_it zk "cd $CONTRAIL_SRC/third_party/zookeeper-3.4.5; ./bin/zkServer.sh start"
14821493
screen_it ifmap "cd $CONTRAIL_SRC/third_party/irond-0.3.0-bin; java -jar ./irond.jar"
14831494
sleep 2
1495+
screen_it disco "python $PYLIBPATH/discovery/disc_server_zk.py --conf_file /etc/contrail/discovery.conf"
1496+
sleep 2
14841497
screen_it apiSrv "python $PYLIBPATH/vnc_cfg_api_server/vnc_cfg_api_server.py --conf_file /etc/contrail/api_server.conf"
14851498
echo "Waiting for api-server to start..."
14861499
if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://${SERVICE_HOST}:${API_SERVER_PORT}; do sleep 1; done"; then
@@ -1494,15 +1507,18 @@ source /etc/contrail/control_param
14941507
screen_it control "export LD_LIBRARY_PATH=/opt/stack/contrail/build/lib; $CONTRAIL_SRC/build/debug/control-node/control-node --map-server-url https://${IFMAP_SERVER}:${IFMAP_PORT} --map-user ${IFMAP_USER} --map-password ${IFMAP_PASWD} --hostname ${HOSTNAME} --host-ip ${HOSTIP} --bgp-port ${BGP_PORT} ${CERT_OPTS} ${LOG_LOCAL}"
14951508

14961509
# vrouter
1497-
if [ $(lsmod | grep vrouter) ]; then
1498-
echo "vrouter module already inserted."
1499-
else
1500-
insert_vrouter
1501-
echo "vrouter kernel module inserted."
1502-
fi
1510+
test_insert_vrouter
15031511

1512+
# agent
15041513
source /etc/contrail/agent_param
1505-
screen_it agent "sudo env LD_LIBRARY_PATH=/opt/stack/contrail/build/lib bash -c \"$CONTRAIL_SRC/build/debug/vnsw/agent/vnswad --config-file $CONFIG $LOGFILE\""
1514+
sudo cat > $TOP_DIR/vnsw.hlpr <<END
1515+
#!/bin/bash
1516+
1517+
LD_LIBRARY_PATH=/opt/stack/contrail/build/lib $CONTRAIL_SRC/build/debug/vnsw/agent/vnswad --config-file $CONFIG $VROUTER_LOGFILE
1518+
END
1519+
sudo mv $TOP_DIR/vnsw.hlpr /opt/contrail/
1520+
sudo chmod +x /opt/contrail/vnsw.hlpr
1521+
screen_it agent "sudo /opt/contrail/vnsw.hlpr"
15061522

15071523
# Fin
15081524
# ===

‎stackrc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333
# # Optional, to enable tempest configuration as part of devstack
3434
# enable_service tempest
3535
ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,mysql
36-
ENABLED_SERVICES=$ENABLED_SERVICES,cass,ifmap,apiSrv,schema,zk,control,agent
36+
ENABLED_SERVICES=$ENABLED_SERVICES,cass,ifmap,apiSrv,schema,zk,control,agent,disco
3737

3838
# Set the default Nova APIs to enable
3939
NOVA_ENABLED_APIS=ec2,osapi_compute,metadata

‎unstack.sh‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,12 @@ if [[ -n "$SCREEN" ]]; then
143143
screen -X -S $SESSION quit
144144
fi
145145
fi
146+
cmd=$(lsmod | grep vrouter)
147+
if [ $? == 0 ]; then
148+
sudo rmmod vrouter
149+
source /etc/contrail/agent_param
150+
sudo rm -f /etc/sysconfig/network-scripts/ifcfg-$dev
151+
sudo rm -f /etc/sysconfig/network-scripts/ifcfg-vhost0
152+
fi
146153

147154
cleanup_tmp

0 commit comments

Comments
 (0)