テンプレート名
ACS-ESS-LifeCycleInstallAAS:ライフサイクルフックを使用して ECS インスタンスに追加アプリケーションサーバー (AAS) をインストールします。
テンプレートの説明
このテンプレートは、ライフサイクルフックを使用して ECS インスタンスに AAS をインストールします。
テンプレートタイプ
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | 型 | 必須 | デフォルト | 制約 |
PASIP | プライマリアプリケーションサーバー (PAS) のプライベート IP アドレスです。 | String | はい | ||
rootPassword | PAS のルートパスワードです。 | String | はい | ||
SAPSID | SAP AS ABAP システムのシステム ID (SID) です。 | String | はい | ||
userName | SAP システムのユーザー名です。 | String | はい | ||
userPassword | SAP システムユーザーのパスワードです。 | String | はい | ||
clientNumber | SAP クライアント番号です。 | String | はい | ||
className | SMLG ログオングループの名前です。 | String | いいえ | SPACE | |
instanceIds | ECS インスタンスの ID です。 | List | いいえ | ['${instanceIds}'] | |
lifecycleHookId | ライフサイクルフックの ID です。 | String | いいえ | ${lifecycleHookId} | |
lifecycleActionToken | ECS インスタンスに関連付けられたスケーリングアクティビティのトークンです。 | String | いいえ | ${lifecycleActionToken} | |
OOSAssumeRole | CloudOps Orchestration Service (OOS) が引き受ける RAM ロールです。 | String | いいえ | OOSServiceRole |
出力パラメーター
パラメーター | 説明 | 型 |
commandOutputs | List |
必要な権限
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"ess:CompleteLifecycleAction"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
テンプレートの内容
FormatVersion: OOS-2019-06-01
Description:
en: Uses a lifecycle hook to install an additional application server (AAS) in an instance created during a scaling activity.
name-en: Install an AAS in an instance using a lifecycle hook
categories:
- elastic_manage
Parameters:
PASIP:
Label:
en: PAS private IP address
Description:
en: The private IP address of the ECS instance that hosts the primary application server (PAS).
Type: String
rootPassword:
Label:
en: PAS root password
Description:
en: The root password for the PAS.
Type: String
SAPSID:
Label:
en: SAP AS ABAP system ID
Description:
en: The system ID (SID) of the SAP AS ABAP system.
Type: String
userName:
Label:
en: SAP system username
Description:
en: The username to log on to the SAP GUI of the SAP AS ABAP system.
Type: String
userPassword:
Label:
en: SAP system user password
Description:
en: The password to log on to the SAP GUI of the SAP AS ABAP system.
Type: String
clientNumber:
Label:
en: SAP client
Description:
en: The client number used to log on to the SAP GUI, such as 800 or 600.
Type: String
className:
Label:
en: SMLG logon group name
Description:
en: The name of the SMLG logon group. The system automatically adds the scaled-out AAS to this logon group. If you leave this parameter empty, the system adds the AAS to the default 'SPACE' group.
Type: String
Default: SPACE
instanceIds:
Label:
en: ECS instance IDs
Description:
en: The IDs of the ECS instances. We recommend that you use the default value ["${instanceIds}"] provided by Auto Scaling.
Type: List
Default:
- ${instanceIds}
lifecycleHookId:
Label:
en: Lifecycle hook ID
Description:
en: The ID of the lifecycle hook. We recommend that you use the default value ${lifecycleHookId} provided by Auto Scaling.
Type: String
Default: ${lifecycleHookId}
lifecycleActionToken:
Label:
en: Lifecycle action token
Description:
en: The token for the scaling activity associated with the instance. We recommend that you use the default value ${lifecycleActionToken} provided by Auto Scaling.
Type: String
Default: ${lifecycleActionToken}
OOSAssumeRole:
Label:
en: RAM role for OOS
Type: String
Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: UpdateAliyunAssist
Action: ACS::ECS::RunCommand
OnError: runCommand
Description:
en: Updates Cloud Assistant
Properties:
regionId: '{{ ACS::RegionId }}'
commandContent: 'rpm -ivh --force "https://aliyun-client-assist-{{ ACS::RegionId }}.oss-{{ ACS::RegionId }}-internal.aliyuncs.com/linux/aliyun_assist_latest.rpm"'
instanceId: '{{ ACS::TaskLoopItem }}'
commandType: RunShellScript
Loop:
RateControl:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
Items: '{{ instanceIds }}'
Outputs:
commandOutputs:
AggregateType: Fn::ListJoin
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: invocationOutput
- Name: runCommand
Action: ACS::ECS::RunCommand
OnError: CompleteLifecycleActionForAbandon
OnSuccess: CompleteLifecycleActionForContinue
Description:
en: Executes the installation script
Properties:
regionId: '{{ ACS::RegionId }}'
commandContent: 'mkdir -p /tmp/sap-auto-scaling && cd /tmp/sap-auto-scaling; wget -q https://sh-test-hangzhou.oss-cn-hangzhou.aliyuncs.com/sap-utilities/sap-auto-scaling/sap_auto_scaling.sh -O /tmp/sap-auto-scaling/sap_auto_scaling.sh && bash sap_auto_scaling.sh --UsrsapDiskName vdb --SwapDiskName vdc --PASIP {{ PASIP }} --RootPassword {{ rootPassword }} --SID {{ SAPSID }} --UserName {{ userName }} --UserPassword {{ userPassword }} --ClientNumber {{ clientNumber }} --ClassName {{ className }}'
instanceId: '{{ ACS::TaskLoopItem }}'
commandType: 'RunShellScript'
enableParameter: true
Loop:
RateControl:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
Items: '{{ instanceIds }}'
Outputs:
commandOutputs:
AggregateType: Fn::ListJoin
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: invocationOutput
- Name: CompleteLifecycleActionForContinue
Action: ACS::ExecuteAPI
Description:
en: Sets the lifecycle action result to CONTINUE
OnSuccess: ACS::END
Properties:
Service: ESS
API: CompleteLifecycleAction
Parameters:
RegionId: '{{ ACS::RegionId }}'
LifecycleHookId: '{{ lifecycleHookId }}'
LifecycleActionToken: '{{ lifecycleActionToken }}'
LifecycleActionResult: CONTINUE
- Name: CompleteLifecycleActionForAbandon
Action: ACS::ExecuteAPI
Description:
en: Sets the lifecycle action result to ABANDON
Properties:
Service: ESS
API: CompleteLifecycleAction
Parameters:
RegionId: '{{ ACS::RegionId }}'
LifecycleHookId: '{{ lifecycleHookId }}'
LifecycleActionToken: '{{ lifecycleActionToken }}'
LifecycleActionResult: ABANDON
Outputs:
commandOutputs:
Type: List
Value: '{{ runCommand.commandOutputs }}'