Rajviva's profile - activity

2019-08-30 02:30:09 -0500 received badge  Enthusiast
2019-08-27 22:35:29 -0500 received badge  Famous Question (source)
2019-08-27 16:55:32 -0500 commented answer Create Multiple instance with fixed IP and port in openstack using heat template

Agree with your approach. But problem i am facing is same. how to avoid this error.What is the correct way to use it.

index: %index%

found character '%' that cannot start any token in "<unicode string="">", line 21, column 21: index: %index%

2019-08-27 13:29:04 -0500 received badge  Notable Question (source)
2019-08-27 11:17:52 -0500 received badge  Popular Question (source)
2019-08-26 19:38:23 -0500 commented question Create Multiple instance with fixed IP and port in openstack using heat template

tried that as well

found character '%' that cannot start any token in "<unicode string="">", line 23, column 53: ... index: { get_param: [sm_oam_ip, %index%] }

2019-08-25 16:07:22 -0500 asked a question Create Multiple instance with fixed IP and port in openstack using heat template

Create Multiple instance with fixed IP and port in openstack using heat template

I want to create 3 instance/vm with a specific network and fixed ip. idea is to create more than 100 vm. To make dynamic heat-template i need this so that i can make few changes. I tried making the heat template but facing issue in port and ip-allocation to that port. heat_template_version: '2016-04-08'

ERROR---->{u'fixed_ips': [{u'ip_address': u''}] ERROR: ValueError: : resources.sm_instance_group.resources.0.resources.sm_instance: : "{u'sm_oam_port': {u'type': u'OS::Neutron::Port', u'properties': {u'fixed_ips': [{u'ip_address': u''}], u'network': u'4a4e40f5-1c53-4089-85e6-5fa1d7706530', u'name': u'sm_oam_port0'}}}" is not a list

#ENV file
parameters:
  sm_flavor: sm_capacity
  sm_availability_zone: performance-zone
  sm_image: 042386c6-0230-4a72-9255-ecb52fd0ec1d
  sm_net_oam: 4a4e40f5-1c53-4089-85e6-5fa1d7706530 ### 193.168.11.x
  sm_subnet_oam: 569a78c5f2334da3a7132d3d35cabc44 ### 193.168.11.x
  sm_oam_ip: ["193.168.11.185", "193.168.11.186", "193.168.11.187"]

#Template file
description: for SM cluster test, SM2-Node1,SM2-Node2,SM2-Node3 in one template
heat_template_version: '2016-04-08'
parameters:
  sm_flavor: {description: Flavor to use for servers, type: string}
  sm_availability_zone: {description: Name of availability_zone to use for servers, type: string}
  sm_image: {description: Name of image to use for servers, type: string}
  sm_net_oam: {description: ID of Neutron network into which servers get deployed, type: string}
  sm_subnet_oam: {description: ID of Neutron network into which servers get deployed, type: string}
  sm_oam_ip:
    type: comma_delimited_list
    default: ['193.168.11.185', '193.168.11.186', '193.168.11.187']

resources:
  sm_instance_group:
    type: OS::Heat::ResourceGroup
    properties:
      count: 3
      resource_def:
        type: sm_port.yaml
        properties:
          sm_vm_name: SM-%index%
          sm_oam_port_name: sm_oam_port%index%
          sm_oam_ip_index: { get_param: [sm_oam_ip, index] }
          sm_net_oam: { get_param: sm_net_oam }
          sm_subnet_oam: { get_param: sm_subnet_oam }
          sm_image: {get_param: sm_image}
          sm_availability_zone: {get_param: sm_availability_zone}
          sm_flavor: {get_param: sm_flavor}

#sm_port.yaml
description: for SM cluster test, SM2-Node1,SM2-Node2,SM2-Node3 in one template
heat_template_version: '2016-04-08'

  parameters:
    sm_flavor: {description: Flavor to use for servers, type: string}
    sm_availability_zone: {description: Name of availability_zone to use for servers, type: string}
    sm_image: {description: Name of image to use for servers, type: string}
    sm_vm_name: {type: string}
    sm_oam_port_name: {type: string}
    sm_oam_ip_index: {type: string}

    sm_net_oam: {description: ID of Neutron network into which servers get deployed, type: string}
    sm_subnet_oam: {description: ID of Neutron network into which servers get deployed, type: string}


  resources:
    sm_instance:
      type: OS::Nova::Server
      properties:
        flavor: {get_param: sm_flavor}
        availability_zone: {get_param: sm_availability_zone}
        name: {get_param: sm_vm_name}
        image: {get_param: sm_image}
        networks:
          sm_oam_port:
            type: OS::Neutron::Port
            properties:
              network: { get_param: sm_net_oam }
              name: { get_param: sm_oam_port_name }
              fixed_ips: 
              - { "ip_address": {get_param: sm_oam_ip_index }}
        config_drive: true
        user_data_format: RAW
        user_data:
          str_replace:
            template: {get_file: ud1}
            params:
        name: { get_param: sm_oam_port_name }