KanagarajManickamhuaweicomhuangtianhuahuaweicom
OpenStack Summit Austin TXApril 27th 2016
Heat Orchestration Template (HOT) Learning
2
About Authors
Kanagaraj Manickam Sr System Architect Huawei Bangalore Indiabull Core-reviewer Heat OpenStackbull Active participant Open-O an Global SDN amp NFV-Orchestrator bull Expert in Data-center Server Storage management and automation bull Founder of namos ndash OpenStack Manager)
Huang Tianhua
Software engineer Huawei Xirsquoan China
Core-reviewer Heat Openstack
Having 3+ years of experience in Openstack Cloud
3
Start to prepare setupbull Download httpsgooglne29yObull Install devstack with https
githubcommkr1481hot-tutorialsblobmasterlocalrc (devstack with heat ceilometer aodh)
bull Upload the image to glace
bull (Ctrl+C from httpsetherpadopenstackorgpaustin-heat)
4
Agenda
bull Heatbull HOT schematicsbull Validation amp Pre-viewbull Heat features
ndash Auto-scalingndash Software deployment
5
Heat
bull An orchestration service to create and manage the lifecycle of OpenStack cloud application ie anything-as-a-service (XaaS)
bull Uses JSONYAML based parameterized HOT template to model the customizable cloud application made of software configurations and infrastructure
bull Represent each provisioned cloud application as
Stack bull Similar to AWS cloud-formation (CFN) service
6
HOT schematic
bull Sections bull Parameter constraintsbull Pseudo parametersbull Intrinsic functionsbull Resource Type bull Environmentbull Provider template
7
HOT schematic Sectionsbull heat_template_version
ndash 2013-05-23ndash 2014-10-16ndash 2015-04-30ndash 2015-10-15ndash 2016-04-08
bull Descriptionbull parameters
ltparam_namegtndash type (string | number | json |
comma_delimited_list | boolean)ndash labelndash descriptionndash defaultndash hidden (truefalse)ndash constraints (length range allowed patters
allowed values and custom constraints)ndash immutable (truefalse)
bull parameter_groups ltparam_group_namegt
ndash labelndash descriptionndash parameters
bull resources ltresource_namegt
ndash type ndash properties
ndash ltnamegtndash ltvaluegt
ndash metadata ndash ltnamegtndash ltvaluegt
ndash depends_on ndash deletion_policy ndash update_policy
bull outputs ltoutput_namegt
ndash descriptionndash value
heat_template_version 2016-04-08
description gt HOT template to attach VM and volume
parameters flavor type string description Flavor for the instance to be created default m1tiny constraints - custom_constraint novaflavor description Must be a flavor known to Nova image type string constraints - custom_constraint glanceimage vol_size type number description The size of the Cinder volume default 1
parameter_groups - label vm_inputs description Vm input parmeters parameters - flavor - image - label vol_inputs parameters - vol_size
heat_template_version 2016-04-08
parameters flavor hellip image hellip vol_size hellip
resources my_instance type OSNovaServer properties image get_param image flavor get_param flavor
my_vol type OSCinderVolume properties size get_param vol_size
vol_att type OSCinderVolumeAttachment properties instance_uuid get_resource my_instance volume_id get_resource my_vol mountpoint devvdb
outputs instance_networks description The IP addresses of the deployed instance value get_attr [my_instance networks]
8
HOT schematic Parameter Constraints
length (String) min ltlower limitgt max ltupper limitgt
range (number) min ltlower limitgt max ltupper limitgt
allowed_values [ ltvaluegt ltvaluegt ]
allowed_pattern ltregular expressiongt
custom_constraint ltconstraint namegt
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
2
About Authors
Kanagaraj Manickam Sr System Architect Huawei Bangalore Indiabull Core-reviewer Heat OpenStackbull Active participant Open-O an Global SDN amp NFV-Orchestrator bull Expert in Data-center Server Storage management and automation bull Founder of namos ndash OpenStack Manager)
Huang Tianhua
Software engineer Huawei Xirsquoan China
Core-reviewer Heat Openstack
Having 3+ years of experience in Openstack Cloud
3
Start to prepare setupbull Download httpsgooglne29yObull Install devstack with https
githubcommkr1481hot-tutorialsblobmasterlocalrc (devstack with heat ceilometer aodh)
bull Upload the image to glace
bull (Ctrl+C from httpsetherpadopenstackorgpaustin-heat)
4
Agenda
bull Heatbull HOT schematicsbull Validation amp Pre-viewbull Heat features
ndash Auto-scalingndash Software deployment
5
Heat
bull An orchestration service to create and manage the lifecycle of OpenStack cloud application ie anything-as-a-service (XaaS)
bull Uses JSONYAML based parameterized HOT template to model the customizable cloud application made of software configurations and infrastructure
bull Represent each provisioned cloud application as
Stack bull Similar to AWS cloud-formation (CFN) service
6
HOT schematic
bull Sections bull Parameter constraintsbull Pseudo parametersbull Intrinsic functionsbull Resource Type bull Environmentbull Provider template
7
HOT schematic Sectionsbull heat_template_version
ndash 2013-05-23ndash 2014-10-16ndash 2015-04-30ndash 2015-10-15ndash 2016-04-08
bull Descriptionbull parameters
ltparam_namegtndash type (string | number | json |
comma_delimited_list | boolean)ndash labelndash descriptionndash defaultndash hidden (truefalse)ndash constraints (length range allowed patters
allowed values and custom constraints)ndash immutable (truefalse)
bull parameter_groups ltparam_group_namegt
ndash labelndash descriptionndash parameters
bull resources ltresource_namegt
ndash type ndash properties
ndash ltnamegtndash ltvaluegt
ndash metadata ndash ltnamegtndash ltvaluegt
ndash depends_on ndash deletion_policy ndash update_policy
bull outputs ltoutput_namegt
ndash descriptionndash value
heat_template_version 2016-04-08
description gt HOT template to attach VM and volume
parameters flavor type string description Flavor for the instance to be created default m1tiny constraints - custom_constraint novaflavor description Must be a flavor known to Nova image type string constraints - custom_constraint glanceimage vol_size type number description The size of the Cinder volume default 1
parameter_groups - label vm_inputs description Vm input parmeters parameters - flavor - image - label vol_inputs parameters - vol_size
heat_template_version 2016-04-08
parameters flavor hellip image hellip vol_size hellip
resources my_instance type OSNovaServer properties image get_param image flavor get_param flavor
my_vol type OSCinderVolume properties size get_param vol_size
vol_att type OSCinderVolumeAttachment properties instance_uuid get_resource my_instance volume_id get_resource my_vol mountpoint devvdb
outputs instance_networks description The IP addresses of the deployed instance value get_attr [my_instance networks]
8
HOT schematic Parameter Constraints
length (String) min ltlower limitgt max ltupper limitgt
range (number) min ltlower limitgt max ltupper limitgt
allowed_values [ ltvaluegt ltvaluegt ]
allowed_pattern ltregular expressiongt
custom_constraint ltconstraint namegt
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
3
Start to prepare setupbull Download httpsgooglne29yObull Install devstack with https
githubcommkr1481hot-tutorialsblobmasterlocalrc (devstack with heat ceilometer aodh)
bull Upload the image to glace
bull (Ctrl+C from httpsetherpadopenstackorgpaustin-heat)
4
Agenda
bull Heatbull HOT schematicsbull Validation amp Pre-viewbull Heat features
ndash Auto-scalingndash Software deployment
5
Heat
bull An orchestration service to create and manage the lifecycle of OpenStack cloud application ie anything-as-a-service (XaaS)
bull Uses JSONYAML based parameterized HOT template to model the customizable cloud application made of software configurations and infrastructure
bull Represent each provisioned cloud application as
Stack bull Similar to AWS cloud-formation (CFN) service
6
HOT schematic
bull Sections bull Parameter constraintsbull Pseudo parametersbull Intrinsic functionsbull Resource Type bull Environmentbull Provider template
7
HOT schematic Sectionsbull heat_template_version
ndash 2013-05-23ndash 2014-10-16ndash 2015-04-30ndash 2015-10-15ndash 2016-04-08
bull Descriptionbull parameters
ltparam_namegtndash type (string | number | json |
comma_delimited_list | boolean)ndash labelndash descriptionndash defaultndash hidden (truefalse)ndash constraints (length range allowed patters
allowed values and custom constraints)ndash immutable (truefalse)
bull parameter_groups ltparam_group_namegt
ndash labelndash descriptionndash parameters
bull resources ltresource_namegt
ndash type ndash properties
ndash ltnamegtndash ltvaluegt
ndash metadata ndash ltnamegtndash ltvaluegt
ndash depends_on ndash deletion_policy ndash update_policy
bull outputs ltoutput_namegt
ndash descriptionndash value
heat_template_version 2016-04-08
description gt HOT template to attach VM and volume
parameters flavor type string description Flavor for the instance to be created default m1tiny constraints - custom_constraint novaflavor description Must be a flavor known to Nova image type string constraints - custom_constraint glanceimage vol_size type number description The size of the Cinder volume default 1
parameter_groups - label vm_inputs description Vm input parmeters parameters - flavor - image - label vol_inputs parameters - vol_size
heat_template_version 2016-04-08
parameters flavor hellip image hellip vol_size hellip
resources my_instance type OSNovaServer properties image get_param image flavor get_param flavor
my_vol type OSCinderVolume properties size get_param vol_size
vol_att type OSCinderVolumeAttachment properties instance_uuid get_resource my_instance volume_id get_resource my_vol mountpoint devvdb
outputs instance_networks description The IP addresses of the deployed instance value get_attr [my_instance networks]
8
HOT schematic Parameter Constraints
length (String) min ltlower limitgt max ltupper limitgt
range (number) min ltlower limitgt max ltupper limitgt
allowed_values [ ltvaluegt ltvaluegt ]
allowed_pattern ltregular expressiongt
custom_constraint ltconstraint namegt
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
4
Agenda
bull Heatbull HOT schematicsbull Validation amp Pre-viewbull Heat features
ndash Auto-scalingndash Software deployment
5
Heat
bull An orchestration service to create and manage the lifecycle of OpenStack cloud application ie anything-as-a-service (XaaS)
bull Uses JSONYAML based parameterized HOT template to model the customizable cloud application made of software configurations and infrastructure
bull Represent each provisioned cloud application as
Stack bull Similar to AWS cloud-formation (CFN) service
6
HOT schematic
bull Sections bull Parameter constraintsbull Pseudo parametersbull Intrinsic functionsbull Resource Type bull Environmentbull Provider template
7
HOT schematic Sectionsbull heat_template_version
ndash 2013-05-23ndash 2014-10-16ndash 2015-04-30ndash 2015-10-15ndash 2016-04-08
bull Descriptionbull parameters
ltparam_namegtndash type (string | number | json |
comma_delimited_list | boolean)ndash labelndash descriptionndash defaultndash hidden (truefalse)ndash constraints (length range allowed patters
allowed values and custom constraints)ndash immutable (truefalse)
bull parameter_groups ltparam_group_namegt
ndash labelndash descriptionndash parameters
bull resources ltresource_namegt
ndash type ndash properties
ndash ltnamegtndash ltvaluegt
ndash metadata ndash ltnamegtndash ltvaluegt
ndash depends_on ndash deletion_policy ndash update_policy
bull outputs ltoutput_namegt
ndash descriptionndash value
heat_template_version 2016-04-08
description gt HOT template to attach VM and volume
parameters flavor type string description Flavor for the instance to be created default m1tiny constraints - custom_constraint novaflavor description Must be a flavor known to Nova image type string constraints - custom_constraint glanceimage vol_size type number description The size of the Cinder volume default 1
parameter_groups - label vm_inputs description Vm input parmeters parameters - flavor - image - label vol_inputs parameters - vol_size
heat_template_version 2016-04-08
parameters flavor hellip image hellip vol_size hellip
resources my_instance type OSNovaServer properties image get_param image flavor get_param flavor
my_vol type OSCinderVolume properties size get_param vol_size
vol_att type OSCinderVolumeAttachment properties instance_uuid get_resource my_instance volume_id get_resource my_vol mountpoint devvdb
outputs instance_networks description The IP addresses of the deployed instance value get_attr [my_instance networks]
8
HOT schematic Parameter Constraints
length (String) min ltlower limitgt max ltupper limitgt
range (number) min ltlower limitgt max ltupper limitgt
allowed_values [ ltvaluegt ltvaluegt ]
allowed_pattern ltregular expressiongt
custom_constraint ltconstraint namegt
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
5
Heat
bull An orchestration service to create and manage the lifecycle of OpenStack cloud application ie anything-as-a-service (XaaS)
bull Uses JSONYAML based parameterized HOT template to model the customizable cloud application made of software configurations and infrastructure
bull Represent each provisioned cloud application as
Stack bull Similar to AWS cloud-formation (CFN) service
6
HOT schematic
bull Sections bull Parameter constraintsbull Pseudo parametersbull Intrinsic functionsbull Resource Type bull Environmentbull Provider template
7
HOT schematic Sectionsbull heat_template_version
ndash 2013-05-23ndash 2014-10-16ndash 2015-04-30ndash 2015-10-15ndash 2016-04-08
bull Descriptionbull parameters
ltparam_namegtndash type (string | number | json |
comma_delimited_list | boolean)ndash labelndash descriptionndash defaultndash hidden (truefalse)ndash constraints (length range allowed patters
allowed values and custom constraints)ndash immutable (truefalse)
bull parameter_groups ltparam_group_namegt
ndash labelndash descriptionndash parameters
bull resources ltresource_namegt
ndash type ndash properties
ndash ltnamegtndash ltvaluegt
ndash metadata ndash ltnamegtndash ltvaluegt
ndash depends_on ndash deletion_policy ndash update_policy
bull outputs ltoutput_namegt
ndash descriptionndash value
heat_template_version 2016-04-08
description gt HOT template to attach VM and volume
parameters flavor type string description Flavor for the instance to be created default m1tiny constraints - custom_constraint novaflavor description Must be a flavor known to Nova image type string constraints - custom_constraint glanceimage vol_size type number description The size of the Cinder volume default 1
parameter_groups - label vm_inputs description Vm input parmeters parameters - flavor - image - label vol_inputs parameters - vol_size
heat_template_version 2016-04-08
parameters flavor hellip image hellip vol_size hellip
resources my_instance type OSNovaServer properties image get_param image flavor get_param flavor
my_vol type OSCinderVolume properties size get_param vol_size
vol_att type OSCinderVolumeAttachment properties instance_uuid get_resource my_instance volume_id get_resource my_vol mountpoint devvdb
outputs instance_networks description The IP addresses of the deployed instance value get_attr [my_instance networks]
8
HOT schematic Parameter Constraints
length (String) min ltlower limitgt max ltupper limitgt
range (number) min ltlower limitgt max ltupper limitgt
allowed_values [ ltvaluegt ltvaluegt ]
allowed_pattern ltregular expressiongt
custom_constraint ltconstraint namegt
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
6
HOT schematic
bull Sections bull Parameter constraintsbull Pseudo parametersbull Intrinsic functionsbull Resource Type bull Environmentbull Provider template
7
HOT schematic Sectionsbull heat_template_version
ndash 2013-05-23ndash 2014-10-16ndash 2015-04-30ndash 2015-10-15ndash 2016-04-08
bull Descriptionbull parameters
ltparam_namegtndash type (string | number | json |
comma_delimited_list | boolean)ndash labelndash descriptionndash defaultndash hidden (truefalse)ndash constraints (length range allowed patters
allowed values and custom constraints)ndash immutable (truefalse)
bull parameter_groups ltparam_group_namegt
ndash labelndash descriptionndash parameters
bull resources ltresource_namegt
ndash type ndash properties
ndash ltnamegtndash ltvaluegt
ndash metadata ndash ltnamegtndash ltvaluegt
ndash depends_on ndash deletion_policy ndash update_policy
bull outputs ltoutput_namegt
ndash descriptionndash value
heat_template_version 2016-04-08
description gt HOT template to attach VM and volume
parameters flavor type string description Flavor for the instance to be created default m1tiny constraints - custom_constraint novaflavor description Must be a flavor known to Nova image type string constraints - custom_constraint glanceimage vol_size type number description The size of the Cinder volume default 1
parameter_groups - label vm_inputs description Vm input parmeters parameters - flavor - image - label vol_inputs parameters - vol_size
heat_template_version 2016-04-08
parameters flavor hellip image hellip vol_size hellip
resources my_instance type OSNovaServer properties image get_param image flavor get_param flavor
my_vol type OSCinderVolume properties size get_param vol_size
vol_att type OSCinderVolumeAttachment properties instance_uuid get_resource my_instance volume_id get_resource my_vol mountpoint devvdb
outputs instance_networks description The IP addresses of the deployed instance value get_attr [my_instance networks]
8
HOT schematic Parameter Constraints
length (String) min ltlower limitgt max ltupper limitgt
range (number) min ltlower limitgt max ltupper limitgt
allowed_values [ ltvaluegt ltvaluegt ]
allowed_pattern ltregular expressiongt
custom_constraint ltconstraint namegt
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
7
HOT schematic Sectionsbull heat_template_version
ndash 2013-05-23ndash 2014-10-16ndash 2015-04-30ndash 2015-10-15ndash 2016-04-08
bull Descriptionbull parameters
ltparam_namegtndash type (string | number | json |
comma_delimited_list | boolean)ndash labelndash descriptionndash defaultndash hidden (truefalse)ndash constraints (length range allowed patters
allowed values and custom constraints)ndash immutable (truefalse)
bull parameter_groups ltparam_group_namegt
ndash labelndash descriptionndash parameters
bull resources ltresource_namegt
ndash type ndash properties
ndash ltnamegtndash ltvaluegt
ndash metadata ndash ltnamegtndash ltvaluegt
ndash depends_on ndash deletion_policy ndash update_policy
bull outputs ltoutput_namegt
ndash descriptionndash value
heat_template_version 2016-04-08
description gt HOT template to attach VM and volume
parameters flavor type string description Flavor for the instance to be created default m1tiny constraints - custom_constraint novaflavor description Must be a flavor known to Nova image type string constraints - custom_constraint glanceimage vol_size type number description The size of the Cinder volume default 1
parameter_groups - label vm_inputs description Vm input parmeters parameters - flavor - image - label vol_inputs parameters - vol_size
heat_template_version 2016-04-08
parameters flavor hellip image hellip vol_size hellip
resources my_instance type OSNovaServer properties image get_param image flavor get_param flavor
my_vol type OSCinderVolume properties size get_param vol_size
vol_att type OSCinderVolumeAttachment properties instance_uuid get_resource my_instance volume_id get_resource my_vol mountpoint devvdb
outputs instance_networks description The IP addresses of the deployed instance value get_attr [my_instance networks]
8
HOT schematic Parameter Constraints
length (String) min ltlower limitgt max ltupper limitgt
range (number) min ltlower limitgt max ltupper limitgt
allowed_values [ ltvaluegt ltvaluegt ]
allowed_pattern ltregular expressiongt
custom_constraint ltconstraint namegt
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
8
HOT schematic Parameter Constraints
length (String) min ltlower limitgt max ltupper limitgt
range (number) min ltlower limitgt max ltupper limitgt
allowed_values [ ltvaluegt ltvaluegt ]
allowed_pattern ltregular expressiongt
custom_constraint ltconstraint namegt
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
9
HOT schematic Pseudo parameters
Available by default - OSStack_id Id of Stack the template belongs to- OSstack_name Name of Stack the template belongs to-OSproject_id User project Id
How to get the value of these parameters-Use lsquoopenstack stack show ltstack namegtrsquo and refer from the parameters in the output
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
10
HOT schematic Intrinsic functions
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
11
get_file
files ldquofilepathtouserdatashrdquo ltfile content of userdatashgt
resources my_instance type OSNovaServer properties user_data get_file userdatash
user_data ltfile content of userdatashgt
NOTE - OpenStack heat CLI or REST API provides the lsquofilesrsquo map used here- file path could either in absolute file path or url format
Data Reference Intrinsic functions
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
12
Data Reference Intrinsic functions get_param
instance_type m1tinyserver_data metadata foo bar keys [a_keyother_key]
parameters instance_type type string server_data type json resources my_instance type OSNovaServer properties flavor get_param instance_type metadata get_param [ server_data metadata ] key_name get_param [ server_data keys 0 ]
flavor ldquom1tiny ldquo metadata foo bar key_name a_key
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
13
Data Manipulation Intrinsic functions
str_split [ stringtosplit 0] lsquostringrsquo
list_join [lsquo- [lsquoa blsquo c] [lsquodrsquo lsquoersquo]] a-b-c-d-e
str_replace template httphostportv1 params host 192168101 port 8088
http1921681018088v1
map_merge [k1 v1 k2 v2 k1 v2] k1 v2 k2 v2lsquo
Data Manipulation functions
repeat for_each ltportgt [80 443] ltprotocolgt [lsquoudprsquo lsquotcprsquo] template protocol ltprotocolgt port_range_min ltportgt
protocoludp port_range_min80 protocoltcp port_range_min80protocoludb port_range_min443protocoltcp port_range_min80
Utility functionsdigest [sha512lsquo lsquopasswordrsquo]
(supports md5 sha1 sha224 sha256 Sha384 also)
B109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706helliphellip
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
14
get_resource
Dependency reference Intrinsic functions
resources instance_port type OSNeutronPort properties instance type OSNovaServer properties networks port get_resource instance_port
resources server type OSNovaServer properties hellip member type OSNeutronPoolMember properties address get_attr [server first_address]outputs ip value get_attr [server networks private 0]
get_attr
resource_fecadeChildyaml------------------resources instance type OSNovaServer properties hellip metadata resource_facade metadata update_policy resource_facade update_policy deletion_policy resource_facade deletion_policy
depends_on (Not an intrinsic function)
resources instance1 type OSNovaServer depends_on [instance2 instance3] instance2 type OSNovaServer instance3 type OSNovaServer
parentyaml------------------resources parent type childyaml metadata hellip update_policy hellip deletion_policy hellip
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
15
Resource typebull Helps to model OpenStack elements such as nova instance cinder volume neutron network etc in templatebull Represented by namespace Cloud Provider Service Resource (Examples OSNovaServer
OSCinderVolume)
bull Supported with Life cycle operations (inline with stack life cycle operations)
ndash Create Update Deletendash Snapshot restorendash Abandon adoptndash Check
bull Has Typed Properties with built-in constraintsndash Types Integer String Number Boolean Map Listndash Updatable (yn defaultyes)ndash Required (yn default no)ndash Metadatandash deletion_policy ndash update_policy
bull Provides Typed Outputndash Types Integer String Boolean Map Listndash Special one lsquoshowrsquondash get_attr() helps
OSNovaServer properties image typeString constraints glanceimage attributes first_address type String description first IP
resources sample type OSNovaServer image cirrosoutputs ip value get_attr [sample_doamin serial]
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
16
Environmentbull Global (etcheatheatconfenvironment_dir)bull User env (heat stack-create ndashe envyaml)bull Parametersbull resource_registry
ndash Resource mappingndash Override resourcendash restricted_actionsndash hooks
bull event_sinks
parameters flavor m1large image cirros
resource_registryldquoOSQuantaumrdquo ldquoOSneutronrdquoAWSEC2Instance filepathtomy_instanceyaml ldquodb_serverrdquo OSDBInstance filepathtodbyaml restricted_actions [update replace] hooks [ pre-create pre-update pre-delete post-create post-update post-delete]
event_sinks-type zaqar-queue -target myqueue -ttl 1200
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
17
Provider template
heat_template_version 2015-04-30
resources my_server type my_novayaml properties key_name my_key
resource_registry OSNovaServer my_novayaml
heat_template_version 2015-04-30
resources my_server type OSNovaServer properties key_name my_key
outputs test_out value get_attr [ my_server resourceserver first_address] OSstack_id value get_resource my_server
heat_template_version 2015-04-30
parameters key_name type string description Name of a KeyPair
resources server type OSNovaServer properties key_name get_param key_name flavor m1small image ubuntu-trusty-x86_64
my_novayamlbullBifurcate complex template into easy-manageable-small templatebull New Resourc e type
bull Direct referencebull using environment
bull Access the provider templatersquos resource attributesbull Make provider template based resources as transparent
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
18
Validation amp PreviewValidation
heat template-validate ndashtemplate-file lttemplate filegt openstack orchestration template validate -t lttemplate filegt - Produces list of input parameters for this template
Pre-view heat stack-preview ndashtemplate-file lttemplate filegt ltstack_namegt openstack stack create -t lttemplate filegt --dry-run ltstack_namegt - Produces the pre-view of all resources in the template
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
19
Heat features by means of HOT
bull Using Resource Typendash auto-scaling ndash software configuration amp deploymentndash resource groupingndash remote stackndash none resourcendash random stringndash wait condition
bull Using Environmentndash hookbreakpoint
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
20
Auto-scaling
bull Scale updown computestoragenetwork capabilities of cloud application based on the pre-defined threshold level which is monitored continuously
bull For defining threshold and monitoring user could choose either Ceilometer or Monasca
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
21
Auto-scaling based on Monasca
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarm Notification
bull Alarm definitionbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
OSMonascaNotification Properties
type (webhook email) address signal alarm url
OSMonascaNotification
signal alarm url
OSMonascaAlarmDefinition Properties
name expression match_by=scale_group alarm_actions
OSMonascaAlarmDefinition
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata scale_group ltstack-idgt
OSMonascaAlarmDefinitionexpression avg(vmcpuutilization_percscale_group=ltstack-idgt) gt 90
Monasca alarm definition wikiPresented an demo OpenStack Summit Tokyo JP
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
22
Auto-scaling based on Ceilometer
OSHeatAutoScalingGroup Properties
resource (scaling element) desired_capacity (initial count) max_size min_szie
Outputs current_size outputsoutput_list
bull Scale Group
bull Scaling policy
bull Alarmbull Metadata-
Dimension
OSHeatAutoScalingGroup
OSHeatScalingPolicy Properties
auto_scaling_group_id cooldown (timing-window for
scaling) adjustement_type Scaling_adjustment (+- 1 n x)
Outputs alarm_url ( CFN signal type) signal_url (HOT signal type)
OSHeatScalingPolicy
signal alarm url OSCeilometerAlarm
signal alarm url
OSMonascaAlarm Properties
meter_name statistic period evalutation_periods threshold Comparision_operator alarm_actions
OSHeatAutoScalingGroup resource
type OSNovaServer
properties
metadata meteringstack get_param OSstack_id
OSMonascaAlarmMaticing_metadata metadatauser_metadatastack get_param OSstack_id
Ceilometer alarm definition wiki
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
23
Auto-scaling work-flow
Heat
MonascaCeilometer
VMVMVM
heat_template_version 2015-10-15resources group type OSHeatAutoScalingGroup scaleup_policy type OSHeatScalingPolicy notification type OSMonascaNotification cpu_alarm_high type OSMonascaAlarmDefinition
13
4
5
6
2 7
1 Call Heat with a cloud application HOT template2 Heat creates cloud application stack with scale group
and scale policy3 Heat creates alarm definitions and scaling
notifications in CeilometerMonasca4 CeilometerMonasca starts to monitor the scale group elements [[CLOUD APPLICATION AUTO-SCALING SETUP IS DONE]]5 When Scale group reaches the alarm threshold CeilometerMonasca detects and generates alarm6 CeilometerMonasca signals cloud application stack in heat7 Heat either scale up or scale down based on the signal(here increment scale group elements by 1)5-7 runs for ever (auto-scale)
5
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
24
bull Custom image buildingbull User-data boot scripts and cloud-initbull Software deployment resources
Software Config amp Deployment
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
25
Software Config amp DeploymentCustom image building
bull Boot speedbull Boot reliability bull Test verificationbull Configuration dependencies
Tool diskimage-builder
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
26
Software Config amp DeploymentUser-data boot scripts and cloud-init
resources my_instance type OSNovaServer properties user data | binbash echo ldquoRunning boot scriptrdquo user_data_format RAW
user_data str_replace template get_filethe_server_bootsh
params $FOO get_param foo
user_data str_replace template | binbash echo ldquoScript with $FOO params $FOO get_param foo
cloud-configpart-handlercloud-boothookhelliphellip
HEAT_CFNTOOLSRAWSOFTWARE_CONFIG
my_server type OSNovaServer properties user_data_format RAW user_data get_resource xxx
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSHeatCloudConfig
boot_config type OSHeatCloudConfig properties cloud_config write_files - path tmpfile content get_param file_content
OSHeatMultipartMime
server_init type OSHeatMultipartMime properties parts - config get_resourceboot_config - config get_resource boot_script - config get_param other_config
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
Software Config amp DeploymentSoftware deployment resources
deployment type OSHeatSoftwareDeployment properties config get_resource config server get_resource server input_values foo fooooo bar baaaaa actions [CREATE UPDATE DELETEhellip] signal_transport HEAT_SIGNAL ZAQAR_SIGNAL TEMP_URL_SIGNALhellip
OSHeatSoftwareDeployment
boot_script type OSHeatSoftwareConfig properties group ungrouped config | binbash echo Running boot scriptldquo
OSHeatSoftwareConfig
OSNovaServer
my_server type OSNovaServer properties user_data_format SOFTWARE_CONFIG
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
Software Config amp DeploymentSoftware deployment ndash build custom image
pip install git+httpsgitopenstackorgopenstackdiskimage-buildergit clone httpsgitopenstackorgopenstacktripleo-image-elementsgit clone httpsgitopenstackorgopenstackheat-templatesexport ELEMENTS_PATH=tripleo-image-elementselementsheat-templateshotsoftware-configelements
disk-image-create vm fedora selinux-permissive heat-config os-collect-config os-refresh-config os-apply-config heat-config-cfn-init heat-config-puppet heat-config-script -o fedora-software-configqcow2
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
29
Software Deployment work-flow
Heat
heat_template_version 2015-10-15resources server type OSNovaServer config type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
1
1 Call Heat with a cloud application HOT template
2 Heat creates cloud application stack with software config software deployment and server
3 VM is booting cloud-init consumes the user-data
4 os-collect-config starts to pull the configuration metadata to vm
5 Corresponding hooks to perform configuration
6 Heat config tools signals software deployment resource to tell the result
7 Call Heat update-stack to update the configuration
8 Step 4-6 repeats
2
os-collect-configos-apply-config
os-refresh-configHookshellip
VM
4
6
heat_template_version 2015-10-15resources server type OSNovaServer config_update type OSHeatSoftwareConfig deployment type OSHeatSoftwareDeployment
7
5
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
30
THANK YOU
Useful referenceshttpdocsopenstackorgdeveloperheattemplate_guideindexhtmlhttpdocsopenstackorgdeveloperheattemplate_guidesoftware_deploymenthtmhttpsgithubcommkr1481hot-tutorialshttpsgithubcomopenstackheat-templates
Kanagaraj ManickammrkanagIRC KanagarajM
Huang Tianhua IRC tiantian
Top Related