summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2017-02-08 08:25:21 -0600
committerMonty Taylor <mordred@inaugust.com>2017-02-08 08:25:21 -0600
commit50efb434d874ca74e6c89424c43389408ab9b584 (patch)
tree86d62590193beac95d2e538ca27d4158bff8a75d
parenta9deb602fac5f10fba598410edf1b3b5e053a730 (diff)
downloados-client-config-50efb434d874ca74e6c89424c43389408ab9b584.tar.gz
Add support for indicating required floating IPs
Some clouds require that users add a floating IP to a server if the user wants that server to be able to talk to things that are not on the cloud. Some clouds do not require this and instead give servers a directly attached IP. The only way a user can know is to boot a server, then ask neutron for the port associated with that server, then find the network the port came from and then try to infer whether or not that network has the ability to route packets northbound. Of course, networks don't actually communicate that quality directly, (router:external doesn't mean a network routes externally, it means the network can have a router attached to it to provide floating ips) so it's still hit and miss. Where we can, save the user the stress and strain of not knowing how their cloud wants them to get an externally routable IP. Change-Id: I1baf804ce28bc1997b2347c4648c5cc56c750ead
-rw-r--r--doc/source/vendor-support.rst1
-rw-r--r--os_client_config/cloud_config.py13
-rw-r--r--os_client_config/vendor-schema.json6
-rw-r--r--os_client_config/vendors/auro.json3
-rw-r--r--os_client_config/vendors/citycloud.json1
-rw-r--r--os_client_config/vendors/rackspace.json1
-rw-r--r--os_client_config/vendors/vexxhost.json3
7 files changed, 25 insertions, 3 deletions
diff --git a/doc/source/vendor-support.rst b/doc/source/vendor-support.rst
index ff06691..577093c 100644
--- a/doc/source/vendor-support.rst
+++ b/doc/source/vendor-support.rst
@@ -21,6 +21,7 @@ These are the default behaviors unless a cloud is configured differently.
* Images are uploaded using PUT interface
* Public IPv4 is directly routable via DHCP from Neutron
* IPv6 is not provided
+* Floating IPs are not required
* Floating IPs are provided by Neutron
* Security groups are provided by Neutron
* Vendor specific agents are not used
diff --git a/os_client_config/cloud_config.py b/os_client_config/cloud_config.py
index a7fc058..f52756f 100644
--- a/os_client_config/cloud_config.py
+++ b/os_client_config/cloud_config.py
@@ -244,7 +244,6 @@ class CloudConfig(object):
:param service_key: Generic key for service, such as 'compute' or
'network'
- :returns: Endpoint for the service, or None if not found
"""
override_endpoint = self.get_endpoint(service_key)
@@ -420,6 +419,18 @@ class CloudConfig(object):
return default
return float(expiration[resource])
+ def requires_floating_ip(self):
+ """Return whether or not this cloud requires floating ips.
+
+
+ :returns: True of False if know, None if discovery is needed.
+ If requires_floating_ip is not configured but the cloud is
+ known to not provide floating ips, will return False.
+ """
+ if self.config['floating_ip_source'] == "None":
+ return False
+ return self.config['requires_floating_ip']
+
def get_external_networks(self):
"""Get list of network names for external networks."""
return [
diff --git a/os_client_config/vendor-schema.json b/os_client_config/vendor-schema.json
index 692b79c..8193a19 100644
--- a/os_client_config/vendor-schema.json
+++ b/os_client_config/vendor-schema.json
@@ -60,6 +60,12 @@
"description": "Optional message with information related to status",
"type": "string"
},
+ "requires_floating_ip": {
+ "name": "Requires Floating IP",
+ "description": "Whether the cloud requires a floating IP to route traffic off of the cloud",
+ "default": null,
+ "type": ["boolean", "null"]
+ },
"secgroup_source": {
"name": "Security Group Source",
"description": "Which service provides security groups",
diff --git a/os_client_config/vendors/auro.json b/os_client_config/vendors/auro.json
index a9e709b..410a8e1 100644
--- a/os_client_config/vendors/auro.json
+++ b/os_client_config/vendors/auro.json
@@ -5,6 +5,7 @@
"auth_url": "https://api.van1.auro.io:5000/v2.0"
},
"identity_api_version": "2",
- "region_name": "van1"
+ "region_name": "van1",
+ "requires_floating_ip": true
}
}
diff --git a/os_client_config/vendors/citycloud.json b/os_client_config/vendors/citycloud.json
index 097ddfd..c9ac335 100644
--- a/os_client_config/vendors/citycloud.json
+++ b/os_client_config/vendors/citycloud.json
@@ -12,6 +12,7 @@
"Sto2",
"Kna1"
],
+ "requires_floating_ip": true,
"volume_api_version": "1",
"identity_api_version": "3"
}
diff --git a/os_client_config/vendors/rackspace.json b/os_client_config/vendors/rackspace.json
index 3fbbacd..6a4590f 100644
--- a/os_client_config/vendors/rackspace.json
+++ b/os_client_config/vendors/rackspace.json
@@ -18,6 +18,7 @@
"image_format": "vhd",
"floating_ip_source": "None",
"secgroup_source": "None",
+ "requires_floating_ip": false,
"volume_api_version": "1",
"disable_vendor_agent": {
"vm_mode": "hvm",
diff --git a/os_client_config/vendors/vexxhost.json b/os_client_config/vendors/vexxhost.json
index aa2cedc..2227fff 100644
--- a/os_client_config/vendors/vexxhost.json
+++ b/os_client_config/vendors/vexxhost.json
@@ -9,6 +9,7 @@
],
"dns_api_version": "1",
"identity_api_version": "3",
- "floating_ip_source": "None"
+ "floating_ip_source": "None",
+ "requires_floating_ip": false
}
}