summaryrefslogtreecommitdiffstats
path: root/deploy/setup_vnic.py
diff options
context:
space:
mode:
authorcarey.xu <carey.xuhan@huawei.com>2016-01-11 16:44:59 +0800
committerJustin chi <chigang@huawei.com>2016-01-13 04:49:21 +0000
commitf17596eac0ff7b9249f5709eb3cb930e571bbe99 (patch)
tree9b1e6594b7b85d75266df52259157312b874a052 /deploy/setup_vnic.py
parentd3b61b5a34d699871099dfc3562456e43e6e6236 (diff)
create a virtual port on jumpserver for functest
- create a virtual port on jumpserver, for functest communicate with openstack admin network - force mtu to 1450 when vxlan mode - make only one mysql node primary(bug workaround) JIRA: COMPASS-243 Change-Id: I498ed05f4b1b64f4f4db2455dd58dd2b4e82ae82 Signed-off-by: carey.xu <carey.xuhan@huawei.com> (cherry picked from commit 94035e341ff51daf1b1a5ed297f78b8bcbf71882)
Diffstat (limited to 'deploy/setup_vnic.py')
-rw-r--r--deploy/setup_vnic.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/deploy/setup_vnic.py b/deploy/setup_vnic.py
index 39623031..8e14765f 100644
--- a/deploy/setup_vnic.py
+++ b/deploy/setup_vnic.py
@@ -3,17 +3,17 @@ import os
import yaml
if __name__ == "__main__":
- network_config_file = "/home/carey/nfv/compass4nfv/deploy/conf/network_cfg.yaml"#os.environ["NETWORK"]
+ network_config_file = os.environ["NETWORK"]
network_config = yaml.load(open(network_config_file, "r"))
- os.system("ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal")
- os.system("ip addr flush mgmt_vnic")
- os.system("ip link set mgmt_vnic up")
+ os.system("sudo ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal")
+ os.system("sudo ip addr flush mgmt_vnic")
+ os.system("sudo ip link set mgmt_vnic up")
for sys_intf in network_config["sys_intf_mappings"]:
if sys_intf["name"] == "mgmt" and sys_intf.get("vlan_tag"):
- os.system("ovs-vsctl set port mgmt_vnic tag=%s" % sys_intf["vlan_tag"])
+ os.system("sudo ovs-vsctl set port mgmt_vnic tag=%s" % sys_intf["vlan_tag"])
for net_info in network_config["ip_settings"]:
if net_info["name"] == "mgmt":
mgmt_ip_range_end= net_info["ip_ranges"][0][1]
mgmt_netmask = net_info["cidr"].split('/')[1]
- os.system(r"ip addr add %s/%s dev mgmt_vnic" % (mgmt_ip_range_end, mgmt_netmask))
+ os.system(r"sudo ip addr add %s/%s dev mgmt_vnic" % (mgmt_ip_range_end, mgmt_netmask))