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
This commit is contained in:
Monty Taylor 2017-02-08 08:25:21 -06:00
parent a9deb602fa
commit 50efb434d8
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
7 changed files with 25 additions and 3 deletions

View File

@ -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

View File

@ -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 [

View File

@ -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",

View File

@ -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
}
}

View File

@ -12,6 +12,7 @@
"Sto2",
"Kna1"
],
"requires_floating_ip": true,
"volume_api_version": "1",
"identity_api_version": "3"
}

View File

@ -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",

View File

@ -9,6 +9,7 @@
],
"dns_api_version": "1",
"identity_api_version": "3",
"floating_ip_source": "None"
"floating_ip_source": "None",
"requires_floating_ip": false
}
}