Skip to content

Instantly share code, notes, and snippets.

@allthingsclowd
Created July 18, 2017 20:07
Show Gist options
  • Save allthingsclowd/12106e8e1d675345c06135614aae5009 to your computer and use it in GitHub Desktop.
Save allthingsclowd/12106e8e1d675345c06135614aae5009 to your computer and use it in GitHub Desktop.
OpenStack HEAT Example Outputs - Disk Properties & Attributes
heat_template_version: 2013-05-23
# Author: Graham Land
# Date: 18/07/2017
# Purpose: Example HEAT Stack that demonstrates how to output a disk UUID
#
# Twitter: @allthingsclowd
# Blog: https://allthingscloud.eu
#
#
description: Simple Disk UUID Output Demo
# Input parameters
parameters:
k5_image:
type: string
label: Image name or ID
description: Image to be used for compute instance
default: "Ubuntu Server 14.04 LTS (English) 02"
az:
type: string
label: Availability Zone
description: Region AZ to use
default: "uk-1a"
# K5 Infrastructure resources to be built
resources:
# Create a cinder persistent disk volume
example-vol:
type: OS::Cinder::Volume
properties:
availability_zone: { get_param: az }
name: "New-Example-Volume"
size: 3
volume_type: "M1"
image : { get_param: k5_image }
outputs:
example-vol-details-uuid:
description: "Disk UUID"
value: { get_resource: example-vol }
example-vol-details-size:
description: "Disk Size"
value: { get_attr: [example-vol, size]}
@allthingsclowd
Copy link
Author

This stack produces the following outputs from the HEAT API -

#OUTPUT

https://orchestration.uk-1.cloud.global.fujitsu.com/v1/6e970849a2504abb921702b9ff973e83/stacks/DemoDiskUUID/3e443427-051f-4062-a4b5-77a74b075738?resolve_outputs=True
{u'stack': {u'disable_rollback': True, u'description': u'Simple Disk UUID Output Demo', u'parameters': {u'k5_image': u'Ubuntu Server 14.04 LTS (English) 02', u'az': u'uk-1a', u'OS::stack_id': u'
3e443427-051f-4062-a4b5-77a74b075738', u'OS::stack_name': u'DemoDiskUUID'}, u'stack_status_reason': u'Stack CREATE completed successfully', u'stack_name': u'DemoDiskUUID', u'outputs': [{u'output
_value': u'6c1a0b37-4f2a-4d8f-bb73-046f07bb46ab', u'description': u'Disk UUID', u'output_key': u'example-vol-details-uuid'}, {u'output_value': u'3', u'description': u'Disk Size', u'output_key':
u'example-vol-details-size'}], u'creation_time': u'2017-07-18T20:02:33Z', u'links': [{u'href': u'https://orchestration.uk-1.cloud.global.fujitsu.com/v1/6e970849a2504abb921702b9ff973e83/stacks/De
moDiskUUID/3e443427-051f-4062-a4b5-77a74b075738', u'rel': u'self'}], u'capabilities': [], u'notification_topics': [], u'timeout_mins': 10, u'stack_status': u'CREATE_COMPLETE', u'updated_time': N
one, u'id': u'3e443427-051f-4062-a4b5-77a74b075738', u'template_description': u'Simple Disk UUID Output Demo'}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment