How to reference each resource ID in a Heat::ResourceGroup
Hi,
referring to the following template that creates a ResourceGroup of vm_count VMs and volumes and attaches each volume to a VM
heat_template_
description: Template
parameters:
image:
type: string
label: Server Image
default: Centos
flavor:
type: string
label: Flavor
default: m1.tiny
vm_count:
type: number
label: Qty
default: 1
name_server:
type: string
label: Server Name
default: server1
secgroup_id:
type: string
label: Security Group
default: default
v_size:
type: number
label: Volume Size
default: 50
v_type:
type: string
label: Volume Type
default: iscsi
name_net:
type: string
label: Network Name
default: LAN-App
name_subnet:
type: string
label: Subnet Name
default: LAN-subnet-App
resources:
group_vms:
type: OS::Heat:
properties:
count: { get_param: vm_count }
type: OS::Nova::Server
name:
- { get_param: secgroup_id }
- network: { get_param: name_net }
group_volumes:
type: OS::Heat:
properties:
count: { get_param: vm_count }
type: OS::Cinder::Volume
name: volume_app_%index%
size: { get_param: v_size }
group_
type: OS::Heat:
properties:
count: { get_param: vm_count }
type: OS::Cinder:
how can I do the attachment for each volume to each vm from 0 to vm_count-1?
The variable %index% is not allowed in the get_attr. Is there a way to use it correctly?
I need to create all the resources in a single file YAML. I cannot use nested files, everything should be created (VMs, volumes and attachments) in the same YAML file.
Thanks
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: