Files
openstack-lab/heat_templates/ussuri/simple_instance_vol_attach.yaml
2022-11-29 08:11:28 +00:00

74 lines
1.7 KiB
YAML

heat_template_version: queens
parameters:
image:
type: string
default: ubuntu-bionic
description: glance image used to boot the server
flavor:
type: string
default: natp.xp.m1.small
description: flavor to use when booting the server
volume-type:
type: string
default: cinder-t3
description: The volume type to use for the volume that is going to be created
volume-data:
type: string
description: The persistent volume to attach the instance to
resources:
volume_test:
type: OS::Cinder::Volume
properties:
name: volume_test
size: 10
volume_type: { get_param: volume-type }
server_test:
type: OS::Nova::Server
properties:
name: server_test
flavor: { get_param: flavor }
image: { get_param: image }
networks:
- port:
get_resource: server_eth0
volume-attach:
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: { get_resource: server_test }
volume_id: { get_resource: volume_test }
volume-data:
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: { get_resource: server_test }
volume_id: { get_param: volume-data }
secgroup_test:
type: OS::Neutron::SecurityGroup
properties:
description: Allow ssh and ping
name: secgroup_test
rules:
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 22
port_range_max: 22
- remote_ip_prefix: 0.0.0.0/0
protocol: icmp
server_eth0:
type: OS::Neutron::Port
properties:
network_id: test
security_groups: [{ get_resource: secgroup_test }]