CORD-1908: cleanup VSG service
Change-Id: Ib7fa0a68dbba185b30d7cd1ea1b425ad3d33a8d3
(cherry picked from commit 645c0c587527d68566d70d3bc8d39981c551a786)
diff --git a/xos/synchronizer/templates/dnsmasq_safe_servers.j2 b/xos/synchronizer/templates/dnsmasq_safe_servers.j2
index fdcaf4d..4082195 100644
--- a/xos/synchronizer/templates/dnsmasq_safe_servers.j2
+++ b/xos/synchronizer/templates/dnsmasq_safe_servers.j2
@@ -13,7 +13,7 @@
# limitations under the License.
-# This file autogenerated by vCPE observer
+# This file autogenerated by vSG observer
# It contains a list of DNS servers for dnsmasq to use.
no-resolv
diff --git a/xos/synchronizer/templates/dnsmasq_servers.j2 b/xos/synchronizer/templates/dnsmasq_servers.j2
index f1b5578..36a9f54 100644
--- a/xos/synchronizer/templates/dnsmasq_servers.j2
+++ b/xos/synchronizer/templates/dnsmasq_servers.j2
@@ -13,7 +13,7 @@
# limitations under the License.
-# This file autogenerated by vCPE observer
+# This file autogenerated by vSG observer
# It contains a list of DNS servers for dnsmasq to use.
no-resolv
diff --git a/xos/synchronizer/templates/start-vcpe.sh.j2 b/xos/synchronizer/templates/start-vcpe.sh.j2
deleted file mode 100755
index 76d2d32..0000000
--- a/xos/synchronizer/templates/start-vcpe.sh.j2
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-
-function mac_to_iface {
- MAC=$1
- ifconfig|grep $MAC| awk '{print $1}'|grep -v '\.'
-}
-
-iptables -L > /dev/null
-ip6tables -L > /dev/null
-
-STAG={{ s_tags[0] }}
-CTAG={{ c_tags[0] }}
-VCPE=vcpe-$STAG-$CTAG
-
-docker inspect $VCPE > /dev/null 2>&1
-if [ "$?" == 1 ]
-then
- docker pull andybavier/docker-vcpe
- docker run -d --name=$VCPE --privileged=true --net=none -v /etc/$VCPE/dnsmasq.d:/etc/dnsmasq.d andybavier/docker-vcpe
-else
- docker start $VCPE
-fi
-
-# Set up networking via pipework
-WAN_IFACE=$( mac_to_iface {{ wan_mac }} )
-docker exec $VCPE ifconfig eth0 >> /dev/null || pipework $WAN_IFACE -i eth0 $VCPE {{ wan_ip }}/24@{{ wan_next_hop }} {{ wan_container_mac }}
-
-# LAN_IFACE=$( mac_to_iface {{ lan_mac }} )
-# Need to encapsulate VLAN traffic so that Neutron doesn't eat it
-# Assumes that br-lan has been set up appropriately by a previous step
-LAN_IFACE=br-lan
-ifconfig $LAN_IFACE >> /dev/null
-if [ "$?" == 0 ]
-then
- ifconfig $LAN_IFACE.$STAG >> /dev/null || ip link add link $LAN_IFACE name $LAN_IFACE.$STAG type vlan id $STAG
- ifconfig $LAN_IFACE.$STAG up
- docker exec $VCPE ifconfig eth1 >> /dev/null || pipework $LAN_IFACE.$STAG -i eth1 $VCPE 192.168.0.1/24 @$CTAG
-fi
-
-#HPC_IFACE=$( mac_to_iface {{ hpc_client_mac }} )
-#docker exec $VCPE ifconfig eth2 >> /dev/null || pipework $HPC_IFACE -i eth2 $VCPE {{ hpc_client_ip }}/24
-
-# Make sure VM's eth0 (hpc_client) has no IP address
-#ifconfig $HPC_IFACE 0.0.0.0
-
-# Now can start up dnsmasq
-docker exec $VCPE service dnsmasq start
-
-# Attach to container
-docker start -a $VCPE
diff --git a/xos/synchronizer/templates/start-vcpe-vtn.sh.j2 b/xos/synchronizer/templates/start-vsg-vtn.sh.j2
similarity index 61%
rename from xos/synchronizer/templates/start-vcpe-vtn.sh.j2
rename to xos/synchronizer/templates/start-vsg-vtn.sh.j2
index 730d4ad..ff0b4b0 100644
--- a/xos/synchronizer/templates/start-vcpe-vtn.sh.j2
+++ b/xos/synchronizer/templates/start-vsg-vtn.sh.j2
@@ -24,25 +24,25 @@
STAG={{ s_tags[0] }}
CTAG={{ c_tags[0] }}
-VCPE=vcpe-$STAG-$CTAG
+VSG=vsg-$STAG-$CTAG
-docker inspect $VCPE > /dev/null 2>&1
+docker inspect $VSG > /dev/null 2>&1
if [ "$?" == 1 ]
then
docker pull {{ docker_remote_image_name }}
- docker run -d --name=$VCPE --privileged=true --net=none \
- -v /var/container_volumes/$VCPE/mount:/mount:ro \
- -v /var/container_volumes/$VCPE/etc/dnsmasq.d:/etc/dnsmasq.d:ro \
- -v /var/container_volumes/$VCPE/etc/service/message:/etc/service/message \
- -v /var/container_volumes/$VCPE/usr/local/sbin:/usr/local/sbin:ro \
+ docker run -d --name=$VSG --privileged=true --net=none \
+ -v /var/container_volumes/$VSG/mount:/mount:ro \
+ -v /var/container_volumes/$VSG/etc/dnsmasq.d:/etc/dnsmasq.d:ro \
+ -v /var/container_volumes/$VSG/etc/service/message:/etc/service/message \
+ -v /var/container_volumes/$VSG/usr/local/sbin:/usr/local/sbin:ro \
{{ docker_local_image_name }}
else
- docker start $VCPE
+ docker start $VSG
fi
# Set up networking via pipework
WAN_IFACE=br-wan
-docker exec $VCPE ifconfig eth0 >> /dev/null || pipework $WAN_IFACE -i eth0 $VCPE {{ wan_container_ip }}/{{ wan_container_netbits }}@{{ wan_container_gateway_ip }} {{ wan_container_mac }}
+docker exec $VSG ifconfig eth0 >> /dev/null || pipework $WAN_IFACE -i eth0 $VSG {{ wan_container_ip }}/{{ wan_container_netbits }}@{{ wan_container_gateway_ip }} {{ wan_container_mac }}
LAN_IFACE=eth0
ifconfig $LAN_IFACE >> /dev/null
@@ -50,14 +50,14 @@
then
ifconfig $LAN_IFACE.$STAG >> /dev/null || ip link add link $LAN_IFACE name $LAN_IFACE.$STAG type vlan id $STAG
ifconfig $LAN_IFACE.$STAG up
- docker exec $VCPE ifconfig eth1 >> /dev/null || pipework $LAN_IFACE.$STAG -i eth1 $VCPE 192.168.0.1/24 @$CTAG
+ docker exec $VSG ifconfig eth1 >> /dev/null || pipework $LAN_IFACE.$STAG -i eth1 $VSG 192.168.0.1/24 @$CTAG
fi
#HPC_IFACE=$( mac_to_iface {{ hpc_client_mac }} )
-#docker exec $VCPE ifconfig eth2 >> /dev/null || pipework $HPC_IFACE -i eth2 $VCPE {{ hpc_client_ip }}/24
+#docker exec $VSG ifconfig eth2 >> /dev/null || pipework $HPC_IFACE -i eth2 $VSG {{ hpc_client_ip }}/24
# Make sure VM's eth0 (hpc_client) has no IP address
#ifconfig $HPC_IFACE 0.0.0.0
# Attach to container
-docker start -a $VCPE
+docker start -a $VSG
diff --git a/xos/synchronizer/templates/vlan_sample.j2 b/xos/synchronizer/templates/vlan_sample.j2
index 404a539..e1ab857 100644
--- a/xos/synchronizer/templates/vlan_sample.j2
+++ b/xos/synchronizer/templates/vlan_sample.j2
@@ -13,7 +13,7 @@
# limitations under the License.
-# below is a list of all vlan_ids associated with this vcpe
+# below is a list of all vlan_ids associated with this vsg
{% for vlan_id in c_tags %}
{{ vlan_id }}
diff --git a/xos/synchronizer/templates/vcpe.conf.j2 b/xos/synchronizer/templates/vsg.conf.j2
similarity index 82%
rename from xos/synchronizer/templates/vcpe.conf.j2
rename to xos/synchronizer/templates/vsg.conf.j2
index 39e74ae..797f645 100644
--- a/xos/synchronizer/templates/vcpe.conf.j2
+++ b/xos/synchronizer/templates/vsg.conf.j2
@@ -13,13 +13,13 @@
# limitations under the License.
-# Upstart script for vCPE
-description "vCPE container"
-author "andy@onlab.us"
+# Upstart script for vSG
+description "vSG container"
+author "andy@opennetworking.org"
start on filesystem and started docker
stop on runlevel [!2345]
respawn
script
- /usr/local/sbin/start-vcpe-{{ s_tags[0] }}-{{ c_tags[0] }}.sh
+ /usr/local/sbin/start-vsg-{{ s_tags[0] }}-{{ c_tags[0] }}.sh
end script