全部產品
Search
文件中心

CloudOps Orchestration Service:ACS-ESS-LifeCycleInstallAAS

更新時間:Sep 06, 2024

模板名稱

ACS-ESS-LifeCycleInstallAAS 使用生命週期掛鈎在執行個體中安裝AAS

立即執行

模板描述

使用生命週期掛鈎在執行個體中安裝AAS(Additional application server)

模板類型

自動化

所有者

Alibaba Cloud

輸入參數

參數名稱

描述

類型

是否必填

預設值

約束

PASIP

PAS私網IP地址

String

rootPassword

PAS root使用者密碼

String

SAPSID

SAP AS ABAP系統的SID

String

userName

SAP系統使用者名稱

String

userPassword

SAP系統使用者密碼

String

clientNumber

SAP CLIENT

String

className

SMLG登入組名

String

SPACE

instanceIds

ECS執行個體ID列表

List

['${instanceIds}']

lifecycleHookId

生命週期掛鈎ID

String

${lifecycleHookId}

lifecycleActionToken

執行個體關聯的特定伸縮活動的令牌

String

${lifecycleActionToken}

OOSAssumeRole

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"
        }
    ]
}

詳情

ACS-ESS-LifeCycleInstallAAS詳情

模板內容

FormatVersion: OOS-2019-06-01
Description:
  en: Use lifecycleHook to install AAS(Additional application server) in the specified scaling activity instance.
  zh-cn: 使用生命週期掛鈎在執行個體中安裝AAS(Additional application server)
  name-en: ACS-ESS-LifeCycleInstallAAS
  name-zh-cn: 使用生命週期掛鈎在執行個體中安裝AAS
  categories:
    - elastic_manage
Parameters:
  PASIP:
    Label:
      en: PAS Private IP
      zh-cn: PAS私網IP地址
    Description:
      en: PAS ECS instance private IP address
      zh-cn: SAP AS ABAP系統PAS所在ECS的私網IP地址
    Type: String
  rootPassword:
    Label:
      en: Root Password
      zh-cn: PAS root使用者密碼
    Description:
      en: root password
      zh-cn: PAS root使用者密碼
    Type: String
  SAPSID:
    Label:
      en: SAP AS ABAP System ID
      zh-cn: SAP AS ABAP系統的SID
    Description:
      en: SAP AS ABAP system ID
      zh-cn: SAP AS ABAP系統的SID
    Type: String
  userName:
    Label:
      en: SAP AS ABAP System User
      zh-cn: SAP系統使用者名稱
    Description:
      en: SAP AS ABAP system user name use to logon SAP GUI
      zh-cn: SAP AS ABAP系統SAP GUI的登入使用者名稱
    Type: String
  userPassword:
    Label:
      en: SAP AS ABAP System User Password
      zh-cn: SAP系統使用者密碼
    Description:
      en: SAP AS ABAP system user password use to logon SAP GUI
      zh-cn: SAP AS ABAP系統SAP GUI的登入使用者密碼
    Type: String
  clientNumber:
    Label:
      en: SAP CLIENT
      zh-cn: SAP CLIENT
    Description:
      en: Client number use to logon SAP GUI
      zh-cn: SAP GUI的登入Client,如800、600
    Type: String
  className:
    Label:
      en: SMLG Logon Group Name
      zh-cn: SMLG登入組名
    Description:
      en: SMLG logon group name
      zh-cn: SMLG登入組名。擴充出來的AAS將自動加入到SMLG登入組中,如果不填寫,則會自動加入到預設的'SPACE'組中
    Type: String
    Default: SPACE
  instanceIds:
    Label:
      en: instanceIds
      zh-cn: ECS執行個體ID列表
    Description:
      en: The ID list of the ECS instance
      zh-cn: ECS執行個體ID列表,請使用Auto Scaling系統預設值 ["${instanceId}"]
    Type: List
    Default:
      - ${instanceIds}
  lifecycleHookId:
    Label:
      en: LifecycleHookId
      zh-cn: 生命週期掛鈎ID
    Description:
      en: The ID of the lifecycle hook.
      zh-cn: 生命週期掛鈎ID,請使用Auto Scaling系統預設值 ${lifecycleHookId}
    Type: String
    Default: ${lifecycleHookId}
  lifecycleActionToken:
    Label:
      en: LifecycleActionToken
      zh-cn: 執行個體關聯的特定伸縮活動的令牌
    Description:
      en: The token that indicates a specific scaling activity associated with an instance
      zh-cn: 執行個體關聯的特定伸縮活動的令牌,請使用Auto Scaling系統預設值 ${lifecycleActionToken}
    Type: String
    Default: ${lifecycleActionToken}
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: UpdateAliyunAssist
    Action: ACS::ECS::RunCommand
    OnError: runCommand
    Description:
      en: Update cloud assistant
      zh-cn: 更新雲助手
    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: Execute install script
      zh-cn: 執行安裝指令碼
    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: Modify lifecycle action for continue
      zh-cn: 修改伸縮活動的等待狀態為繼續完成
    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: Complete lifecycle action for Abandon
      zh-cn: 修改伸縮活動的等待狀態為棄用
    Properties:
      Service: ESS
      API: CompleteLifecycleAction
      Parameters:
        RegionId: '{{ ACS::RegionId }}'
        LifecycleHookId: '{{ lifecycleHookId }}'
        LifecycleActionToken: '{{ lifecycleActionToken }}'
        LifecycleActionResult: ABANDON
Outputs:
  commandOutputs:
    Type: List
    Value: '{{ runCommand.commandOutputs }}'