Skip to content

Instantly share code, notes, and snippets.

@cloudqubes
Last active August 6, 2020 05:05
Show Gist options
  • Save cloudqubes/907cabbd0958e8e59674910201cce950 to your computer and use it in GitHub Desktop.
Save cloudqubes/907cabbd0958e8e59674910201cce950 to your computer and use it in GitHub Desktop.
heat_template_version: 2016-04-08
description:
A VM with two volumes
parameters:
stack_name:
type: string
default: test_app
OAM_Network:
type: string
default: oam_net
OAM_SubNetwork:
type: string
default: oam_net_v4
Image:
type: string
default: bionic-server-cloudimg-amd64
resources:
flavor:
type: OS::Nova::Flavor
properties:
name: { get_param: stack_name }
vcpus: 16
ram: 16384
disk: 50
extra_specs: { "hw:cpu_policy" : "dedicated", "hw:mem_page_size": "1048576" }
#Cinder volume
vm_volume_1:
type: OS::Cinder::Volume
properties:
name:
list_join: ['_', [{get_param: stack_name}, 'vda']]
image: { get_param: Image }
size: 85
vm_volume_2:
type: OS::Cinder::Volume
properties:
name:
list_join: ['_', [{get_param: stack_name}, 'vda2']]
size: 5
vm_test_1:
type: OS::Nova::Server
properties:
name:
list_join: ['-', [{get_param: stack_name}, '1']]
block_device_mapping_v2:
- device_name: vda
boot_index: 0
delete_on_termination: False
volume_id : { get_resource : vm_volume_1 }
- device_name: vdb
boot_index: 1
delete_on_termination: False
volume_id : { get_resource : vm_volume_2 }
availability_zone: "zone-A"
flavor: { get_resource: flavor }
networks:
- port: { get_resource: vm_test_oam_port_1 }
vm_test_oam_port_1:
type: OS::Neutron::Port
properties:
name:
list_join: ['-', [{get_param: stack_name}, '1', '1']]
network: { get_param: OAM_Network }
fixed_ips:
- ip_address: "10.10.1.2"
port_security_enabled: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment