openstack-manuals/doc/user-guide/section_heat_cli.xml
Diane Fleming 64b6c9261e Folder rename, file rename, flattening of directories
Current folder name	New folder name	        Book title
----------------------------------------------------------
basic-install 	        DELETE
cli-guide	        DELETE
common	                common
NEW	                admin-guide-cloud	Cloud Administrators Guide
docbkx-example	        DELETE
openstack-block-storage-admin 	DELETE
openstack-compute-admin 	DELETE
openstack-config 	config-reference	OpenStack Configuration Reference
openstack-ha 	        high-availability-guide	OpenStack High Availabilty Guide
openstack-image	        image-guide	OpenStack Virtual Machine Image Guide
openstack-install 	install-guide	OpenStack Installation Guide
openstack-network-connectivity-admin 	admin-guide-network 	OpenStack Networking Administration Guide
openstack-object-storage-admin 	DELETE
openstack-security 	security-guide	OpenStack Security Guide
openstack-training 	training-guide	OpenStack Training Guide
openstack-user 	        user-guide	OpenStack End User Guide
openstack-user-admin 	user-guide-admin	OpenStack Admin User Guide
glossary	        NEW        	OpenStack Glossary

bug: #1220407

Change-Id: Id5ffc774b966ba7b9a591743a877aa10ab3094c7
author: diane fleming
2013-09-08 15:15:50 -07:00

109 lines
7.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml" version="5.0"
xml:id="heat-stack-create">
<title>Create and manage stacks</title>
<procedure>
<title>To create a stack from an example template file</title>
<step>
<para>To create a stack, or template, from an <link
xlink:href="https://github.com/openstack/heat-templates">example template
file</link>, run following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat stack-create mystack --template-file=/path/to/heat/templates/WordPress_Single_Instance.template
--parameters="InstanceType=m1.large;DBUsername=wp;DBPassword=verybadpassword;KeyName=heat_key;LinuxDistribution=F17"</userinput></screen>
<para>The <literal>--parameters</literal> values that you specify
depend on which parameters are defined in the
template. If the template file is hosted on a website,
you can specify the URL with
<literal>--template-url</literal> parameter
instead of the <literal>--template-file</literal>
parameter.</para>
<para>The command returns the following output:</para>
<screen><computeroutput><?db-font-size 65%?>+--------------------------------------+---------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+---------------+--------------------+----------------------+
| 4c712026-dcd5-4664-90b8-0915494c1332 | mystack | CREATE_IN_PROGRESS | 2013-04-03T23:22:08Z |
+--------------------------------------+---------------+--------------------+----------------------+</computeroutput></screen>
</step>
<step>
<para>You can also use the <command>stack-create</command>
command to validate a template file without creating a
stack from it.</para>
<para>To do so, run the following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat stack-create mystack --template-file=/path/to/heat/templates/WordPress_Single_Instance.template</userinput></screen>
<para>If validation fails, the response returns an error
message.</para>
</step>
</procedure>
<procedure>
<title>To list stacks</title>
<step>
<para>To see which stacks are visible to the current user,
run the following command:
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat stack-list</userinput></screen><screen><computeroutput><?db-font-size 65%?>+--------------------------------------+---------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+---------------+-----------------+----------------------+
| 4c712026-dcd5-4664-90b8-0915494c1332 | mystack | CREATE_COMPLETE | 2013-04-03T23:22:08Z |
| 7edc7480-bda5-4e1c-9d5d-f567d3b6a050 | my-otherstack | CREATE_FAILED | 2013-04-03T23:28:20Z |
+--------------------------------------+---------------+-----------------+----------------------+</computeroutput></screen></para>
</step>
</procedure>
<procedure xml:id="heat-stack-details">
<title>To view stack details</title>
<para>To explore the state and history of a particular stack, you can run a number of commands.</para>
<step>
<para>To show the details of a stack, run the following
command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat stack-show mystack</userinput></screen></step>
<step><para>A stack consists of a collection of resources. To list the
resources, including their status, in a stack, run the
following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat resource-list mystack</userinput></screen>
<screen><computeroutput><?db-font-size 65%?>+---------------------+--------------------+-----------------+----------------------+
| logical_resource_id | resource_type | resource_status | updated_time |
+---------------------+--------------------+-----------------+----------------------+
| WikiDatabase | AWS::EC2::Instance | CREATE_COMPLETE | 2013-04-03T23:25:56Z |
+---------------------+--------------------+-----------------+----------------------+</computeroutput></screen>
</step>
<step>
<para>To show the details for the specified resource in a
stack, run the following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat resource-show mystack WikiDatabase</userinput></screen>
<para>Some resources have associated metadata which can
change throughout the life-cycle of a resource:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat resource-metadata mystack WikiDatabase</userinput></screen></step>
<step><para>A series of events is generated during the
life-cycle of a stack. This command will display those
events.</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat event-list mystack</userinput></screen><screen><computeroutput><?db-font-size 65%?>+---------------------+----+------------------------+-----------------+----------------------+
| logical_resource_id | id | resource_status_reason | resource_status | event_time |
+---------------------+----+------------------------+-----------------+----------------------+
| WikiDatabase | 1 | state changed | IN_PROGRESS | 2013-04-03T23:22:09Z |
| WikiDatabase | 2 | state changed | CREATE_COMPLETE | 2013-04-03T23:25:56Z |
+---------------------+----+------------------------+-----------------+----------------------+</computeroutput></screen>
</step><step><para>To show the details for a particular event, run the following
command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat event-show WikiDatabase 1</userinput></screen>
</step>
</procedure>
<procedure xml:id="heat-stack-update">
<title>To update a stack</title>
<step>
<para>To update an existing stack from a modified template
file, run a command like the following
command:</para><screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat stack-update mystack --template-file=/path/to/heat/templates/WordPress_Single_Instance_v2.template
--parameters="InstanceType=m1.large;DBUsername=wp;DBPassword=verybadpassword;KeyName=heat_key;LinuxDistribution=F17"</userinput></screen><screen><computeroutput><?db-font-size 65%?>+--------------------------------------+---------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+---------------+-----------------+----------------------+
| 4c712026-dcd5-4664-90b8-0915494c1332 | mystack | UPDATE_COMPLETE | 2013-04-03T23:22:08Z |
| 7edc7480-bda5-4e1c-9d5d-f567d3b6a050 | my-otherstack | CREATE_FAILED | 2013-04-03T23:28:20Z |
+--------------------------------------+---------------+-----------------+----------------------+</computeroutput></screen>
<para>Some resources are updated in-place, while others
are replaced with new resources.</para>
</step>
</procedure>
</section>