Translate HOT to TOSCA (Network with floating IP)

asked 2016-06-06 03:19:02 -0500

Sabari Ram gravatar image

Dear all,

I am new to openstack and TOSCA. Currently I am testing in-house TOSCA to HOT translator. As part of my test, I need to verify TOSCA template conversion to HOT with Network components (Network, subnet, floating IP etc.,). Somehow, managed to get HOT template for what I should test, but I am stuck while writing TOSCA template especially for floating IP part. Can anyone help me out by giving TOSCA equivalent for the below HOT.

description: 'Heat template to deploy two servers with floating IP in existing network

  '
heat_template_version: '2013-05-23'
parameters: null
resources:
  server1:
    properties:
      flavor: m1.small
      image: CirrOS
      key_name: heat_key
      name: Server1
      networks:
      - port: {get_resource: server1_port}
    type: OS::Nova::Server
  server1_floating_ip:
    properties:
      floating_network_id: admin_floating_net
      port_id: {get_resource: server1_port}
    type: OS::Neutron::FloatingIP
  server1_port:
    properties:
      fixed_ips:
      - {subnet_id: admin_internal_net__subnet}
      network_id: admin_internal_net
      security_groups:
      - {get_resource: server_security_group}
    type: OS::Neutron::Port
  server2:
    properties:
      flavor: m1.small
      image: CirrOS
      key_name: heat_key
      name: Server2
      networks:
      - port: {get_resource: server2_port}
    type: OS::Nova::Server
  server2_floating_ip:
    properties:
      floating_network_id: admin_floating_net
      port_id: {get_resource: server2_port}
    type: OS::Neutron::FloatingIP
  server2_port:
    properties:
      fixed_ips:
      - {subnet_id: admin_internal_net__subnet}
      network_id: admin_internal_net
      security_groups:
      - {get_resource: server_security_group}
    type: OS::Neutron::Port
  server_security_group:
    properties:
      description: Add security group rules for server
      name: security-group
      rules:
      - {port_range_max: 22, port_range_min: 22, protocol: tcp, remote_ip_prefix: 0.0.0.0/0}
      - {protocol: icmp, remote_ip_prefix: 0.0.0.0/0}
    type: OS::Neutron::SecurityGroup

Your time and help is highly appreciated.

edit retag flag offensive close merge delete