Virtual networks with multiple subnets - ganeshahv/Contrail_SRE GitHub Wiki
The following heat-template shows how to create multiple subnets in a VN and assign a IP to a VMI from any of the subnets. https://github.com/ganeshahv/Contrail_SRE/blob/master/Heat/iip_subnet_uuid.yaml
- 
We can use Neutron resource to create a VN with multiple subnets and refer to the UUID of these subnets to create Instance IPs.
- 
However, with this approach we would not be able to add contrail-specific properties to the Virtual-network via a heat stack update.
 - 
It can still be done using vnc_api.
 
 - 
 - 
We can create IPAMs of 'flat-subnet' type and add subnets to these IPAMs. These IPAMs can be referred to in the virtual-networks created as part of the stack. Since the user has control over the subnet_uuid in this case, it becomes easier to define that in the instance-ip properties. So, we can get instance-ip from any of the subnets in the VN.
The template is here: https://github.com/ganeshahv/Contrail_SRE/blob/master/Heat/vn_multiple_subnets.yaml- The flip side of this is that the subnet has to be 'flat-subnet' type and also the forwarding mode has to be 'l3'.
 
 - 
If the subnet_uuid of the IPAMs can be obtained via get_attr action, it would give the user more flexibility.