From 7dd68ca8868a3b7c03a8f5455be6718d21477c67 Mon Sep 17 00:00:00 2001 From: a Date: Thu, 8 Oct 2015 22:57:02 +0530 Subject: [PATCH] Bringing in code to create ESXiToVRouterIp.map file This is a missing commit, being ported from R2.20 Partial-Bug: #1504231 Change-Id: If5c60ccfd4996ec7b49d05272c867dc2809647af --- fabfile/tasks/provision.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fabfile/tasks/provision.py b/fabfile/tasks/provision.py index 02b8f75be..77402f6f1 100644 --- a/fabfile/tasks/provision.py +++ b/fabfile/tasks/provision.py @@ -542,6 +542,17 @@ def setup_cfgm_node(*args): orch = get_orchestrator() if orch == 'vcenter' or 'vcenter_compute' in env.roledefs: + #create the static esxi:vrouter map file + esxi_info = getattr(testbed, 'esxi_hosts', None) + tmp_fname = "/tmp/ESXiToVRouterIp-%s" %(host_string) + for esxi_host in esxi_info: + esxi_ip = esxi_info[esxi_host]['ip'] + vrouter_ip_string = esxi_info[esxi_host]['contrail_vm']['host'] + vrouter_ip = hstr_to_ip(vrouter_ip_string) + local("echo '%s:%s' >> %s" %(esxi_ip, vrouter_ip, tmp_fname)) + put(tmp_fname, "/etc/contrail/ESXiToVRouterIp.map", use_sudo=True) + local("rm %s" %(tmp_fname)) + # Frame the command to provision vcenter-plugin vcenter_info = getattr(env, 'vcenter', None) if not vcenter_info: