From d2b0c6d1b93ff10fea168578bde0d46c86ebccb3 Mon Sep 17 00:00:00 2001 From: Andy Bavier Date: Fri, 25 Apr 2014 11:44:15 -0400 Subject: [PATCH] Tweaks to how private subnets are created. --- planetstack/openstack/driver.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/planetstack/openstack/driver.py b/planetstack/openstack/driver.py index 40982ee..cb7b4bf 100644 --- a/planetstack/openstack/driver.py +++ b/planetstack/openstack/driver.py @@ -263,17 +263,21 @@ class OpenStackDriver: subnet = snet if not subnet: + # HACK: Add metadata route -- Neutron does not reliably supply this + metadata_ip = cidr_ip.replace("0/24", "3") + allocation_pools = [{'start': start, 'end': end}] subnet = {'subnet': {'name': name, 'network_id': network_id, 'ip_version': ip_version, 'cidr': cidr_ip, #'dns_nameservers': ['8.8.8.8', '8.8.4.4'], + 'host_routes': [{'destination':'169.254.169.254/32','nexthop':metadata_ip}] + 'gateway_ip': None, 'allocation_pools': allocation_pools}} subnet = self.shell.quantum.create_subnet(subnet)['subnet'] - self.add_external_route(subnet) - # TODO: Add route to external network - # e.g. # route add -net 10.0.3.0/24 dev br-ex gw 10.100.0.5 + # self.add_external_route(subnet) + return subnet def update_subnet(self, id, fields): -- 2.43.0