Ask Your Question
0

Heat Template: 2nd interface

asked 2019-12-15 05:31:11 -0500

Torsten Grünen gravatar image

updated 2019-12-16 08:36:55 -0500

zaneb gravatar image

Hi.. How can I add more than one interface (in a different network) in my heat template?

heat_template_version: 2014-10-16

description: Proxy-Server BadBank
parameters:
   az:
      type: string
      default: eu-de-01
   key:
     type: string
     default: blabla
   volume_size:
     type: string
     default: 20
   flavor:
     type: string
     default: s2.large.2 
   image:
     type: string
     default: Standard_CentOS_7_latest
   network:
     type: string
     default: c83616ec-a2ab-4622-b3d2-dcc890b44e38
   network2:
     type: string
     default: 78408f55-6e46-4b05-907a-1602a7bb8c05
   security_groups:
     type: string
     default: 5cd60c6e-b4d5-4d59-afb4-1bad7f9a43d8
   admin_pass:
     type: string
     default: Password!
   volume_name:
      type: string
      default: sysXECS0000EVS0001
   instance_name:
      type: string
      default: sysXECS0000
   instance_ip:
      type: string
      default: 10.200.4.10
   instance_ip2:
      type: string
      default: 10.200.6.10

resources:
  server_port:
    type: OS::Neutron::Port
    properties:
      network: { get_param: network }
      fixed_ips: [{"ip_address": { get_param: instance_ip }}]
      security_groups: [{ get_param: security_groups }]
      admin_state_up: true

  data_volume:
    type: OS::Cinder::Volume
    properties:
      name: { get_param: volume_name }
      size: { get_param: volume_size }
      availability_zone: { get_param: az }

  Proxy:
    type: OS::Nova::Server
    properties:
      admin_pass: { get_param: admin_pass }
      availability_zone: { get_param: az }
      name: { get_param: instance_name }
      image: { get_param: image }
      flavor: { get_param: flavor }
      key_name: { get_param: key }
      networks: [{"port": { get_resource: server_port }}]
      tags: [Project, Role]
      user_data_format: RAW
      user_data: |
         #!/bin/bash
         reboot

  volume_attach:
    type: OS::Cinder::VolumeAttachment
    properties:
      volume_id: { get_resource: data_volume }
      instance_uuid: { get_resource: Proxy }
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2019-12-16 01:06:07 -0500

updated 2019-12-16 08:38:50 -0500

zaneb gravatar image

For multiple interface

use

resources:
  VM_port1:
    type: OS::Neutron::Port
    properties:
      network: { get_param: VM_NET1_ID }
      name: VM_port1
      fixed_ips:
          - { "ip_address": {get_param: [VM_IP1, 0] }}

  VM_port2:
    type: OS::Neutron::Port
    properties:
      network: { get_param: VM_NET2_ID }
      name: VM_port2
      fixed_ips:
          - { "ip_address": {get_param: [VM_IP2, 0] }}
  VM_Instance:
    properties:
      networks:
        - port: { get_resource: VM_port1 }
        - port: { get_resource: VM_port2 }

Above will create two interface.

edit flag offensive delete link more

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: 2019-12-15 05:31:11 -0500

Seen: 36 times

Last updated: Dec 16 '19