[Heat]How to link multiple routers in heat template?
Hi All
I am working on openstack Heat and i wanted to make below attached topology using heat template :
Router 1
|
|
Subnet 1
|
|
Network 1
! ! ! ! ! ! ! ! ! vm1 vm1 vm1
Router 2
|
|
Subnet 2
|
|
Network 2
! ! ! ! ! ! ! ! ! vm2 vm2 vm2
The topology have two routers having different subnets having diferent networks and instances is attached to their respective networks. I cannot figure out how can i connect two routers as even on internet i didnot get any example template having multiple routers topology?
I want to connect both the routers and have link between both the routers.
So i make two subnets each for a network and assigned interface on both routers, such that one interface on each have same router but different subnets. Example :
heat_router_int0:
Properties:
router_id: {Ref: heat_router_01}
subnet_id: {Ref: heat_subnet_01}
heat_router_int2:
Properties:
router_id: {Ref: heat_router_01}
subnet_id: {Ref: heat_subnet_02}
The template which i am using is given below :
AWSTemplateFormatVersion: '2010-09-09'
Description: Sample Heat template that spins up multiple instances and a private network
(JSON)
Resources:
heat_network_01:
Properties: {name: heat-network-01}
Type: OS::Neutron::Net
heat_network_02:
Properties: {name: heat-network-02}
Type: OS::Neutron::Net
heat_router_01:
Properties: {admin_state_up: 'True', name: heat-router-01}
Type: OS::Neutron::Router
heat_router_02:
Properties: {admin_state_up: 'True', name: heat-router-02}
Type: OS::Neutron::Router
heat_router_int0:
Properties:
router_id: {Ref: heat_router_01}
subnet_id: {Ref: heat_subnet_01}
Type: OS::Neutron::RouterInterface
heat_router_int1:
Properties:
router_id: {Ref: heat_router_02}
subnet_id: {Ref: heat_subnet_02}
Type: OS::Neutron::RouterInterface
heat_router_int2:
Properties:
router_id: {Ref: heat_router_01}
subnet_id: {Ref: heat_subnet_02}
Type: OS::Neutron::RouterInterface
heat_router_int3:
Properties:
router_id: {Ref: heat_router_02}
subnet_id: {Ref: heat_subnet_01}
Type: OS::Neutron::RouterInterface
heat_subnet_01:
Properties:
cidr: 10.10.10.0/24
dns_nameservers: [172.16.1.11, 172.16.1.6]
enable_dhcp: 'True'
gateway_ip: 10.10.10.254
name: heat-subnet-01
network_id: {Ref: heat_network_01}
Type: OS::Neutron::Subnet
heat_subnet_02:
Properties:
cidr: 10.10.11.0/24
dns_nameservers: [172.16.1.11, 172.16.1.6]
enable_dhcp: 'True'
gateway_ip: 10.10.11.254
name: heat-subnet-01
network_id: {Ref: heat_network_02}
Type: OS::Neutron::Subnet
instance0:
Properties:
flavor: m1.nano
image: cirros-0.3.2-x86_64-uec
name: heat-instance-01
networks:
- port: {Ref: instance0_port0}
Type: OS::Nova::Server
instance0_port0:
Properties:
admin_state_up: 'True'
network_id: {Ref: heat_network_01}
Type: OS::Neutron::Port
instance1:
Properties:
flavor: m1.nano
image: cirros-0.3.2-x86_64-uec
name: heat-instance12-02
networks:
- port: {Ref: instance12_port0}
Type: OS::Nova::Server
instance11:
Properties:
flavor: m1.nano
image: cirros-0.3.2-x86_64-uec
name: heat-instance11-01
networks:
- port: {Ref: instance11_port0}
Type: OS::Nova::Server
instance11_port0:
Properties:
admin_state_up: 'True'
network_id: {Ref: heat_network_02}
Type: OS::Neutron::Port
instance12_port0:
Properties:
admin_state_up: 'True'
network_id: {Ref: heat_network_02}
Type: OS::Neutron::Port
instance1_port0:
Properties:
admin_state_up: 'True'
network_id: {Ref: heat_network_01}
Type: OS::Neutron::Port
I am able to create topology using the template but i am not able to connect two routers.
The error is shown in heat_router_int0 :
Create FailedResource Create Failed: Ipaddressinuseclient: Unable To Complete Operation For Network 2870ec2e-5b89-43b2-9f9f-396cad53ed49. The Ip Address 10.10.10.254 Is In Use.
Neither i can get a template example on internet through which i can connect two routers. Can you please help me with :
1.) Can we connect two routers? Does the configuration :
heat_router_int2:
Properties:
router_id: {Ref: heat_router_01}
subnet_id: {Ref: heat_subnet_02 ...