Ask Your Question

dubis's profile - activity

2018-11-26 11:25:47 -0600 asked a question How to attach a floating IP using the present environement

HI,

I'm newbie on openstack heat file. I did search but I didn't find relevant answer to my question. Here my template heat yaml file :

heat_template_version: newton

description: Simple template to deploy a single compute instance with an attached volume

resources:   my_instance:
    type: OS::Nova::Server
    properties:
      name: instance-name
      flavor: std.cpu1ram1
      block_device_mapping_v2:
        - device_name: vda
          image: DMZPRO-RHEL-7.4
          volume_size: 30
          delete_on_termination: true
      networks:
        - network: network-name.admin-network
      security_group: 
        - security_group: [security-name.group-sec-default]

security-group:    type: OS::Neutron::SecurityGroup properties: rules: security-name.group-sec-default

  my_volume:
    type: OS::Cinder::Volume
    properties:
      size: 10

  my_attachment:
      type: OS::Cinder::VolumeAttachment
      properties:
        instance_uuid:  { get_resource: my_instance }
        volume_id: { get_resource: my_volume }
        mountpoint: /dev/vdb

This heat file works but I don't know how to attach floating IP to "my_instance". I'm able to do it inside Horizon and it's working without PB. Under Horizon interface, I've to choose "Router_dmz" as a pool which creates and allows floating IP. As I understood the floating IP address should associated to "network-name.admin-network". I read many documentation, and I don't know if I've to use the OS:Neutron::FloatingIPAssociation resources or OS::Nova::FloatingIPAssociation. I tried on my side and I've not issue.

Thanks for your help.