use ssh_ip instead of nat_ip for connecting to instances
diff --git a/xos/synchronizers/base/SyncInstanceUsingAnsible.py b/xos/synchronizers/base/SyncInstanceUsingAnsible.py
index 95c7b22..4e5807e 100644
--- a/xos/synchronizers/base/SyncInstanceUsingAnsible.py
+++ b/xos/synchronizers/base/SyncInstanceUsingAnsible.py
@@ -94,6 +94,7 @@
"hostname": instance.node.name,
"instance_id": instance.instance_id,
"username": "ubuntu",
+ "ssh_ip": instance.get_ssh_ip(),
}
key_name = self.service_key_name
elif (instance.isolation == "container"):
@@ -105,6 +106,7 @@
"instance_name": "rootcontext",
"username": "root",
"container_name": "%s-%s" % (instance.slice.name, str(instance.id))
+ # ssh_ip is not used for container-on-metal
}
key_name = self.get_node_key(node)
else:
@@ -121,7 +123,7 @@
"instance_name": instance.parent.name,
"instance_id": instance.parent.instance_id,
"username": "ubuntu",
- "nat_ip": instance.parent.get_ssh_ip(),
+ "ssh_ip": instance.parent.get_ssh_ip(),
"container_name": "%s-%s" % (instance.slice.name, str(instance.id))
}
key_name = instance.parent.slice.service.private_key_fn
diff --git a/xos/synchronizers/base/ansible.py b/xos/synchronizers/base/ansible.py
index 5135971..9cf4f4c 100644
--- a/xos/synchronizers/base/ansible.py
+++ b/xos/synchronizers/base/ansible.py
@@ -158,12 +158,12 @@
private_key = opts["private_key"]
baremetal_ssh = opts.get("baremetal_ssh",False)
if baremetal_ssh:
- # no instance_id or nat_ip for baremetal
+ # no instance_id or ssh_ip for baremetal
# we never proxy to baremetal
proxy_ssh = False
else:
instance_id = opts["instance_id"]
- nat_ip = opts["nat_ip"]
+ ssh_ip = opts["ssh_ip"]
try:
proxy_ssh = Config().observer_proxy_ssh
except:
@@ -195,7 +195,7 @@
f.write("%s ansible_ssh_private_key_file=%s\n" % (hostname, private_key_pathname))
else:
# acb: Login user is hardcoded, this is not great
- f.write("%s ansible_ssh_private_key_file=%s ansible_ssh_user=ubuntu\n" % (nat_ip, private_key_pathname))
+ f.write("%s ansible_ssh_private_key_file=%s ansible_ssh_user=ubuntu\n" % (ssh_ip, private_key_pathname))
f.close()
# SSH will complain if private key is world or group readable
diff --git a/xos/synchronizers/monitoring_channel/steps/sync_sflowservice.py b/xos/synchronizers/monitoring_channel/steps/sync_sflowservice.py
index 5e5cd83..154c5ab 100644
--- a/xos/synchronizers/monitoring_channel/steps/sync_sflowservice.py
+++ b/xos/synchronizers/monitoring_channel/steps/sync_sflowservice.py
@@ -55,7 +55,6 @@
fields["instance_hostname"] = self.get_instance(o).instance_name.replace("_","-")
fields["sflow_port"] = o.sflow_port
fields["sflow_api_port"] = o.sflow_api_port
- fields["nat_ip"] = self.get_instance(o).get_ssh_ip()
fields["sflow_container"] = "sflowpubsub"
return fields
diff --git a/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.py b/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.py
index 6de0374..a15fa54 100644
--- a/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.py
+++ b/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.py
@@ -64,7 +64,6 @@
instance = self.get_instance(o)
fields={}
- fields["nat_ip"] = instance.get_ssh_ip()
fields["sflow_api_base_url"] = self.get_sflow_service(o).sflow_api_url
fields["sflow_api_port"] = self.get_sflow_service(o).sflow_api_port
fields["listening_endpoint"] = o.listening_endpoint
diff --git a/xos/synchronizers/onos/steps/sync_onosapp.py b/xos/synchronizers/onos/steps/sync_onosapp.py
index c55a0d6..281df10 100644
--- a/xos/synchronizers/onos/steps/sync_onosapp.py
+++ b/xos/synchronizers/onos/steps/sync_onosapp.py
@@ -205,7 +205,6 @@
fields = self.get_extra_attributes_common(o)
- fields["nat_ip"] = instance.get_ssh_ip()
fields["config_fns"] = o.config_fns
fields["early_rest_configs"] = o.early_rest_configs
fields["component_configs"] = o.component_configs
diff --git a/xos/synchronizers/onos/steps/sync_onosservice.py b/xos/synchronizers/onos/steps/sync_onosservice.py
index 2e9bb38..e1f62c7 100644
--- a/xos/synchronizers/onos/steps/sync_onosservice.py
+++ b/xos/synchronizers/onos/steps/sync_onosservice.py
@@ -54,7 +54,7 @@
fields={}
fields["instance_hostname"] = self.get_instance(o).instance_name.replace("_","-")
fields["appname"] = o.name
- fields["nat_ip"] = self.get_instance(o).get_ssh_ip()
+ fields["ssh_ip"] = self.get_instance(o).get_ssh_ip()
fields["ONOS_container"] = "ONOS"
return fields