テンプレート名
ACS-ECS-BulkyCloneInstances:ECS インスタンスの一括クローン
説明
イメージスナップショットを使用して、Elastic Compute Service (ECS) インスタンスをバッチでクローンします。注:
-
移行前に、ドライバーの不足がないか確認し、ターゲットインスタンスが起動に失敗しないようにしてください。
-
すべてのデータを保持するには、[Create incremental snapshots for stopped instances] を Yes に設定する必要があります。移行中に生成されたデータが不要な場合は No に設定します。まず No でテストし、ターゲットインスタンスが正しく動作することを確認した後、データ整合性を完全に確保するために、Yes で再度テンプレートを実行することを推奨します。
-
スナップショットの作成時間はディスクサイズに依存します。最初のフルスナップショットの作成には数時間かかる場合があります。以降の増分スナップショットはより高速ですが、前回のスナップショット以降に変更されたデータ量に依存します。
-
このプロセス中にインスタンスが再起動します。データディスクが自動アタッチに設定されていることを確認してください。設定されていない場合、再起動後にアタッチされません。
-
これはリスクの高い操作です。[Create incremental snapshots for stopped instances] を Yes に設定する場合、インスタンスの停止によるビジネスへの影響が許容範囲内であることを確認してください。
-
ターゲットインスタンスに、パブリック IP アドレスと EIP を手動で再アタッチする必要があります。詳細については、「クラシックネットワーク ECS インスタンスのパブリック IP アドレスを EIP に変換する」、「VPC ECS インスタンスの固定パブリック IP アドレスを EIP に変換する」、および「プライベート IP アドレスの変更」をご参照ください。
-
テンプレートを実行する前にスナップショットを作成しておくと、実行時間を大幅に短縮できます。
-
ターゲットインスタンスの費用を賄える十分なアカウント残高があることを確認してください。
テンプレートタイプ
自動化
所有者
Alibaba Cloud
入力パラメーター
|
パラメーター名 |
説明 |
タイプ |
必須 |
デフォルト値 |
制約 |
|
instanceIds |
クローンする ECS インスタンスの ID。 |
List |
Yes |
||
|
targetZoneId |
ターゲットインスタンスを配置するゾーン。 |
String |
Yes |
||
|
targetInstanceChargeType |
ターゲットインスタンスの課金方法。 |
String |
Yes |
||
|
targetInstanceType |
ターゲットインスタンスのインスタンスタイプ。 |
String |
Yes |
||
|
targetVPCId |
ターゲットインスタンスが属する VPC。 |
String |
Yes |
||
|
targetVSwitchId |
ターゲットインスタンスが属する vSwitch。 |
String |
Yes |
||
|
targetSecurityGroupIds |
ターゲットインスタンスにバインドするセキュリティグループ。 |
List |
Yes |
||
|
targetSystemDiskCategory |
ターゲットインスタンスのシステムディスクのカテゴリ。 |
String |
Yes |
||
|
targetDataDiskCategory |
ターゲットインスタンスのデータディスクのカテゴリ。 |
String |
Yes |
||
|
targetPassword |
ターゲットインスタンスのログインパスワード。 |
String |
Yes |
文字列検証の正規表現:[0-9A-Za-z_-&:;’<>,=%~!@#()$^*+|{}[].?/]+$ 最大長:30 最小長:8 |
|
|
regionId |
ソースインスタンスが配置されているリージョン。 |
String |
No |
{{ ACS::RegionId }} |
|
|
targetPeriodUnit |
サブスクリプション期間の単位。 |
String |
No |
Month |
|
|
targetPeriod |
サブスクリプション期間。 |
Number |
No |
1 |
|
|
useIncrementSnapshot |
停止したインスタンスの増分スナップショットを作成するかどうか。 |
Boolean |
No |
False |
|
|
OOSAssumeRole |
OOS が引き受ける RAM ロール。 |
String |
No |
出力パラメーター
|
パラメーター名 |
説明 |
タイプ |
|
instanceIds |
作成されたターゲットインスタンスの ID。 |
List |
このテンプレートの実行に必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:CreateImage",
"ecs:CreateSnapshot",
"ecs:DeleteImage",
"ecs:DeleteSnapshot",
"ecs:DescribeAvailableResource",
"ecs:DescribeDisks",
"ecs:DescribeImages",
"ecs:DescribeInstances",
"ecs:DescribeSnapshots",
"ecs:DescribeVSwitches",
"ecs:RunInstances",
"ecs:StartInstance",
"ecs:StopInstance"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
詳細については、「ACS-ECS-BulkyCloneInstances」をご参照ください。
テンプレートの内容
FormatVersion: OOS-2019-06-01
Description:
en: <p class="p">Clones Elastic Compute Service (ECS) instances in batches. Note:</p> <ul class="ul"> <li class="li">Before migration, check for missing drivers to prevent the new instances from failing to start.</li> <li class="li">This template uses image snapshots for migration. To keep all data, set <font color='blue'>Create incremental snapshots for stopped instances</font> to Yes. If you do not need to keep data generated during the migration, set it to No. <font color='red'>Set it to No first to test if the new instances work correctly. After you confirm the new instances are working, run the template again with the setting as Yes to ensure complete data integrity.</font></li> <li class="li">Creating a snapshot takes several minutes, depending on the disk size. The first snapshot of a disk is a full snapshot and can take a long time, possibly hours. Subsequent snapshots are faster but still depend on the amount of data changed since the last snapshot. More changes mean a longer creation time.</li> <li class="li"><font color='red'>The instances will restart. Ensure that data disks are set to automatically attach. Otherwise, the data disks will not be attached after the restart.</font></li> <li class="li"><font color='red'>This is a risky operation. If you set "Create incremental snapshots for stopped instances" to Yes, confirm that the business impact of stopping the instances is acceptable.</font></li> <li class="li"><font color='red'>You must manually re-attach public IP addresses and Elastic IP Addresses (EIPs) to the new instances. For more information, see <a href='https://www.alibabacloud.com/help/document_detail/156287.html'>Convert the public IP address of a classic network ECS instance to an EIP</a>, <a href='https://www.alibabacloud.com/help/document_detail/67455.html'>Convert the static public IP address of a VPC ECS instance to an EIP</a>, and <a href='https://www.alibabacloud.com/help/document_detail/27733.html'>Modify a private IP address</a>.</font></li> <li class="li">Creating a snapshot of the instances before running the template greatly reduces the running time.</li> <li class="li"><font color='red'>Ensure your account balance is sufficient to cover the cost of the new instances.</font></li> </ul>
zh-cn: <p class="p">Clones Elastic Compute Service (ECS) instances in batches. Note:</p> <ul class="ul"> <li class="li">Before migration, check for missing drivers to prevent the new instances from failing to start.</li> <li class="li">This template uses image snapshots for migration. To keep all data, set <font color='blue'>Create incremental snapshots for stopped instances</font> to Yes. If you do not need to keep data generated during the migration, set it to No. <font color='red'>Set it to No first to test if the new instances work correctly. After you confirm the new instances are working, run the template again with the setting as Yes to ensure complete data integrity.</font></li> <li class="li">Creating a snapshot takes several minutes, depending on the disk size. The first snapshot of a disk is a full snapshot and can take a long time, possibly hours. Subsequent snapshots are faster but still depend on the amount of data changed since the last snapshot. More changes mean a longer creation time.</li> <li class="li"><font color='red'>The instances will restart. Ensure that data disks are set to automatically attach. Otherwise, the data disks will not be attached after the restart.</font></li> <li class="li"><font color='red'>This is a risky operation. If you set "Create incremental snapshots for stopped instances" to Yes, confirm that the business impact of stopping the instances is acceptable.</font></li> <li class="li"><font color='red'>You must manually re-attach public IP addresses and Elastic IP Addresses (EIPs) to the new instances. For more information, see <a href='https://www.alibabacloud.com/help/document_detail/156287.html'>Convert the public IP address of a classic network ECS instance to an EIP</a>, <a href='https://www.alibabacloud.com/help/document_detail/67455.html'>Convert the static public IP address of a VPC ECS instance to an EIP</a>, and <a href='https://www.alibabacloud.com/help/document_detail/27733.html'>Modify a private IP address</a>.</font></li> <li class="li">Creating a snapshot of the instances before running the template greatly reduces the running time.</li> <li class="li"><font color='red'>Ensure your account balance is sufficient to cover the cost of the new instances.</font></li> </ul>
ja: <p class="p">Elastic Compute Service (ECS) インスタンスをバッチでクローンします。注:</p> <ul class="ul"> <li class="li">移行前に、ドライバーの不足がないか確認し、新しいインスタンスが起動に失敗しないようにしてください。</li> <li class="li">このテンプレートは、移行にイメージスナップショットを使用します。すべてのデータを保持するには、<font color='blue'>[Create incremental snapshots for stopped instances]</font> を Yes に設定します。移行中に生成されたデータが不要な場合は No に設定します。<font color='red'>まず No に設定して、新しいインスタンスが正常に動作するかをテストしてください。新しいインスタンスが動作することを確認した後、テンプレートを再度 Yes に設定して実行し、完全なデータ整合性を確保してください。</font></li> <li class="li">スナップショットの作成には、ディスクサイズに応じて数分かかります。ディスクの最初のスナップショットはフルスナップショットであり、数時間かかる場合があります。その後のスナップショットはより高速ですが、前回のスナップショット以降に変更されたデータ量に依存します。変更が多いほど、作成時間が長くなります。</li> <li class="li"><font color='red'>インスタンスは再起動されます。データディスクが自動アタッチに設定されていることを確認してください。そうでない場合、データディスクは再起動後にアタッチされません。</font></li> <li class="li"><font color='red'>これはリスクの高い操作です。[Create incremental snapshots for stopped instances] を Yes に設定する場合、インスタンスを停止することによるビジネスへの影響が許容範囲内であることを確認してください。</font></li> <li class="li"><font color='red'>新しいインスタンスにパブリック IP アドレスと Elastic IP Address (EIP) を手動で再アタッチする必要があります。詳細については、「<a href='https://www.alibabacloud.com/help/document_detail/156287.html'>クラシックネットワーク ECS インスタンスのパブリック IP アドレスを EIP に変換する</a>」、「<a href='https://www.alibabacloud.com/help/document_detail/67455.html'>VPC ECS インスタンスの静的パブリック IP アドレスを EIP に変換する</a>」、および「<a href='https://www.alibabacloud.com/help/document_detail/27733.html'>プライベート IP アドレスの変更</a>」をご参照ください。</font></li> <li class="li">テンプレートを実行する前にインスタンスのスナップショットを作成しておくと、実行時間が大幅に短縮されます。</li> <li class="li"><font color='red'>新しいインスタンスの費用を賄うのに十分なアカウント残高があることを確認してください。</font></li> </ul>
name-en: ACS-ECS-BulkyCloneInstances
name-zh-cn: Clone ECS instances in batches
name-ja: ECS インスタンスの一括クローン
categories:
- cross_region
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: The region of the ECS instances to clone.
ja: リージョン
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
instanceIds:
Label:
en: InstanceIds
zh-cn: The ECS instances to clone.
ja: インスタンス ID
Type: List
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
AssociationPropertyMetadata:
RegionId: regionId
targetZoneId:
Label:
en: TargetZoneId
zh-cn: The zone.
ja: ターゲットゾーン
Description:
en: For more information about purchasing instances, see the ECS purchase page: https://ecs-buy.alibabacloud.com/
zh-cn: For more information about purchasing instances, see the ECS purchase page: https://ecs-buy.alibabacloud.com/
ja: インスタンスの購入に関する詳細については、ECS 購入ページ (https://ecs-buy.alibabacloud.com/) をご参照ください。
Type: String
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
RegionId: regionId
targetInstanceChargeType:
Label:
en: TargetInstanceChargeType
zh-cn: The billing method.
ja: ターゲットインスタンスの課金方法
Type: String
AssociationProperty: ChargeType
targetPeriodUnit:
Label:
en: The unit of the subscription period
zh-cn: The unit of the subscription duration.
ja: サブスクリプション期間の単位
Type: String
AssociationPropertyMetadata:
Visible:
Condition:
'Fn::Not':
'Fn::Equals':
- '${targetInstanceChargeType}'
- PostPaid
AllowedValues:
- Week
- Month
Default: Month
targetPeriod:
Label:
en: TargetPeriod
zh-cn: The subscription duration.
ja: サブスクリプション期間
Description:
en: "Valid values:
Valid values when PeriodUnit is set to Week: 1, 2, 3, and 4.
Valid values when PeriodUnit is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60."
zh-cn: "Valid values:
When PeriodUnit is Week, valid values for Period are: 1, 2, 3, 4.
When PeriodUnit is Month, valid values for Period are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, 60."
ja: "有効値:PeriodUnit が Week の場合、有効な値は 1、2、3、4 です。PeriodUnit が Month の場合、有効な値は 1、2、3、4、5、6、7、8、9、12、24、36、48、60 です。"
Type: Number
AssociationPropertyMetadata:
Visible:
Condition:
'Fn::Not':
'Fn::Equals':
- '${targetInstanceChargeType}'
- PostPaid
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 12
- 24
- 36
- 48
- 60
Default: 1
targetInstanceType:
Label:
en: TargetInstanceType
zh-cn: The instance type.
ja: ターゲットインスタンスタイプ
Type: String
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
RegionId: regionId
ZoneId: targetZoneId
InstanceChargeType: targetInstanceChargeType
targetVPCId:
Label:
en: TargetVPCId
zh-cn: The virtual private cloud (VPC).
ja: ターゲット VPC
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
AssociationPropertyMetadata:
RegionId: regionId
targetVSwitchId:
Label:
en: TargetVSwitchId
zh-cn: The vSwitch.
ja: ターゲット vSwitch
Description:
en: Confirm that the vSwitch is in the selected zone. If not, reselect or create a new vSwitch.
zh-cn: Confirm that the vSwitch is in the selected zone. If not, reselect or create a new vSwitch.
ja: vSwitch が選択したゾーンにあることを確認してください。そうでない場合は、再選択するか、新しい vSwitch を作成してください。
Type: String
AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
AssociationPropertyMetadata:
RegionId: regionId
ZoneId: targetZoneId
VpcId: targetVPCId
targetSecurityGroupIds:
Label:
en: TargetSecurityGroupIds
zh-cn: The security group.
ja: ターゲットセキュリティグループ
Description:
en: The vSwitch and the security group must belong to the same VPC.
zh-cn: The security group and the vSwitch must be in the same VPC.
ja: vSwitch とセキュリティグループは同じ VPC に属している必要があります。
Type: List
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
RegionId: regionId
VpcId: targetVPCId
targetSystemDiskCategory:
Label:
en: TargetSystemDiskCategory
zh-cn: The category of the system disk.
ja: ターゲットシステムディスクのカテゴリ
Type: String
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
RegionId: regionId
ZoneId: targetZoneId
InstanceType: targetInstanceType
InstanceChargeType: targetInstanceChargeType
targetDataDiskCategory:
Label:
en: TargetDataDiskCategory
zh-cn: The category of the data disk.
ja: ターゲットデータディスクのカテゴリ
Type: String
AssociationProperty: ALIYUN::ECS::Disk::DataDiskCategory
AssociationPropertyMetadata:
RegionId: regionId
ZoneId: targetZoneId
InstanceType: targetInstanceType
InstanceChargeType: targetInstanceChargeType
targetPassword:
Label:
en: TargetPassword
zh-cn: The instance password.
ja: ターゲットパスワード
Description:
en: "<font color='red'>The password must be 8 to 30 characters in length and include at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.</font>Special characters include the following: ()`~!@#$%^&*-_+=|{}[]:;''<>,.?/ Passwords of Windows instances cannot start with a forward slash (/)."
zh-cn: "<font color='red'>The password must be 8 to 30 characters long and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.</font> Special characters can be: ()`~!@#$%^&*-_+=|{}[]:;'<>,.?/. The password of a Windows instance cannot start with a forward slash (/)."
ja: "<font color='red'>パスワードは 8~30 文字で、大文字、小文字、数字、特殊文字のうち、3 種類以上を含める必要があります。</font>特殊文字には、()`~!@#$%^&*-_+=|{}[]:;''<>,.?/ が含まれます。Windows インスタンスのパスワードは、スラッシュ (/) で始めることはできません。"
Type: String
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: 8
MaxLength: 30
NoEcho: true
useIncrementSnapshot:
Type: Boolean
Description:
en: <p class="p">Note:</p><ul class="ul"> <li class="li">If you select Yes, to ensure maximum data consistency, the system stops the source instance (in a stopped but billing state) after the full snapshot is created. Then, it creates an incremental snapshot, creates the destination instance from the incremental snapshot, and starts the destination instance. <font color='red'>If the task succeeds, the source instance remains stopped. Manually release the source instance as soon as possible after you verify that the destination instance is working correctly to avoid further charges.</font> If the task fails, the source instance is restarted.</li> <li class="li">If you select No (the default), to ensure the source instance is always available, the system creates and starts the destination instance from the full snapshot. <font color='red'>However, incremental data generated after the task starts is not synchronized to the destination instance. This may cause data inconsistency.</font></li></ul>
zh-cn: <p class="p">Note:</p><ul class="ul"> <li class="li">If you select Yes, to ensure maximum data consistency, the system stops the source instance (in a stopped but billing state) after the full snapshot is created. Then, it creates an incremental snapshot, creates the destination instance from the incremental snapshot, and starts the destination instance. <font color='red'>If the task succeeds, the source instance remains stopped. Manually release the source instance as soon as possible after you verify that the destination instance is working correctly to avoid further charges.</font> If the task fails, the source instance is restarted.</li> <li class="li">If you select No (the default), to ensure the source instance is always available, the system creates and starts the destination instance from the full snapshot. <font color='red'>However, incremental data generated after the task starts is not synchronized to the destination instance. This may cause data inconsistency.</font></li></ul>
ja: <p class="p">注:</p><ul class="ul"> <li class="li">「はい」を選択した場合、最大限のデータ整合性を確保するため、フルスナップショットの作成後にソースインスタンスが停止 (停止済みだが課金中) します。その後、増分スナップショットを作成し、その増分スナップショットからターゲットインスタンスを作成して起動します。<font color='red'>タスクが成功した場合、ソースインスタンスは停止したままになります。ターゲットインスタンスが正常に動作することを確認した後、追加料金を避けるために、できるだけ早くソースインスタンスを手動でリリースしてください。</font>タスクが失敗した場合、ソースインスタンスは再起動されます。</li> <li class="li">「いいえ」(デフォルト) を選択した場合、ソースインスタンスの可用性を常に確保するため、フルスナップショットからターゲットインスタンスが作成・起動されます。<font color='red'>ただし、タスク開始後に生成された増分データはターゲットインスタンスに同期されません。これにより、データが不整合になる可能性があります。</font></li></ul>
Label:
en: Create incremental snapshots for stopped instances
zh-cn: Create incremental snapshots for stopped instances
ja: 停止したインスタンスの増分スナップショットを作成
Default: false
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: The RAM role that OOS assumes.
ja: OOS が引き受ける RAM ロール
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: cloneInstances
Action: ACS::ECS::CloneInstance
Description:
en: Clone ECS instances
zh-cn: Clone ECS instances
ja: ECS インスタンスのクローン
When:
'Fn::Equals':
- '{{ useIncrementSnapshot }}'
- false
Properties:
regionId: '{{ regionId }}'
imageName: img-{{ ACS::TaskLoopItem }}-{{ACS::ExecutionId}}
instanceId: '{{ ACS::TaskLoopItem }}'
targetVSwitchId: '{{ targetVSwitchId }}'
targetInstanceType: '{{ targetInstanceType }}'
targetSecurityGroupIds: '{{ targetSecurityGroupIds }}'
targetPassword: '{{ targetPassword }}'
targetInstanceChargeType: '{{ targetInstanceChargeType }}'
targetPeriodUnit: '{{ targetPeriodUnit }}'
targetPeriod: '{{ targetPeriod }}'
targetSystemDiskCategory: '{{ targetSystemDiskCategory }}'
targetDataDiskCategory: '{{ targetDataDiskCategory }}'
Loop:
Items: '{{ instanceIds }}'
RateControl:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
Outputs:
instanceIds:
AggregateType: Fn::ListJoin
AggregateField: instanceId
Outputs:
instanceId:
Type: String
ValueSelector: instanceId
- Name: cloneInstancesWithIncrementSnapshot
Action: ACS::ECS::CloneInstanceWithIncrementSnapshot
Description:
en: Clone ECS instances using incremental snapshots
zh-cn: Clone ECS instances using incremental snapshots
ja: 増分スナップショットを使用した ECS インスタンスのクローン
When:
'Fn::Equals':
- '{{ useIncrementSnapshot }}'
- true
Properties:
regionId: '{{ regionId }}'
imageName: img-{{ ACS::TaskLoopItem }}-{{ACS::ExecutionId}}
instanceId: '{{ ACS::TaskLoopItem }}'
targetVSwitchId: '{{ targetVSwitchId }}'
targetInstanceType: '{{ targetInstanceType }}'
targetSecurityGroupIds: '{{ targetSecurityGroupIds }}'
targetPassword: '{{ targetPassword }}'
targetInstanceChargeType: '{{ targetInstanceChargeType }}'
targetPeriodUnit: '{{ targetPeriodUnit }}'
targetPeriod: '{{ targetPeriod }}'
targetSystemDiskCategory: '{{ targetSystemDiskCategory }}'
targetDataDiskCategory: '{{ targetDataDiskCategory }}'
Loop:
Items: '{{ instanceIds }}'
RateControl:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
Outputs:
instanceIds:
AggregateType: Fn::ListJoin
AggregateField: instanceId
Outputs:
instanceId:
Type: String
ValueSelector: instanceId
Outputs:
instanceIds:
Type: List
Value:
Fn::If:
- 'Fn::Equals':
- '{{ useIncrementSnapshot }}'
- true
- '{{ cloneInstancesWithIncrementSnapshot.instanceIds }}'
- '{{ cloneInstances.instanceIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- instanceIds
Label:
default:
zh-cn: Select Instances
en: Select Instances
ja: インスタンスの選択
- Parameters:
- targetZoneId
- targetInstanceChargeType
- targetPeriodUnit
- targetPeriod
- targetInstanceType
- targetVPCId
- targetVSwitchId
- targetSecurityGroupIds
- targetSystemDiskCategory
- targetDataDiskCategory
- targetPassword
Label:
default:
zh-cn: Configure Parameters
en: Configure Parameters
ja: パラメーターの設定
- Parameters:
- useIncrementSnapshot
Label:
default:
en: Incremental Snapshot Option
zh-cn: Incremental Snapshot Option
ja: 増分スナップショットのオプション
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: Advanced Options
en: Advanced Options
ja: 詳細オプション