Jump to: navigation, search

Melange/StaticRoutes

The Flow:

1. ip_block created in Melange(through nova-manage) and associated with quantum network as usual

2. Static routes are associated with the ip block created in step 1 in Melange as follows:

To create static_routes, you will need to POST to this path: /ipam/tenants/<tenant_id>/ip_blocks/<ip_block_id>/ip_routes with a body like:

           'ip_route': {
               'destination': "10.1.1.1",
               'netmask': "255.255.255.0",
               'gateway': "10.2.2.0",
               }

3. VM creation in compute calls allocate_for_instance on quantum network manager (as usual).

4. Quantum network manager calls ipam.get_v4_ips_by_interface (or v6_ips) as usual for ip address information. Along with ip address, block and gateway info, we return the list of static routes in this call. This would allow the network_info dict to be constructed along with the static_routes information as well.

Eg: GET /ipam/tenants/<tenant_id>/networks/<quantum_net_id>/interfaces/<virt_interface_id>/ip_allocations

RESPONSE:

{

'ip_addresses':
      [
        {
          'id': "some_uuid",
          'interface_id': "virt_interface_id",
          'address': "10.2.2.2",
          'version':  "4",
          'ip_block': {
               'id': "ip_block_id",
               'cidr': "10.2.2.0/24",
               'broadcast': "10.2.2.255",
               'gateway': "10.2.2.0",
               'netmask': "255.255.255.0",
               'dns1': "8.8.8.8",
               'dns2': "8.8.4.4",
               'ip_routes': [ {
                                     'id': 'route1_id',
                                     'destination': "10.1.1.0",
                                     'netmask': "255.255.255.0",
                                     'gateway': "10.2.2.0",
                                   },
                                  {
                                    'id': 'route2_id',
                                    'destination': "10.5.5.0",
                                     'netmask': "255.255.255.0",
                                     'gateway': "10.2.2.0",
                                   },
                               ]
               }
         },
     ]

}