Ask Your Question
0

i am trying to associate floating ip to 2 server in my stack below is what i have tried

asked 2017-07-26 06:15:59 -0600

anonymous user

Anonymous

heat_template_version: 2014-10-16

description: >
  Stack to prepare network and instances for deploying the nodes for Elasticsearch.

    parameters:
      # Stack Parameters
      stack_prefix:
        type: string
        label: prefix for resource names
        description: prefix for resource names
      stack_image:
        type: string
        label: Image
        description: Name of Image to use for the nodes.
      stack_key_name:
        type: string
        label: stack Key
        description: Name of key pair to use for the nodes in the stack.
      availability_zone_list:
        type: comma_delimited_list
        label: Availability zone list
        description: Availability zone list

  # Node Parameters
  node_flavor:
    type: string
    label: Node Flavor
    description: Name of flavor to use for the origin nodes.
  node_count:
    type: number
    label: Node count
    description: Number of origin nodes to deploy.


  # Networking Parameters
  router_id:
    type: string
    label: Router ID
    description: ID of the router to uplink everything to
  external_network_id:
    type: string
    label: External Network ID
  dns_nameservers:
    type: comma_delimited_list
    label: DNS Nameservers
  default_security_group_id:
    type: string
    label: ID for Default Security Group
  subnet_prefix:
    type: string
    label: prefix for subnet ip
    description: prefix for subnet ip
  subnet_pool_start:
    type: string
    label: subnet pool start
  subnet_pool_end:
    type: string
    label: subnet pool end
  port:
    type: string
    label: Server port
    description: The server port that receives the floating IP address.
  public_network:
    type: string
    label: Public network name or ID
    description: Public network with floating IP addresses.
    default: public
  private_network:
    type: string
    label: Public network name or ID
    description: Public network with floating IP addresses.
    default: private
resources:
  # Security Groups
  elk_security_group:
    type: OS::Neutron::SecurityGroup
    properties:
       description: 'Security group for ICMP, HTTP and SSH'
       name: elk_sec_group
       rules:
        - direction: ingress
          ethertype: IPv4
          protocol: tcp
          port_range_min: 80
          port_range_max: 80
        - protocol: tcp
          port_range_min: 443
          port_range_max: 443
        - protocol: icmp
        - direction: ingress
          ethertype: IPv4
          protocol: tcp
          port_range_min: 22
          port_range_max: 22
        - direction: egress
          ethertype: IPv4
          remote_ip_prefix: 0.0.0.0/0

  origin_network:
    type: OS::Neutron::Net
    properties:
      name:
        list_join: ['-', [ {get_param: stack_prefix}, 'net']]
  origin_subnet:
    type: OS::Neutron::Subnet
    properties:
      cidr:
        list_join: ['.', [ {get_param: subnet_prefix}, '0/24']]
      gateway_ip:
        list_join: ['.', [ {get_param: subnet_prefix}, '1']]
      name:
        list_join: ['-', [ {get_param: stack_prefix}, 'subnet']]
      network_id: { get_resource: origin_network }
      dns_nameservers: { get_param: dns_nameservers }
      allocation_pools:
        - start:
            list_join: ['.', [ {get_param: subnet_prefix}, {get_param: subnet_pool_start}]]
          end:
            list_join: ['.', [ {get_param: subnet_prefix}, {get_param: subnet_pool_end}]]

  origin_network_uplink:
    type: OS::Neutron::RouterInterface
    properties:
      router_id: { get_param: router_id }
      subnet_id: { get_resource: origin_subnet }


  web_nodes:
    type: OS::Heat::ResourceGroup
    depends_on:
      - origin_network_uplink
    properties:
      count: { get_param: node_count }
      resource_def:
        type: Paas::builds::Node
        properties:
          name:
            list_join: ['-', [ {get_param: stack_prefix}, 'web-node' ,'%index%']]
          availability_zones: { get_param: availability_zone_list }
          az_index: '%index%'
          ip_address:
            list_join: ['', [ {get_param: subnet_prefix},'.2', '%index%']]
          image: { get_param: stack_image }
          flavor: { get_param: node_flavor }
          key_name: { get_param: stack_key_name }
          private_network_id: { get_resource: origin_network }
          port: { get_param: port}
          public_network: { get_param: public_network}
          security_groups:
            - { get_param: default_security_group_id}
            - { get_resource: elk_security_group }

  #floating_port:
    #type: OS::Neutron::Port
    #properties:
      #network: { get_resource: origin_network }
      #security_groups: { get_resource: elk_security_group }
      #fixed_ips: list_join: {get_param: subnet_prefix}

  floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      #fixed_ip_address: { get_param: subnet_prefix}
      floating_network: { get_param: public_network }

  floating_ip_assoc:
    type: OS::Neutron::FloatingIPAssociation
    properties:
      floatingip_id: { get_resource: floating_ip }
      port_id: { get_param: port }

and below is the env.yaml

resource_registry:
  "Paas::builds::Node": builds/node.yaml
  #"Paas::builds::Lb": builds/lb.yaml

parameters:
  ##Tenent Details##
  stack_prefix: ELK-CHD
  stack_key_name: ELK
  stack_image: RHEL-
  # server_image: RHEL_Atomic_7.2

  default_security_group_id: cd4f63d5-1fe7-4a06-bc45-cfd3df1da357

  ##Network Details##
  #Subnet settings
  subnet_prefix: '192.168.3'
  subnet_pool_start: '70'
  subnet_pool_end: '99'

  # The router ID, obtained by running 'neutron router-list'
  router_id: 6fe68c74-0d86-4e63-bba1-36b18022c187

  # External Network ...
(more)
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-07-26 12:51:01 -0600

VivSam gravatar image

Ya thanks @zaneb. Now i have 2 floating ip's but am still not able to map them to fixed ip's. getting the error while creating OS::Heat::ResourceGroup resource.

Error: Resource CREATE failed: Error: Resource CREATE failed: Conflict: Cannot associate floating IP 10.190.190.146 (cf3d264d-e313-4311-bc9f-9e8950e15c9d) with port 2c3dfc9a-6135-472d-a794-707bba33e3e7 using fixed IP 192.167.0.1, as that fixed IP already
edit flag offensive delete link more
0

answered 2017-07-26 08:52:59 -0600

zaneb gravatar image

I don't see a question here, but the answer is that you can't attach the same Neutron port to two Nova servers.

edit flag offensive delete link more

Comments

So how do i assign floating IP's to, two separate instances? I am so confused here. Any help/ documentation i can refer to?

VivSam gravatar imageVivSam ( 2017-07-26 09:00:04 -0600 )edit
1

Create the port and floating IP inside the builds/node.yaml template, so that there's one per server.

zaneb gravatar imagezaneb ( 2017-07-26 11:17:29 -0600 )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

Stats

Asked: 2017-07-26 06:15:59 -0600

Seen: 631 times

Last updated: Jul 26 '17