Stack Template

You can quickly create a resource stack based on a stack template.

CloudFormation provides two types of stack templates: sample template and custom template. This topic mainly introduces the custom template. For information about the sample template, see the Sample Template topic.

Supported operations on stack template are as follows:
  • Create a stack template
  • Get the details of a stack template
  • Enable a stack template
  • Disable a stack template
  • Generate a resource stack
  • Modify a stack template
  • Delete a stack template

Create a Stack Template

In the navigation pane of the ZStack Private Cloud UI, choose Platform O&M > CloudFormation > Stack Template. On the Stack Template page, click Create Stack Template. Then, the Create Stack Template page is displayed. Configure the following parameters:
  • Name: Enter a name for the stack template.
  • Description: Optional. Enter a description for the stack template.
  • Create Mode: Select the stack template creation mode.
    The following two methods for creating a stack template are available:
    • Create a template: Create a template in a text editor.
      As shown in Figure 1.
      Figure 1. Create a template


      You can zoom in the text editor, as shown in Figure 2.
      Figure 2. Zoom in the text editor


      Note: For more information about the template syntax, see the Stack Template Syntax topic.
    • Upload a template file: Upload a UTF8-encoded template file.
      As shown in Figure 3.
      Figure 3. Upload a template file


      Note: For more information about the template syntax, see the Stack Template Syntax topic.
As shown in Figure 4. Click OK.
Figure 4. Create a stack template


Get the Details of a Stack Template

On the Stack Template page, select a stack template and expand its details page. You can get the current details of the stack template, including basic attributes, stack template content, and audit.
  • Basic attributes: Displays the current status, name, description, UUID, and md5sum of the stack template. The name and description can be modified.
  • Stack template content: Displays the details of the template.
    Note: For more information about the template syntax, see the Stack Template Syntax topic.
  • Audit: Checks related operations about the template.

Enable/Disable a Stack Template

  • Enable a stack template: If a stack template is disabled, you can enable it as needed.
  • Disable a stack template: You can disable a stack template as needed.
    Note: You are not allowed to create a resource stack by using a disabled stack template.

Generate a Resource Stack

On the Stack Template page, select a stack template and click Actions > Generate Resource Stack. Then, the Generate Resource Stack page is displayed.

To create a resource stack by using a custom template, follow the steps below:
  1. Configure the following parameters:
    • Zone: The current zone is automatically displayed.
    • Name: Enter a name for the resource stack.
    • Description: Optional. Enter a description for the resource stack.
    • Timeout: Specify the timeout during the resource stack creation. If the timeout period expires before the resource stack creation completes, CloudFormation marks the resource stack as failed. The timeout is 60 minutes by default.
    • Rollback on failure: Specify whether to roll back the resource stack if the creation fails. The checkbox is selected by default.
    • Choose a stack template: The selected template is automatically displayed.
    As shown in Figure 5. Click Next.
    Figure 5. Create resource stack 1


  2. Specify each parameter according to the needed stack resource. Different parameters are specified according to different types of resource stacks.
    Note:
    • Mechanism:

      For the stack template you submitted, if CloudFormation decides what resource the Resource filed in Parameters is specified as, the UI will provide a drop-down menu for you to select a corresponding resource. Otherwise, the UI will provide an input box for you to enter a field value (a string or a number).

    The following is an example of creating a resource stack by using a selected custom template above. CloudFormation will automatically create a VM instance and attach a volume to it. Configure the following parameters:

    • Instance Offering: Select the instance offering for VM instance creation.
    • Image: Select the image for VM instance creation.
    • Private IP: Select the private network for VM instance creation.
    As shown in Figure 6. Click OK. Then, the resource stack creation starts.
    Figure 6. Create resource stack 2


    Note:
    • Before the resource stack creation starts, you can click Preview to check the resource list to be created.
    • It will take some time to create a resource stack. Please wait for the completion.

Modify a Stack Template

You can modify a stack template in a text editor.

Delete a Stack Template

You can delete a stack template if you no longer need it.

Constraints

  • The maximum size of a template is 4 MB.
  • If you use the CLI or API to create a stack, you can upload a template with a maximum size of 64 KB.
Download

Already filled the basic info? Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

The download link will be sent to your email. Make sure the address you provided is valid and correct.

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Back to Top