31
Application Orchestration Service User Guide Issue 01 Date 2018-04-26 HUAWEI TECHNOLOGIES CO., LTD.

User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Application Orchestration Service

User Guide

Issue 01

Date 2018-04-26

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Copyright © Huawei Technologies Co., Ltd. 2018. All rights reserved.No part of this document may be reproduced or transmitted in any form or by any means without prior writtenconsent of Huawei Technologies Co., Ltd. Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.All other trademarks and trade names mentioned in this document are the property of their respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei and thecustomer. All or part of the products, services and features described in this document may not be within thepurchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,and recommendations in this document are provided "AS IS" without warranties, guarantees orrepresentations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

Huawei Technologies Co., Ltd.Address: Huawei Industrial Base

Bantian, LonggangShenzhen 518129People's Republic of China

Website: http://www.huawei.com

Email: [email protected]

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

i

Page 3: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Contents

1 Introduction.................................................................................................................................... 1

2 Getting Started............................................................................................................................... 32.1 Deploying a Container Cluster....................................................................................................................................... 32.2 Orchestrating and Deploying the Magento E-Commerce System..................................................................................6

3 Stack Management...................................................................................................................... 123.1 Creating a Solution Stack............................................................................................................................................. 123.2 Viewing Stack Details...................................................................................................................................................143.3 Starting or Stopping a Stack......................................................................................................................................... 153.4 Upgrading a Stack........................................................................................................................................................ 153.5 Rolling Back a Stack.................................................................................................................................................... 163.6 Scaling a Stack..............................................................................................................................................................163.7 Deleting a Stack............................................................................................................................................................17

4 Designer........................................................................................................................................ 184.1 AOS Designer Introduction.......................................................................................................................................... 184.2 Designer GUI Overview...............................................................................................................................................194.3 Understanding Cloud Services/Elements..................................................................................................................... 204.4 (Exercise) Getting Started with the Designer............................................................................................................... 25

5 Reference.......................................................................................................................................265.1 Manually Compiling an Nginx Template..................................................................................................................... 26

Application Orchestration ServiceUser Guide Contents

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

ii

Page 4: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

1 Introduction

This chapter describes the process for using Application Orchestration Service (AOS),helping you better understand AOS.

With AOS, you can deploy applications on the cloud by compiling a template and creatingstacks accordingly, as shown in Figure 1-1. In addition, AOS provides application lifecyclemanagement capabilities, such as upgrading, scaling, and rollback.

Figure 1-1 Process of using AOS

Application Orchestration ServiceUser Guide 1 Introduction

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

1

Page 5: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Table 1-1 Process of using AOS

Procedure Description

1. Compilea template.

A template is a text file that complies with AOS syntax. It defines applicationattributes, cloud service configurations, and dependencies betweenapplications and cloud services.Templates are classified into common templates and solution templates. Theonly difference between the two types of templates is that solution templatesdefine stack elements in node_templates. For more information abouttemplates, see Template Reference.You can compile a template using any of the following methods:l Select a sample template: AOS provides multiple sample templates that

allow you to quickly create stacks.l Use the designer to create a template: Compared with customizing a

template, this method simplifies template writing and editing and enablesyou to intuitively view the relationships between resources. To learn moreabout how to use the designer, see 4 Designer.

l Customize a template: You can compile a template in JSON or YAMLformat. Before compiling a template, you are advised to study GettingStarted with a Template. You can customize a template either directlyon GUIs or first edit a template on a local computer and then upload thetemplate to the system.NOTICE

Note that the YAML syntax does not support the Tab key. The hierarchy must bealigned with spaces. The number of spaces is an integer multiple of 2, such as 2, 4,6, and 8.

2. Create astack.

A stack is a collection of applications and cloud service resources. Theapplications or cloud services in a stack are treated as a whole when they arebeing created, upgraded, or deleted.Similar to templates, stacks are also classified into common stacks andsolution stacks. Solution stacks reuse the existing templates to integratedifferent software systems. They are applicable to large-scale softwaresystems in complex scenarios.For more information about stacks, see 3 Stack Management.

Application Orchestration ServiceUser Guide 1 Introduction

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

2

Page 6: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

2 Getting Started

2.1 Deploying a Container Cluster

2.2 Orchestrating and Deploying the Magento E-Commerce System

2.1 Deploying a Container ClusterThis section describes how to deploy a container cluster based on a sample template. After acontainer cluster is deployed, you can view the container cluster and an available node thathas been bound with an elastic IP address on the CCE console, as shown in Figure 2-1. Acontainer cluster is created to prepare resources for containerized applications.

NOTE

For more information about how to deploy a container cluster using AOS, read AOS Best Practices tounderstand how to drag components and compile a template using the AOS designer.

Figure 2-1 Available cluster and node

Before using AOS, complete the following steps:

1. Registering and Topping up Your HUAWEI CLOUD Account: Ensure that you haveat least CNY100 in your HUAWEI CLOUD account; otherwise, Elastic Cloud Server(ECS) cannot be created.

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

3

Page 7: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

2. Creating a Key Pair: A key pair is used for identity authentication during the remotelogin to ECS. If a key pair is already available, skip this step.

3. Creating a Container Cluster Stack using sample template.4. Related Operations: Read AOS Best Practices to understand how to drag components

and compile a template using the AOS designer.

Registering and Topping up Your HUAWEI CLOUD AccountYou must register a HUAWEI CLOUD account before using AOS. If you already have aHUAWEI CLOUD account, log in to HUAWEI CLOUD console to check the accountbalance and ensure that you have at least ¥100 in your account.

Step 1 Click here to register a HUAWEI CLOUD account.

Step 2 Top up the account. For details, see How Do I Top up an Account.

Ensure that you have at least ¥100 in your HUAWEI CLOUD account; otherwise, no clustercan be created.

----End

Creating a Key PairBefore creating an ECS using AOS, create a key pair for identity authentication during remotelogin to a node.

NOTE

If a key pair is already available, skip this operation.

Step 1 Log in to the management console at https://console.huaweicloud.com.

Step 2 Choose Service List > Computing > Elastic Cloud Server from the main menu.

Step 3 In the navigation pane, choose Key Pair. On the Key Pair page, click Create Key Pair.

Step 4 Enter a key pair name and click OK.

Step 5 In the dialog box that is displayed, click OK.

View and save the key pair. To ensure security, a key pair can be downloaded only once. Keepit secure to ensure successful login.

----End

Creating a Container Cluster Stack

Step 1 Log in to the AOS console. In the navigation pane, choose Templates > Sample Templates.

Step 2 On the Sample Templates page, click View Details in the Create Container Cluster area.

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

4

Page 8: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Figure 2-2 Selecting a sample template

Step 3 Check the template details on the Sample Template Details page, including a VPC, a subnet,a cluster, and a node. Click Create Stack.

Figure 2-3 Creating a stack

Step 4 Set the stack information.l Stack name: You can set a stack name as required, for example, aos-cluster.l Description: The description can be left blank.l Set the input parameters. You can retain the default values for the parameters.

Step 5 Click Next and check the stack information. If the stack information is correct, click CreateStack.

The system automatically jumps to the stack details page. On the page, you can find that thestack is being created. It will take about 10 minutes to create a stack.

Step 6 When the stack status becomes Normal, four cloud services exist in the stack elements. TheVPC, subnet, cluster, and node have been created.

Step 7 Log in to the CCE console to view the created cluster and node.1. Choose Resource Management > VM Cluster in the navigation pane to view the

container cluster that is successfully created.

Figure 2-4 Container cluster successfully created

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

5

Page 9: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

2. Choose Resource Management > Node Management in the navigation pane to viewthe node that is successfully created.

Figure 2-5 Node successfully created

----End

Related OperationsFor more information about how to deploy a container cluster using AOS, read AOS BestPractices to understand how to drag components and compile a template using the AOSdesigner.

2.2 Orchestrating and Deploying the Magento E-Commerce System

This section describes how to orchestrate and deploy the Magento e-commerce system using asample template. After the e-commerce system is successfully deployed, you can visit it, asshown in Figure 2-6.

Magento is a professional open-source e-commerce system. It is flexible and has a modulararchitecture and rich functions, and is easy to seamlessly integrate with third-party applicationsystems. Magento is oriented to enterprise-class applications, and can be used to build amulti-functional e-commerce website, including shopping, shipping, and productcommenting. Due to the open-source feature, Magento provides the code base developmentfunction that complies with industrial standards, facilitating seamless integration with third-party application systems.

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

6

Page 10: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Figure 2-6 Accessing the Magento e-commerce system

The following describes how to deploy a containerized application. After the deployment iscomplete, you can access the application.

The procedure is as follows:

1. Prerequisites: Before deploying a containerized application, ensure that at least onecluster and one node with 2 CPU cores and 4-GB memory are available.

2. Creating an E-Commerce Website Application Stack: Create a containerizedapplication using a sample template, and then deploy the created application in thecluster.

3. Deleting a Stack: You are advised to delete unnecessary stacks to avoid unwantedcharges.

4. Related Operations: Read AOS Best Practices to understand how to drag componentsand compile a template using the AOS designer.

PrerequisitesAt least one available container cluster has been created and the cluster contains one availablenode.

The node status is Available, and has been bound with an EIP. The EIP has been obtained.For details about how to view the node status, log in to CCE console, and choose ResourceManagement > Node Management in the navigation pane.

You are advised to deploy a container cluster by following the instructions in 2.1 Deploying aContainer Cluster.

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

7

Page 11: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Figure 2-7 Viewing the node status

Creating an E-Commerce Website Application StackStep 1 Log in to the AOS console. In the navigation pane, choose Templates > Sample Templates.

Step 2 Click View Details in Magento E-commerce Application.

Figure 2-8 Selecting a sample template

The template details contain brief information and diagram of the template. The Magentoapplication group contains a Magento frontend application and a MySQL databaseapplication. Each of the two applications contains a container. In addition, the Magentoapplication depends on the MySQL application. The Magento application needs to save datato the MySQL database.

Step 3 Click Create Stack.

Figure 2-9 Creating a stack

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

8

Page 12: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Step 4 Set the stack information.l Stack Name: You can set a stack name as required, for example, magento.l Description: The description can be left blank.l Cluster: Select a created cluster.l Namespace: Use the default namespace.l Set the input parameters, as listed in Table 2-1.

Table 2-1 Setting input parameters

Parameter Description Value

magento-EIP Elastic IP addressof a node.

Obtain the elastic IP address by followingthe instructions in Prerequisites, forexample, 10.0.0.0.

magento-EPORT Port number of anode.

Enter an integer ranging from 30000 to32767. Ensure that the value is unique inthe cluster. You can retain the defaultvalue 32080.

magento-container-port

Listening port ofthe Magentocontainer on a node.

Retain the default value 80.

magento-image Magento imageaddress, which hasbeen preset.

Retain the default value.

Step 5 Click Next and check the stack information. If the stack information is correct, click CreateStack.

The stack details page is displayed, showing that the stack is being created.

Step 6 When the stack status becomes Normal, ensure that two applications exist in the stackelements. The creation is expected to take 5 minutes.

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

9

Page 13: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Figure 2-10 Stack created successfully

Step 7 On the Outputs tab page, view four output parameters.

Figure 2-11 Output parameters

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

10

Page 14: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Step 8 In the address box of the browser, enter the value of magento-addr obtained from the outputparameters, for example, http://10.0.0.0:32080. Then you can access the Magentoapplication.

Figure 2-12 Accessing a Magento application

----End

Deleting a StackDelete unnecessary stacks to avoid incurring unwanted charges.

Step 1 Log in to the AOS console.

Step 2 Choose Stacks > My Stacks in the navigation pane.

Step 3 Select a created cluster and application stack and click Delete to delete the stack as prompted.

----End

Related OperationsFor more information about how to deploy a container cluster using AOS, read AOS BestPractices to understand how to drag components and compile a template using the AOSdesigner.

Application Orchestration ServiceUser Guide 2 Getting Started

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

11

Page 15: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

3 Stack Management

Stack management allows you to manage lifecycle of created stacks, includes scaling,upgrade, startup, stopping, and rollback. Stack management also allows you to view stackdetails to obtain the stack running status.

3.1 Creating a Solution Stack

3.2 Viewing Stack Details

3.3 Starting or Stopping a Stack

3.4 Upgrading a Stack

3.5 Rolling Back a Stack

3.6 Scaling a Stack

3.7 Deleting a Stack

3.1 Creating a Solution StackA solution is a large software system consisting of multiple pieces of software. In a solution,you can reuse existing templates and reference existing stacks to integrate different softwaresystems.

Specifying a Template

Step 1 Log in to the AOS console.

Step 2 In the navigation pane, choose Solutions > My Solutions.

Step 3 Click Create Solution on the right.

Step 4 Specify the template used to create a solution stack.

Application Orchestration ServiceUser Guide 3 Stack Management

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

12

Page 16: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Table 3-1 Specifying a template

Method Procedure

Using the designer to compilethe template

1. Click Design Template to enter the designer page.2. Refer to 4 Designer to compile the template.

3. Click to create a stack.

Selecting an existing template 1. Click Select Existing Template.2. Select the template that has been uploaded to the AOS

and click OK.

Uploading a new templatefrom the local host

1. Click Upload New Template.2. Select the target template and click Select.

– Using the designer to create a templateClick Design Tempalte to enter the designer page.Refer to 4 Designer to compile the template. After

the template is compiled, click to create astack.

– Uploading a template from the local hostYou can upload a file or manually enter a file name.Upload a file: Upload the required template fromthe local computer.Manual input: Define the template file directly onthe GUI.

NOTEEnsure that the new template complies with the specificationsin Template Reference; otherwise, an error will be reportedduring template creation.

3. Set the template name and version number, and clickCreate.

Step 5 Click Next to enter the page for configuring stack information.

----End

Configuring Stack Information

Step 1 Enter the stack name in the Stack Name text box.

A stack name is an identifier that helps you find a particular stack from a stack list. The namemust be unique.

Step 2 Select the desired cluster and namespace from the Cluster and Namespace drop-down listboxes.

This step ensures that data in different namespaces of the same cluster is isolated from eachother. This enables namespaces to share the services of the same cluster without affectingeach other.

Application Orchestration ServiceUser Guide 3 Stack Management

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

13

Page 17: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

NOTE

If the created stack does not depend on the cluster or namespace, this configuration is not displayed here.

Step 3 Specify the parameters defined in the stack template.

The parameters displayed here are defined in the yaml file. You can use or change anyparameter with the default value, or click Import Configurations to import the configurationfile from the local computer.

After the information is configured, you can click Export Configurations to export theconfigured information. In this manner, you can directly import the configuration next timewhen you create a similar stack. The name of the exported file is in the format of Stacknameconfig.json.

Step 4 (Optional) Click Advanced Settings to set the timeout period and automatic operations.

l Timeout Duration: Set a timeout period that allows a task to be executed. If the task isnot finished after the period elapses, the task automatically stops and an error message isdisplayed.

l Automatic Rollback: If you enable this option, the system automatically rolls back tothe initial state if the stack installation fails.

Step 5 Click Next to review the stack settings and evaluate the stack cost.

The stack cost includes the fees for cloud services (such as ECS and ELB) used by the stackand the AOS service management. Currently, the AOS service management is free of charge.

Step 6 After checking the information, click Create to create a stack.

The new stack is displayed in the stack list and is in the Processing state.

When creating a stack, you can view the stack creation events on the Events tab page of thestack details page. These events help you understand the sequence of events that cause a stackcreation success or failure (The events are sorted in ascending order by time. The latest eventis at the bottom of each event operation).

----End

3.2 Viewing Stack DetailsAfter a stack is created, you can view its data and resources on the stack details page.

Stack Elements

Displays the elements of a stack, such as applications and cloud services.

Output Parameters

Displays the output parameters declared in the stack template and their values.

Input Parameters

Displays the input parameters defined in the stack template and their values.

Application Orchestration ServiceUser Guide 3 Stack Management

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

14

Page 18: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Alarms

Displays the alarm information in the stack.

Events

You can view stack events to monitor the stack operation progress. For example, when youupgrade the stack, each important step in the stack upgrade process is displayed on the Eventstab page. (The events are sorted in ascending order by time. The latest events are displayed atthe bottom of each event.)

3.3 Starting or Stopping a StackYou can start a stack only when the stack is in the stopped state. You can stop a stack onlywhen the stack is in the running state.

Procedure

Step 1 Log in to the AOS console.

Step 2 In the navigation pane, choose Stacks > My Stacks.

Step 3 In the stack list, click Start in the row where the desired stack resides.

On the Operation History tab page of the stack details page, you can view the specificoperations about stack startup.

After the startup completes, the stack can be running.

To stop the stack after it starts, click Stop in the row where the stack resides.

----End

3.4 Upgrading a Stack

Restrictions

Topology update is not supported during a stack upgrade, and only stateless applications canbe upgraded.

Procedure

Step 1 Log in to the AOS console.

Step 2 In the navigation pane, choose Stacks > My Stacks.

Step 3 In the stack list, click Upgrade in the row where the desired stack resides.

Step 4 Change the stack template, and input and output parameters, and click Next.

Step 5 After verifying that the configuration is correct, click Upgrade.

Application Orchestration ServiceUser Guide 3 Stack Management

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

15

Page 19: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

On the Events tab page of the stack details page, you can view the operation events of thestack upgrade.

----End

3.5 Rolling Back a StackA stack can be rolled back no matter whether the upgrade succeeds or fails. Currently, a stackcan be rolled back only to the previous version.

Procedure

Step 1 Log in to the AOS console.

Step 2 In the navigation pane, choose Stacks > My Stacks.

Step 3 In the stack list, click Rollback in the row where the desired stack resides.

Step 4 In the dialog box that is displayed, click OK.

Check the stack name carefully. The rollback cannot be revoked.

On the Events tab page of the stack details page, you can view the operation events of stackrollback.

----End

3.6 Scaling a StackAfter a stack is installed successfully (in the running state), you can adjust the number ofapplication instances in the stack as required.

Restrictionsl If a stack needs to be scaled, ensure that the instances property of the template is defined

in the inputs section; otherwise, scaling cannot be performed."instances": {"get_input": "xx"},

In the preceding command, xx is a user-defined input parameter, for example,nodeinstances.

l If the template contains multiple instances attributes, it is not recommended that multipleapplications share contents in the inputs section. If multiple applications share contentsin the inputs section, other applications are also scaled when an application is scaled.

Procedure

Step 1 Log in to the AOS console.

Step 2 In the navigation pane, choose Stacks > My Stacks.

Step 3 In the stack list, click Scale in the row where the desired stack resides.

Step 4 Set the number of instances contained in the application in Instance Quantity and clickScale.

Application Orchestration ServiceUser Guide 3 Stack Management

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

16

Page 20: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

On the Events tab page of the stack details page, you can view the operation events of stackscaling.

----End

3.7 Deleting a StackDeleted stacks cannot be restored. Therefore, exercise caution when deleting a stack.

Procedure

Step 1 Log in to the AOS console.

Step 2 In the navigation pane, choose Stacks > My Stacks.

Step 3 In the stack list, select the stack to be deleted and click Delete Stacks.

Step 4 In the dialog box that is displayed, click OK.

Check the stack name carefully. The deletion cannot be revoked.

On the Events tab page of the stack details page, you can view the detailed operation eventsof stack deletion.

----End

Follow-up ProcedureIf the stack status remains Deleting until a timeout message is displayed and the stack statusbecomes Faulty, you can forcibly delete the stack.

Application Orchestration ServiceUser Guide 3 Stack Management

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

17

Page 21: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

4 Designer

4.1 AOS Designer Introduction

4.2 Designer GUI Overview

4.3 Understanding Cloud Services/Elements

4.4 (Exercise) Getting Started with the Designer

4.1 AOS Designer Introduction

What Is the AOS Designer?

The AOS designer is a graphic tool for creating, viewing, and modifying templates. With thedesigner, you can diagram your template resources and visually connect template resources,and then edit the resource details using an integrated editor.

No matter whether you are a new or a skilled AOS user, the AOS designer can help youquickly view the relationship between template resources and easily modify templates.

Why Do We Use the AOS Designer?

The AOS designer provides the following benefits:

l Visualizing template resourcesIt is difficult to parse JSON- or YAML-formatted text files to view the resources in yourtemplate and the relationships between the resources. In the designer, you can see agraphic representation of the resources included in a template and how they are related toeach other.The designer defines information about resources, such as the size and relative position,in template metadata. When you open a template, the designer automatically adds themetadata so that the current layout is also saved when you save your template. Therefore,when you re-open the template, the diagram exactly the same as that appeared when youlast saved the template is displayed.

l Simplifying template compilationWhen you compile template resources in the JSON or YAML file, the process iscomplex and error-prone. By using the designer, you can drag and drop new resources to

Application Orchestration ServiceUser Guide 4 Designer

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

18

Page 22: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

your template, and then drag connections between the resources to establishrelationships.When you create a template, the designer enforces some fundamental relationshipsbetween resources, helping you create valid templates. In the designer, you can alsodirectly validate a template.

l Simplifying editing by using an integrated JSON and YAML editorUsing the integrated editor, you can make all template modifications in the designer. Youdo not need to use a separate text editor to modify and save the template. The integratededitor also provides an auto-complete function that lists all property names for a resourceso that you do not need to look them up or memorize them. In addition, you can use theintegrated editor to convert a valid template back and forth between JSON and YAML.

4.2 Designer GUI OverviewThe designer has six areas: control pane, resource pane, log pane, design console, templatepane, and attribute pane, as shown in Figure 4-1.

Figure 4-1 Main interface of the designer

Table 4-1 Description of the main interface

No.(Corresponding tonumbers in thepreceding figure)

Description

1 Control pane, which centralizedly displays the control operationshortcuts of the design console.

Application Orchestration ServiceUser Guide 4 Designer

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

19

Page 23: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

No.(Corresponding tonumbers in thepreceding figure)

Description

2 Resource pane, which displays all resources that can be draggedfor design. The resources are categorized by service name.You can drag the desired resources to the canvas of the designconsole, and define and associate logical relationships using thegenerated connection points.

3 Log pane, which displays the error information and promptinformation that are triggered during the template operation ordesign.For example, when a template is successfully converted from theJSON format to the YAML format, the log pane displays amessage indicating that the format conversion succeeds.

4 Design console, which is the canvas of the user design templateand is used to connect resources.

5 Template pane. During the design process, a template isdynamically generated to clarify the relationship betweenresources. In this pane, you can modify a template and defineattributes.

6 Attribute pane. When you release or select a drag resource, theattribute pane displays the attribute name and attribute type of theselected resource for your reference during attribute compilation ordefinition.

4.3 Understanding Cloud Services/Elements

DefinitionA cloud service can be also called as an element. It is a basic unit for the designer to performresource design and orchestration. Any resource contains all attributes of the belongingresource type.

Resources are classified in the resource pane of the designer main interface. Any resource canbe dragged to the canvas on the right. For details about each resource, see the element list inResource Index.

Copying or Deleting a Cloud ServiceAfter a cloud service is dragged to the canvas, the cloud service is displayed. Right-click thecloud service.

Application Orchestration ServiceUser Guide 4 Designer

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

20

Page 24: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Figure 4-2 Right-clicking the cloud service

Three icons are displayed. To edit the attributes of the cloud service, click . To copy the

cloud service, click . To delete the cloud service, click .

Types of Resource Block Diagrams

There are three types of resource block diagrams in cloud services:

l Type 1: Resources with non-scaling solid lines

Resources of this type are element resources, and are generally terminal services orspecific entity resources. You cannot adjust the size of block diagrams by dragging theresources.

Figure 4-3 Resources with non-scaling solid lines

l Type 2: Resources with scaling solid lines

Resources of this type are container resources, which can contain element resources. Youcannot adjust the size of resource block diagrams by dragging the resources.

Figure 4-4 Resources with scaling solid lines

l Type 3: Resources with non-scaling dashed lines

Resources of this type are policy elements, for example, APM.Pinpiont andAntiDDos.Service. You cannot adjust the size of block diagrams by dragging theresources.

Application Orchestration ServiceUser Guide 4 Designer

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

21

Page 25: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Figure 4-5 Resources with non-scaling dashed lines

Connecting Resources (Points/Lines)When a certain resource is dragged to the canvas, a point appears on the resource. Points aredivided into solid points and hollow points.

Points can be used to connect resources. The connection line between two resources has thesame meaning as the points between two resources. Both can represent the association ordependency relationship. Lines are divided into dashed lines and solid lines.

l Dashed lineThe line connected from the hollow point of a resource indicates that the policy appliesto the target resource.For example, drag APM.Pinpoint and AOS.Job to the canvas.

Figure 4-6 AOS.Job

Rest the cursor on the hollow point of the APM.Pinpoint resource and click the hollowpoint. When an arrow is displayed, drag the mouse to the AOS.Job resource. When theAOS.Job resource becomes green, release the left mouse button. In this way, the policyon the left applies to the resource on the right.

Figure 4-7 Connecting resources

l Connection line with a solid pointA connection line drawn from the solid point of a resource to another resource representsthe dependency between the two resources. For more information, see Solid Points.

Application Orchestration ServiceUser Guide 4 Designer

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

22

Page 26: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Figure 4-8 Connection line with a solid point

l Connection line with a hollow pointA connection line that is connected from a resource with a hollow point to anotherresource indicates that the two resources are associated using an attribute value (adependency relationship exists between the two resources). For more information, seeHollow Points.

Figure 4-9 Connection line with a hollow point

l Solid pointsA resource with a solid point can depend on other resources.For example, a solid point shown in the following figure is displayed in the canvas afteryou drag the AOS.AppComponent.Container (a containerized application) to the canvas.

Figure 4-10 AOS.AppComponent.Container

When you rest the cursor to a solid point, you can see the attribute value shown in thefollowing figure, indicating that the AOS.AppComponent.Container resource can dependonly on itself.

Figure 4-11 AOS.AppComponent.Container

The following assumes that the current resource depends on anotherAOS.AppComponent.Container resource. That is, containerized application A dependson containerized application B.

Application Orchestration ServiceUser Guide 4 Designer

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

23

Page 27: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

In this scenario, you need to drag an AOS.AppComponent.Container resource to thecanvas.

Figure 4-12 AOS.AppComponent.Container

When you rest the cursor on the solid point of a resource on the left and click the solidpoint, an arrow is displayed. If the resource on the right becomes green, the tworesources can be connected. To enable the resource on the left to depend on the resourceon the right, drag the mouse to the resource on the right and release the mouse.

Figure 4-13 Connecting resources

l Hollow pointsA resource with a hollow point can be associated with other resources. If a hollow pointis displayed on the dragged resource, the resource can be associated with other resources.For example, when you drag CCE.Cluster (a CCE cluster) to the canvas, a hollow pointshown in the following figure is displayed in the canvas.

Figure 4-14 CCE.Cluster

When you rest the cursor on the hollow point, you can find the properties (shown in thefollowing figure) on the point. This indicates that the CCE.Cluster resource can beconnected only to the HUAWEICLOUD.VPC.Subnet resource.

Application Orchestration ServiceUser Guide 4 Designer

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

24

Page 28: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Figure 4-15 CCE.Cluster

The following assumes that the CCE.Cluster resource needs to connect to theVPC.Subnet resource. You need to drag the VPC.Subnet resource to the canvas.

Figure 4-16 VPC.Subnet

Rest the cursor on the hollow point of the CCE.Cluster resource and click the hollowpoint. When an arrow is displayed, drag the mouse to the VPC.Subnet resource. Whenthe VPC.Subnet resource becomes green, release the left mouse button. The associationrelationship between the two resources is established.

Figure 4-17 Connecting resources

4.4 (Exercise) Getting Started with the DesignerYou are advised to learn how to use the designer by referring to AOS Best Practices.

Application Orchestration ServiceUser Guide 4 Designer

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

25

Page 29: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

5 Reference

5.1 Manually Compiling an Nginx Template

5.1 Manually Compiling an Nginx Template

Building the Template FrameworkOpen the text editor and set up the template framework.l tosca_definitions_version: baseline template version. This parameter is mandatory and

does not need to be modified.l inputs: input parameters of a template. This parameter is optional.l node_templates: Template element. This parameter is mandatory.l outputs: output parameters of a template. This parameter is optional.

The following shows a framework template example:

tosca_definitions_version: huaweicloud_tosca_version_1_0inputs: ……node_templates: ……outputs: ……

Defining Elements in node_templatesElements contained in a template are defined in node_templates. node_templates is the mainpart of the template. After this part is defined, the template becomes an executable YAML orJSON file.

For an application, you need to define the application (hwc-nginx-app in the template file)and application component (hwc-nginx-container in the template file).

NOTE

For variable parameters, such as the image address and instance quantity, do not define them innode_templates. You are advised to define these paramters in the inputs section and enter their valueswhen creating a stack.

node_templates: hwc-nginx-app: #Defines an application.

Application Orchestration ServiceUser Guide 5 Reference

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

26

Page 30: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

type: HuaweiCloud.AOS.Application.Stateless #The application is a stateless application. properties: #Defines application properties. type: container #The application is a containerized application. instances: {get_input: instance} #Number of application instances. You are advised to define this parameter in the inputs section. requirements: # Application relationship. - package: node: hwc-nginx-container #Corresponding application component. hwc-nginx-container: #Defines an application component. type: HuaweiCloud.AOS.AppComponent.Container #The application is a containerized application. properties: package: #Defines application package attributes. image: {get_input: image} # Image address. You are advised to define this parameter in the inputs section.

To enable your applications to be accessed from the Internet, add the port mapping whendefining the application in node_templates.

NOTE

To enable your applications to be accessed from the Internet, you also need to define the portsparameter. The following template specifies that the application access type is NodePort (that is, theapplication is accessed by using node IP:port number). If the node port is not specified in the template,the system automatically allocates a random port, which is invisible to users. You need to define therandom port in the outputs section.

hwc-nginx-container: type: HuaweiCloud.AOS.AppComponent.Container properties: package: image: {get_input: image} ports: # Defines the application port mapping. - containerPort: 80 #Number of the open port in the container. The value is 80 for Nginx. serviceSpec:: # Defines the port information for the external access to the container. ports: - port: 80 # Port to be accessed by internal components in the cluster through service name+port. type: NodePort # The application access type is NodePort.

Defining the inputs Section

The input parameter defined in the inputs section must match the value of get_input definedin node_templates.inputs: image: default: "nginx:latest" # Defines the default image. instance: default: 1

Defining the outputs Sectionoutputs: nginx-NodePort: # output name, which can be customized. value: {get_attribute: [hwc-nginx-app, Service, ports, 0, nodePort]} # Obtain the required external mapping port value from the runtime attributes of the stack.

Application Orchestration ServiceUser Guide 5 Reference

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

27

Page 31: User Guide...2018/05/03  · commenting. Due to the open-source feature, Magento provides the code base development function that complies with industrial standards, facilitating seamless

Generating the TemplateAfter the preceding steps are complete, the template compilation finishes. Save the followingcontent to a YAML file, for example, nginx.yaml.

tosca_definitions_version: huaweicloud_tosca_version_1_0

inputs: image: default: "nginx:latest" instance: default: 1

node_templates: hwc-nginx-app: type: HuaweiCloud.AOS.Application.Stateless properties: type: container instances: {get_input: instance} requirements: - package: node: hwc-nginx-container

hwc-nginx-container: type: HuaweiCloud.AOS.AppComponent.Container properties: package: image: {get_input: image} ports: - containerPort: 80 serviceSpec: ports: - port: 80 type: NodePort

outputs: nginx-NodePort: value: {get_attribute: [hwc-nginx-app, Service, ports, 0, nodePort]}

Application Orchestration ServiceUser Guide 5 Reference

Issue 01 (2018-04-26) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

28