Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

ECS.CloudServer

Updated on 2022-02-22 GMT+08:00

Element Description

The ECS.CloudServer element is used to deploy an ECS at the IaaS layer. It consists of CPUs, memory, images, and EVS disks.

Element Properties

Table 1 Property Description

Property

Mandatory

Descripiton

vpcId

Yes

ID of the VPC to which the ECS belongs

Type: Cloud.VPC.VPC.Id

Value Description: Use the ID of an existing VPC or a new VPC. To use a new VPC ID, you need to define the VPC object in the template and establish the dependency. You are advised to drag the object to the VPC to automatically establish the dependency.

Value Constraint: The value must satisfy the UUID rule and contain a maximum of 64 characters.

Suggestion: 1. Use the get_input function to set this field, and then the value can be automatically selected on the AOS console. 2. Use the get_reference function to obtain the VPC.VPC element created by the stack. 3. Obtain the created VPC ID on the VPC console.

mountedVolumes

No

A shared disk can be attached to multiple ECSs, but a non-shared disk can be attached to only one ECS.

Type: ECS.MountedVolumes Array

Value Description: ECS.MountedVolumes array

Value Constraint: ECS.MountedVolumes

imageId

Yes

ID of the image used by the ECS

Type: Cloud.ECS.Image.Id

Value Description: Indicates the system image of the to-be-created ECS. The ID of the created image must be specified. The ID format is UUID.

Value Constraint: The value must satisfy the UUID rule and contain a maximum of 64 characters.

Suggestion: 1. You are advised to use the get_input function to assign values so that you can select a value when using the template. Search for the information in the ECS service documentation.

serverTags

No

Tags of an ECS

Type: ECS.ServerTags array

Value Constraint: One ECS can have up to 10 tags. The key of a tag can contain only uppercase and lowercase letters, digits, underscores (_), and hyphens (-). The value of a tag can contain only uppercase and lowercase letters, digits, underscores (_), hyphens (-), and periods (.).

instances

Yes

Number of created ECSs

Type: integer

Value Description: The value ranges from 1 to 500.

Default: 1

Value Constraint: The value ranges from 1 to 500.

Suggestion: Set the value based on the live environment.

securityGroups

No

Array of the security group ID used by the cloud server

Type: ECS.SecurityGroup array

Value Description: ECS.SecurityGroup type array.

Value Constraint: The value must meet the definition of the ECS.SecurityGroup type.

flavor

Yes

ECS specifications

Type: Cloud.ECS.Flavor.Name

Value Description: ID of the system specifications of the cloud server to be created

Value Constraint: The definition of the flavor format is met.

Suggestion: You are advised to use the get_input function to set values so that you can select a value when using the template. Alternatively, you can obtain the value through ECS documentations.

serverGroupId

No

ID of the cloud server group to which the host belongs

Type: Cloud.ECS.ServerGroup.Id

Value Description: Existing cloud server group ID of the current account

Value Constraint: Existing cloud server group ID of the current account

Suggestion: If you are adding this server to an existing cloud server group, specify the server group ID. If you are adding this server to a cloud server group created together with this server in the same template, use the get_reference function to automatically obtain the value.

nics

Yes

Information about the NIC of the ECS

Type: ECS.NICS array

Value Description: ECS.NICS type array

Value Constraint: The value must comply with the definition of the ECS.NICS type. The minimum length of the array is 1 and the maximum is 12.

rootVolume

Yes

System disk configuration of the ECS

Type: ECS.RootVolume

Value Description: ECS.RootVolume type

Default: {u'volumeType': u'unset', u'size': 40}

Value Constraint: The value must meet the definition of the ECS.RootVolume type.

userData

No

User data to be injected during ECS creation. Texts, text files, or GZIP files are supported.

Type: string

Value Description: Customize the value.

Value Constraint: The content to be injected must be encoded using base64. The maximum size of the content to be injected before encoding is 32 KB. If key_name is not specified, the data injected by user_data is the password of the root user for logging in to the ECS by default. This parameter is mandatory when you create a Linux ECS using the password authentication mode. Its value is the initial password of the root user.

Suggestion: Set this parameter based on live network. For more information about user data to be injected, see section "Injecting User Data into ECSs" of Elastic Cloud Server User Guide.

availabilityZone

Yes

AZ to which the ECS belongs

Type: Cloud.ECS.AvailabilityZone.Name

Value Description: AZ where the to-be-created ECS is located. The name of the AZ needs to be specified.

Value Constraint: The value varies depending on regions.

Suggestion: Use the get_input function to set this field, and then the value can be automatically selected on the AOS console.

dataVolumes

No

Data disk configuration of the ECS

Type: ECS.DataVolume array

Value Description: ECS.DataVolume type array

Value Constraint: The value must meet the definition of the ECS.DataVolume type.

name

Yes

ECS name

Type: string

Value Description: Customize the value, for example, myvm.

Value Constraint: The value contains 1 to 64 characters. This value is unique under an account, and must meet regular expression {"regex":"^[a-zA-Z][0-9a-zA-Z-_]*$","min_length":1,"max_length":64}.

Suggestion: Customize the value.

publicIP

No

Elastic IP address of the ECS

Type: ECS.PublicIP

Value Description: ECS.PublicIP type

Default: {}

Value Constraint: The value must meet the definition of the ECS.PublicIP type.

adminPwd

No

Initial login password of the administrator account for logging in to an ECS using password authentication.

Type: password

Value Description: The Linux administrator is root. The Windows administrator is Administrator. Set either a login key or login password.

Value Constraint: 1. Enter 8 to 26 characters. The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters !@$%^-_=+[{}]:,./?. 2. The password cannot contain the username or the username in reverse. 3. The Windows ECS password cannot contain the username, the username in reverse, or more than two consecutive characters in the username.

Suggestion: It is advised to set this parameter using the get_input function.

sshKeyName

No

SSH key pair for login

Type: Cloud.ECS.KeyPair.Name

Value Description: It must be created in advance on the ECS console. Set either a login key or login password.

Value Constraint: The value contains 1 to 64 characters. This value is unique under an account, and must meet regular expression {"regex":"^[a-zA-Z][0-9a-zA-Z-_]*$","min_length":1,"max_length":64}.

Suggestion: 1. You are advised to use the get_input function to assign values so that you can select a value when using the template. 2. Obtain the information on the ECS console and then enter the information accordingly.

Relationships Between Elements

Table 2 Relationship description

Description

Target

Inclusion

VPC.VPC

Connected

VPC.SecurityGroup

Dependency

SFS.FileSystem

Connected

VPC.Subnet

Connected

ECS.KeyPair

Connected

VPC.EIP

Return Value

Property

Type

Description

publicIps

string

Elastic IP address array of an ECS instance

privateIps

string

Private IP address array of an ECS instance

floatingIpIds

string

Elastic IP address ID array of an ECS instance

refID

Array

List of all ECS instance IDs

refName

Array

List of all ECS instance names

Blueprint Example

The following uses the CloudServer resource orchestration blueprint as an example:

  • Creating a subnet under the existing VPCs and subnets.
    tosca_definitions_version: cloud_tosca_version_1_0
    inputs:
      ecs-name:
        default: "my-cloudserver"
      ecs-image:
        default: "327946b5-e954-42c3-949a-3312688c9269"
      ecs-flavor:
        default: "c2.large"
      vpc-id:
        default: "ba6e4347-99d2-4649-b114-85c28d3d71b0"
      az:
        default: "az1.dc1"
      subnet-vpcid:
        default: "3be61f68-9bfc-41bf-8f5e-66c57122f270"
      ecs-volumetype:
        default: "SATA"
      ecs-sshKeyName:
        default: "KeyPair-magento"
    node_templates:
      my-ecs:
        type: Cloud.ECS.CloudServer
        properties:
          name: {get_input: ecs-name}
          instances: 2
          imageId: {get_input: ecs-image}
          flavor: {get_input: ecs-flavor}
          vpcId: {get_input: vpc-id}
          availabilityZone: {get_input: az}
          nics:
            - subnetId: {get_input: subnet-vpcid}
          rootVolume: 
            volumeType: {get_input: ecs-volumetype}
          dataVolumes:
            - volumeType: SATA
              size: 100
          sshKeyName: {get_input: ecs-sshKeyName}
  • Associating with a VPC and subnet. CloudServer is automatically created under the newly created VPC and subnet.

    If you have not created a VPC or subnet, or you do not need to use an existing VPC or subnet, you can create a blueprint file and create a VPC, subnet, and CloudServer at the same time. When you create CloudServer, it can be automatically associated with the created VPC and subnet. The following is an example:

    • Add the dependency requirements to the desired subnet. In this manner, the objects on which the subnet depends will be created during blueprint execution.
    • For the vpcId property and its value on a subnet, use the get_attribute function to obtain the response attribute refID of the created VPC (my-vpc).
    • For the subnetId property and its value in vpcId and nics on CloudServer, use the get_attribute function to obtain the response attribute refID of the created subnet (my-subnet).
    tosca_definitions_version: cloud_tosca_version_1_0
    inputs:
      ecs-name:
        default: "my-cloudserver"
      ecs-image:
        default: "327946b5-e954-42c3-949a-3312688c9269"
      ecs-flavor:
        default: "c2.large"
      ecs-volumetype:
        default: "SATA"
      az:
        default: "az1.dc1"
      subnet-name:
        default: "my-ecs-subnet2"
      subnet-cidr:
        default: "192.168.1.0/24"
      subnet-gateway:
        default: "192.168.1.1"
      vpc-name:
        default: "my-ecs-vpc2"
      vpc-cidr:
        default: "192.168.0.0/16"
    node_templates:
      my-ecs:
        type: Cloud.ECS.CloudServer
        properties:
          name: {get_input: ecs-name}
          instances: 1
          imageId: {get_input: ecs-image}
          flavor: {get_input: ecs-flavor}
          vpcId: {get_attribute: [my-vpc, refID]}
          availabilityZone: {get_input: az}
          nics:
            - subnetId: {get_attribute: [my-subnet, refID]}
          rootVolume: 
            volumeType: {get_input: ecs-volumetype}
          dataVolumes:
            - volumeType: SATA
              size: 100
        requirements:
          - nics.subnetId:
              node: my-subnet
        my-subnet:
        type: Cloud.VPC.Subnet
        properties:
          name: {get_input: subnet-name}
          cidr: {get_input: subnet-cidr}
          gateway: {get_input: subnet-gateway}
          dnsList: [114.114.114.115,114.114.114.114]
          vpcId: {get_attribute: [my-vpc, refID]}
          availabilityZone: {get_input: az}
        requirements:
          - vpcId:
              node: my-vpc
      my-vpc:
        type: Cloud.VPC.VPC
        properties:
          name: {get_input: vpc-name}
          cidr: {get_input: vpc-cidr}

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback