ALIYUN::ECS::InstanceGroupClone is used to create multiple clones of an Elastic Compute Service (ECS) instance.

Syntax

{
  "Type": "ALIYUN::ECS::InstanceGroupClone",
  "Properties": {
    "BackendServerWeight": Integer,
    "SystemDiskAutoSnapshotPolicyId": String,
    "DiskMappings": List,
    "Period": Number,
    "LaunchTemplateName": String,
    "RamRoleName": String,
    "ResourceGroupId": String,
    "KeyPairName": String,
    "SystemDiskDiskName": String,
    "PeriodUnit": String,
    "Description": String,
    "Tags": List,
    "AutoRenewPeriod": Number,
    "ImageId": String,
    "AutoRenew": String,
    "SpotStrategy": String,
    "SourceInstanceId": String,
    "EniMappings": List,
    "Password": String,
    "PasswordInherit": Boolean,
    "MaxAmount": Integer,
    "AutoReleaseTime": String,
    "SystemDiskCategory": String,
    "LoadBalancerIdToAttach": String,
    "LaunchTemplateId": String,
    "LaunchTemplateVersion": String,
    "ZoneId": String,
    "InternetMaxBandwidthOut": Integer,
    "InstanceName": String,
    "InternetMaxBandwidthIn": Integer,
    "DeletionProtection": Boolean,
    "DeploymentSetId": String,
    "Ipv6AddressCount": Integer,
    "SecurityGroupId": String,
    "SecurityGroupIds": List,
    "SpotPriceLimit": String,
    "HpcClusterId": String,
    "SystemDiskDescription": String,
    "Ipv6Addresses": List,
    "SystemDiskProvisionedIops": Integer,
    "SystemDiskBurstingEnabled": Boolean
  }
}

Properties

Property Type Required Editable Description Constraint
ResourceGroupId String No No The ID of the resource group to which the source ECS instance belongs. N/A
HpcClusterId String No Yes The ID of the Elastic High Performance Computing (E-HPC) cluster to which the source ECS instance belongs. N/A
SourceInstanceId String Yes No The ID of the source ECS instance to be cloned. The clone operation clones the specified ECS instance, including its instance type, image, billing method for bandwidth usage, bandwidth limit, and network type. If the source ECS instance belongs to multiple security groups, the created ECS instances are added only to the first of these security groups.
MaxAmount Integer Yes Yes The maximum number of ECS instances that can be created at a time. Valid values: 1 to 100.
BackendServerWeight Integer No No The weight that is assigned to the created ECS instances in the Server Load Balancer (SLB) instance. Valid values: 0 to 100.

Default value: 100.

LoadBalancerIdToAttach String No No The ID of the SLB instance to which you want to attach the created ECS instances. N/A
Description String No Yes The description of the created ECS instances. The description can be up to 256 characters in length.
ImageId String No Yes The ID of the image that is used to start the created ECS instances. You can use a public image, a custom image, or an Alibaba Cloud Marketplace image. To specify a public image, you can enter a partial image ID instead of the complete image ID. Examples:
  • If you enter ubuntu, the system matches it with the following ID: ubuntu16_0402_64_20G_alibase_20170818.vhd.
  • If you enter ubuntu_14, the system matches it with the following ID: ubuntu_14_0405_64_20G_alibase_20170824.vhd.
  • If you enter ubuntu*14*32, the system matches it with the following ID: ubuntu_14_0405_32_40G_alibase_20170711.vhd.
  • If you enter ubuntu_16_0402_32, the system matches it with the following ID: ubuntu_16_0402_32_40G_alibase_20170711.vhd.
InternetMaxBandwidthOut Integer No No The maximum outbound public bandwidth of the created ECS instances. Unit: Mbit/s.

Valid values:

  • Valid values for the pay-by-bandwidth mode: 0 to 200.
  • Valid values for the pay-by-data-transfer mode: 1 to 200.
SecurityGroupId String No No The ID of the security group to which the created ECS instances belong. You cannot set both the SecurityGroupId and SecurityGroupIds properties.
SecurityGroupIds List No No The IDs of the security groups to which the created ECS instances belong.

For more information, see Security group limits.

You cannot set both the SecurityGroupId and SecurityGroupIds properties.
InstanceName String No No The name of the created ECS instances. The name can be up to 128 characters in length. It can contain letters, digits, underscores (_), periods (.), and hyphens (-).
Password String No Yes The password that is used to log on to the created ECS instances. The password must be 8 to 30 characters in length. It must contain letters, digits, and special characters. The following special characters are supported: ( ) ' ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' < > , . ? / -.

If you set this property, use HTTPS to call API operations to prevent password leaks.

PasswordInherit Boolean No No Specifies whether to use the preset password of the image. Valid values:
  • true: uses the preset password.
  • false: does not use the preset password.
Note If you set this property to true, leave the Password property empty and make sure that the selected image has a preset password.
DiskMappings List No Yes The disks to be attached to the created ECS instances. A maximum of 16 disks can be attached.

For more information, see DiskMappings properties.

Period Number No Yes The billing cycle of the created ECS instances. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36.

Unit: months.

This property is required if the InstanceChargeType property is set to PrePaid. This property is optional if the InstanceChargeType property is set to PostPaid.
Tags List No Yes The custom tags of the created ECS instances. A maximum of 20 tags can be specified in the [{"Key":"tagKey","Value":"tagValue"},{"Key":"tagKey2","Value":"tagValue2"}] format.

For more information, see Tags properties.

ZoneId String No No The zone ID of the created ECS instances. N/A
KeyPairName String No Yes The name of the key pair that is used to connect to the created ECS instances. For Windows instances, ignore this property. For Linux instances, the Password property still takes effect if this property is set. However, logon by password is disabled and the KeyPairName value is used.
RamRoleName String No Yes The name of the RAM role for the created ECS instances. You can call the ListRoles operation to query the name of the RAM role. For more information, see CreateRole and ListRoles.
SpotPriceLimit String No No The maximum hourly price of the created ECS instances. The value can be accurate to a maximum of three decimal places. This property takes effect only if the SpotStrategy property is set to SpotWithPriceLimit.
SpotStrategy String No No The spot policy for pay-as-you-go instances. This property is required if the InstanceChargeType property is set to PostPaid.
Valid values:
  • NoSpot: applies to regular pay-as-you-go instances. This is the default value.
  • SpotWithPriceLimit: applies to spot instances that have maximum hourly prices.
  • SpotAsPriceGo: applies to pay-as-you-go instances of the market price at the time of purchase.
SystemDiskDiskName String No Yes The name of the system disk. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).
PeriodUnit String No Yes The unit of billing cycle for the created ECS instances. Valid values:
  • Week

    If this property is set to Week, valid values of the Period property are 1, 2, 3, and 4, and valid values of the AutoRenewPeriod property are 1, 2, and 3.

  • Month: This is the default value.

    If this property is set to Month, valid values of the Period property are 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60, and valid values of the AutoRenewPeriod property are 1, 2, 3, 6, and 12.

AutoRenewPeriod Number No Yes The auto-renewal period for the created ECS instances. This property is required if the AutoRenew property is set to True.

Valid values:

  • 1: This is the default value.
  • 2
  • 3
  • 6
  • 12
AutoRenew String No Yes Specifies whether to enable auto-renewal for the created ECS instances. Valid values:
  • True: enables auto-renewal.
  • False: disables auto-renewal. This is the default value.
This property is required if the InstanceChargeType property is set to PrePaid.
EniMappings List No Yes The elastic network interfaces (ENIs) to be attached to the created ECS instances. Only one ENI can be attached to each ECS instance.

For more information, see EniMappings properties.

AutoReleaseTime String No No The time scheduled for the created ECS instance to be automatically released. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The release time cannot be more than three years.
SystemDiskCategory String No Yes The type of the system disk. Valid values:
  • cloud: basic disk
  • cloud_efficiency: ultra disk. This is the default value.
  • cloud_ssd: SSD
  • cloud_essd: enhanced SSD (ESSD)
SystemDiskProvisionedIops Integer No Yes The IOPS preconfigured in the system disk. N/A
SystemDiskBurstingEnabled Boolean No Yes Specifies whether to enable bursting for the system disk. Valid values:
  • true: enables bursting.
  • false: disables bursting. This is the default value.
LaunchTemplateName String No Yes The name of the launch template. N/A
LaunchTemplateVersion String No Yes The version of the launch template. If you do not specify a version, the default version is used.
InternetMaxBandwidthIn Integer No No The maximum inbound public bandwidth. Valid values: 1 to 100.

Default value: 100.

Unit: Mbit/s.

LaunchTemplateId String No Yes The ID of the launch template. N/A
SystemDiskDescription String No Yes The description of the system disk. N/A
DeletionProtection Boolean No No The deletion protection properties of the created ECS instances. The DeletionProtection property specifies whether to allow you to release the created ECS instances by using the ECS console or by calling the DeleteInstance operation. Valid values:
  • true: allows you to release the created ECS instances by using the ECS console or by calling the DeleteInstance operation.
  • false: does not allow you to release the created ECS instances by using the ECS console or by calling the DeleteInstance operation.
DeploymentSetId String No Yes The ID of the deployment set. N/A
Ipv6AddressCount Integer No Yes The number of randomly generated IPv6 addresses that are allocated to the ENI. You cannot set both the Ipv6Addresses and Ipv6AddressCount properties.
Ipv6Addresses List No Yes The list of IPv6 addresses allocated to the ENI. The list can contain only one IPv6 address. A value change of this property does not affect existing ECS instances. You cannot set both the Ipv6Addresses and Ipv6AddressCount properties.
SystemDiskAutoSnapshotPolicyId String No Yes The ID of the automatic snapshot policy for the system disk. N/A

DiskMappings syntax

"DiskMappings": [
  {
    "Category": String,
    "DiskName": String,
    "Description": String,
    "Encrypted": String,
    "KMSKeyId": String,
    "Device": String,
    "SnapshotId": String,
    "Size": String,
    "PerformanceLevel": String,
    "AutoSnapshotPolicyId": String,
    "ProvisionedIops": Integer,
    "BurstingEnabled": Boolean
  }
]

DiskMappings properties

Property Type Required Editable Description Constraint
Size String Yes No The size of the data disk. Unit: GB.
Category String No No The type of the data disk. Valid values:
  • cloud: basic disk. This is the default value.
  • cloud_ssd: SSD
  • cloud_essd: ESSD
  • cloud_efficiency: ultra disk
DiskName String No No The name of the data disk. The name can be up to 128 characters in length. It can contain letters, digits, underscores (_), periods (.), and hyphens (-).
Description String No No The description of the data disk. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
Device String No No The device name of the data disk. Example: /dev/xvd[a-z].
SnapshotId String No No The ID of the snapshot. N/A
Encrypted String No No Specifies whether to encrypt the data disk. Valid values:
  • true: encrypts the data disk.
  • false: does not encrypt the data disk. This is the default value.
KMSKeyId String No No The ID of the Key Management Service (KMS) key corresponding to the data disk. N/A
AutoSnapshotPolicyId String No No The ID of the automatic snapshot policy. N/A
PerformanceLevel String No No The performance level of the ESSD that is used as the system disk.

Valid values:

  • PL0: A single ESSD delivers up to 10,000 random read/write IOPS.
  • PL1: A single ESSD delivers up to 50,000 random read/write IOPS. This is the default value.
  • PL2: A single ESSD delivers up to 100,000 random read/write IOPS.
  • PL3: A single ESSD delivers up to 1,000,000 random read/write IOPS.
For more information about the performance levels of ESSDs, see ESSDs.
ProvisionedIops Integer No No The preconfigured IOPS. N/A
BurstingEnabled Boolean No No Specifies whether to enable bursting. Valid values:
  • true: enables bursting.
  • false: disables bursting. This is the default value.

EniMappings syntax

"EniMappings": [
  {
    "SecurityGroupId": String,
    "VSwitchId": String,
    "Description": String,
    "NetworkInterfaceName": String,
    "PrimaryIpAddress": String
  }
]

EniMappings properties

Property Type Required Editable Description Constraint
SecurityGroupId String Yes Yes The ID of the security group to which the ENI belongs. N/A
VSwitchId String Yes No The ID of the vSwitch to which the ENI belongs. N/A
Description String No Yes The description of the ENI. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
NetworkInterfaceName String No Yes The name of the ENI. N/A
PrimaryIpAddress String No No The primary IP address of the ENI. N/A

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property Type Required Editable Description Constraint
Key String Yes No The key of the tag. The key must be 1 to 128 characters in length and cannot contain http:// or https://. The key cannot start with aliyun or acs:.
Value String No No The value of the tag. The value must be 0 to 128 characters in length and cannot contain http:// or https://. The value cannot start with aliyun or acs:.

Response parameters

Fn::GetAtt

  • InstanceIds: the IDs of the ECS instances. An ID is a GUID that is generated by the system for an ECS instance.
  • PrivateIps: the private IP addresses of ECS instances in a VPC. This property takes effect only if the NetworkType property is set to vpc. The value is a JSON array that can contain up to 100 IP addresses that are separated by commas (,). Example: ["172.16.XX.XX", "172.16.XX.XX", …"172.16.XX.XX"].
  • InnerIps: the private IP addresses of ECS instances in the classic network. This property takes effect only if the NetworkType property is set to classic. The value is a JSON array that can contain up to 100 IP addresses that are separated by commas (,). Example: ["10.1.XX.XX", "10.1.XX.XX", … "10.1.XX.XX"].
  • PublicIps: the public IP addresses of ECS instances in the classic network. This property takes effect only if the NetworkType property is set to classic. The value is a JSON array that contains up to 100 IP addresses that are separated by commas (,). Example: ["42.1.XX.XX", "42.1.XX.XX", … "42.1.XX.XX"].
  • HostNames: the hostnames of all ECS instances.
  • OrderId: the order IDs of the ECS instances.
  • ZoneIds: the zone IDs of the ECS instances.
  • Ipv6AddressIds: the IDs of IPv6 addresses for the ECS instances. The IPv6 address IDs are displayed in a list with two layers. If an ECS instance does not have an IPv6 address, the element at the corresponding position in the list is left empty. If none of the ECS instances has an IP address, null is returned.
  • Ipv6Addresses: the IPv6 addresses of the ECS instances. The IPv6 address IDs are displayed in a list with two layers. If an ECS instance does not have an IPv6 address, the element at the corresponding position in the list is set to null. If none of the ECS instances has an IP address, null is returned.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "According the existing ECS instance, clone a set of ECS instanes with the same configuration(InstanceType, ImageId, InternetChargeType, InternetMaxBandwidthIn, InternetMaxBandwidthOut, system disk, data disk configurations, VPC properties). The user only needs to specify SourceInstanceId.",
  "Parameters": {
    "SourceInstanceId": {
      "Type": "String",
      "Description": {
        "en": "The IDs of the ECS instances to be cloned",
         
      },
      "Label": {
         
        "en": "Source instance ID"
      }
    },
    "InstanceName": {
      "Type": "String",
      "Description": {
        "en": "The names of the instances. The name must be 2 to 128 characters in length and can contain letters, digits, underscores (_), periods (.), and hyphens (-).",
          
      },
      "ConstraintDescription": {
        "en": "[2, 128] characters, consists of uppercase letter, lowercase letter, number or special characters.",
         
      },
      "Label": {
         
        "en": "Instance name"
      },
      "Default": "ClonedECS",
      "MaxLength": 128,
      "MinLength": 2
    },
    "MaxAmount": {
      "Type": "Number",
      "Description": {
        "en": "The maximum number of ECS instances that can be created at a time. The value must be greater than or equal to the minimum number of ECS instances that can be created at a time.",
         
      },
      "ConstraintDescription": {
         
        "en": "An integer within [1, 100]"
      },
      "Label": {
         
        "en": "The Maximum of ECS Instances"
      },
      "MaxValue": 100,
      "MinValue": 1,
      "Default": 1
    },
    "Password": {
      "Type": "String",
      "Description": {
        "en": "The password that is used to log on to the created ECS instances. The password must be 8 to 30 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. The following special characters are supported: ( ) ` ~ ! @ # $ % ^ * - + = | { } [ ] : ; ' , . ? /. ",
              
      },
      "ConstraintDescription": {
        "en": "The password must be 8 to 30 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. The following special characters are supported: ()`~!@#$%^*_-+=|{}[]:;',.?/",
          
      },
      "Label": {
         
        "en": "ECS Instance Password"
      },
      "MaxLength": 30,
      "MinLength": 8,
      "AllowedPattern": "[a-zA-Z0-9-\\(\\)\\`\\~\\!@\\#\\$%\\^\\*-+=\\|\\{\\}\\[\\]\\:\\;\\'\\,\\.\\?\\/]*",
      "NoEcho": true
    }
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "InstanceName",
            "SourceInstanceId",
            "MaxAmount",
            "Password"
          ],
          "Label": {
            "default": "ECS"
          }
        }
      ],
      "TemplateTags": [
        "acs:example: ECS: Set the SourceInstanceId property to create multiple clones of a specified ECS instance with same configurations."
      ]
    }
  },
  "Resources": {
    "ECSInstanceGroup": {
      "Type": "ALIYUN::ECS::InstanceGroupClone",
      "Properties": {
        "SourceInstanceId": {
          "Ref": "SourceInstanceId"
        },
        "MaxAmount": {
          "Ref": "MaxAmount"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
    "InstanceIds": {
      "Description": "The instance ID list of created ecs instance",
      "Value": {
        "Fn::GetAtt": [
          "ECSInstanceGroup",
          "InstanceIds"
        ]
      }
    },
    "PublicIps": {
      "Description": "Public IP address list of created ecs instance.",
      "Value": {
        "Fn::GetAtt": [
          "ECSInstanceGroup",
          "PublicIps"
        ]
      }
    },
    "ZoneIds": {
      "Description": "Zone ID of created instance.",
      "Value": {
        "Fn::GetAtt": [
          "ECSInstanceGroup",
          "ZoneIds"
        ]
      }
    }
  }
}

For more examples, see InstanceGroup.json and InstanceGroup.yml. In the examples, the following resource types are involved: ALIYUN::ECS::InstanceGroup, ALIYUN::ECS::InstanceClone, ALIYUN::ECS::Command, and ALIYUN::ECS::Invocation.