Ask Your Question
0

Orchestration: building cube network topology by using HOT template.

asked 2018-01-04 08:36:38 -0500

garyphone gravatar image

updated 2018-01-11 09:35:05 -0500

zaneb gravatar image

Dear guys, I have to build a cube network topology in OpenStack by launching stacks. The goal topology is below:

    O5--X--O6
   /       / |
  X       X  |
 /      /    X
O1--X--O2    |
|       |    O7
X       X   /     
|       |  X
O3--X--O4/

O1 to O7 are networks, X means router.

My HOT template is :

description: haec-box--cube-surface.xml
heat_template_version: '2015-04-30'
resources:
Ne0:
properties:
  cidr: 192.168.1.0/24
  name: PCB-0
  network_id: {get_resource: Node0}
type: OS::Neutron::Subnet
Ne1:
properties:
  cidr: 192.168.2.0/24
  name: PCB-1
  network_id: {get_resource: Node1}
type: OS::Neutron::Subnet
Ne2:
properties:
  cidr: 192.168.3.0/24
  name: PCB-2
  network_id: {get_resource: Node2}
type: OS::Neutron::Subnet
Ne3:
properties:
  cidr: 192.168.4.0/24
  name: PCB-3
  network_id: {get_resource: Node3}
type: OS::Neutron::Subnet
Ne4:
properties:
  cidr: 192.168.5.0/24
  name: PCB-4
  network_id: {get_resource: Node4}
type: OS::Neutron::Subnet
Ne5:
properties:
  cidr: 192.168.6.0/24
  name: PCB-5
  network_id: {get_resource: Node5}
type: OS::Neutron::Subnet
Ne6:
properties:
  cidr: 192.168.7.0/24
  name: PCB-6
  network_id: {get_resource: Node6}
type: OS::Neutron::Subnet
Node0:
properties: {name: PCB-0}
type: OS::Neutron::Net
Node1:
properties: {name: PCB-1}
type: OS::Neutron::Net
Node2:
properties: {name: PCB-2}
type: OS::Neutron::Net
Node3:
properties: {name: PCB-3}
type: OS::Neutron::Net
Node4:
properties: {name: PCB-4}
type: OS::Neutron::Net
Node5:
properties: {name: PCB-5}
type: OS::Neutron::Net
Node6:
properties: {name: PCB-6}
type: OS::Neutron::Net

ir0:
properties: {name: ir0}
type: OS::Neutron::Router
ir1:
properties: {name: ir1}
type: OS::Neutron::Router
ir2:
properties: {name: ir2}
type: OS::Neutron::Router
ir3:
properties: {name: ir3}
type: OS::Neutron::Router
ir4:
properties: {name: ir4}
type: OS::Neutron::Router
ir5:
properties: {name: ir5}
type: OS::Neutron::Router
ir6:
properties: {name: ir6}
type: OS::Neutron::Router
ir7:
properties: {name: ir7}
type: OS::Neutron::Router
ir8:
properties: {name: ir8}
type: OS::Neutron::Router

iriA0:
properties:
  subnet: {get_resource: Ne0}
  router_id: {get_resource: ir0}
type: OS::Neutron::RouterInterface
iriA1:
properties:
  subnet: {get_resource: Ne2}
  router_id: {get_resource: ir1}
type: OS::Neutron::RouterInterface
iriA2:
properties:
  subnet: {get_resource: Ne4}
  router_id: {get_resource: ir2}
type: OS::Neutron::RouterInterface
iriA3:
properties:
  subnet: {get_resource: Ne0}
  router_id: {get_resource: ir3}
type: OS::Neutron::RouterInterface
iriA4:
properties:
  subnet: {get_resource: Ne0}
  router_id: {get_resource: ir4}
type: OS::Neutron::RouterInterface
iriA5:
properties:
  subnet: {get_resource: Ne6}
  router_id: {get_resource: ir5}
type: OS::Neutron::RouterInterface
iriA6:
properties:
  subnet: {get_resource: Ne5}
  router_id: {get_resource: ir6}
type: OS::Neutron::RouterInterface
iriA7:
properties:
  subnet: {get_resource: Ne1}
  router_id: {get_resource: ir7}
type: OS::Neutron::RouterInterface
iriA8:
properties:
  subnet: {get_resource: Ne3}
  router_id: {get_resource: ir8}
type: OS::Neutron::RouterInterface
iriB0:
properties:
  subnet: {get_resource: Ne1}
  router_id: {get_resource: ir0}
type: OS::Neutron::RouterInterface
iriB1:
properties:
  subnet: {get_resource: Ne3}
  router_id: {get_resource: ir1}
type: OS::Neutron::RouterInterface
iriB2:
properties:
  subnet: {get_resource: Ne5}
  router_id: {get_resource: ir2}
type: OS::Neutron::RouterInterface
iriB3:
properties:
  subnet: {get_resource: Ne4}
  router_id: {get_resource: ir3}
type: OS::Neutron::RouterInterface
iriB4:
properties:
  subnet: {get_resource: Ne2}
  router_id: {get_resource: ir4}
type: OS::Neutron::RouterInterface
iriB5:
properties:
  subnet: {get_resource: Ne5}
  router_id: {get_resource: ir5}
type: OS::Neutron::RouterInterface
iriB6:
properties:
  subnet: {get_resource: Ne1}
  router_id: {get_resource: ir6}
type: OS::Neutron::RouterInterface
iriB7:
properties:
  subnet: {get_resource: Ne3}
  router_id: {get_resource: ir7}
type: OS::Neutron::RouterInterface
iriB8 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-01-11 09:34:13 -0500

zaneb gravatar image

This looks like a race condition in Neutron. Since you didn't specify fixed IP addresses it should just pick one but I suspect that, because iriB6 and iriB0 can be created in quick succession, Neutron is picking the same address and making resolving the race your problem.

There are a number of things you could do to solve this, in order from long to short term:

  • Raise a bug in Neutron. It shouldn't be making this your problem IMHO.
  • Raise a bug in Heat. We have a retry-on-conflict mechanism used by other resource types, and it looks like we should enable it for RouterInterface as well.
  • Explicitly create OS::Neutron::Port resources with fixed IPs for each router interface, and reference the ports rather than just the subnets in the RouterInterface resources.
  • Add a depends_on relationship between router interfaces in the same subnet to serialise their creation.
edit flag offensive delete link more

Comments

thanks, zaneb. i have used OS::Neutron::Port to solve this problem.

garyphone gravatar imagegaryphone ( 2018-01-22 02:06:05 -0500 )edit
zaneb gravatar imagezaneb ( 2018-01-23 14:48:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-01-04 08:36:38 -0500

Seen: 68 times

Last updated: Jan 11