全部產品
Search
文件中心

CloudOps Orchestration Service:ACS-SAP-SAPAutoScaling

更新時間:Sep 05, 2024

模板名稱

ACS-SAP-SAPAutoScaling SAP AAS自動擴充

立即執行

模板描述

SAP AAS(Additional application server)自動擴充服務,基於已有SAP系統的PAS(Primary application server)建立Auto Scaling組,自動或手動擴充ECS執行個體並部署AAS,並將AAS自動加入SAP Logon groups

模板類型

自動化

所有者

Alibaba Cloud

輸入參數

參數名稱

描述

類型

是否必填

預設值

約束

PASInstanceId

PAS執行個體ID

Json

RootPassword

root使用者密碼

String

字串校正Regex : ^{{oos-secret:.*$

SAPSID

SAP系統SID

String

Username

SAP系統使用者名稱

String

UserPassword

SAP系統使用者密碼

String

字串校正Regex : ^{{oos-secret:.*$

ClientNumber

SAP CLIENT

String

AASCount

可擴充的AAS數量

Number

KeyPairName

金鑰組名稱

String

UsrsapDiskSize

/usr/sap檔案系統大小

String

SwapDiskSize

Swap大小

String

AASInstanceId

AAS執行個體ID

Json

{'Type': 'ResourceIds', 'ResourceIds': [''], 'RegionId': '{{ ACS::RegionId }}'}

ClassName

SMLG登入組名

String

SPACE

CpuTargetValue

期望平均CPU使用率

String

80

Cooldown

觸發擴充間隔時間

Number

300

輸出參數

參數名稱

描述

類型

ScalingGroupId

String

執行此模板需要的權限原則

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ros:CreateStack",
                "ros:GetStack"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

詳情

ACS-SAP-SAPAutoScaling詳情

模板內容

FormatVersion: OOS-2019-06-01
Description:
  en: ''
  zh-cn: SAP AAS(Additional application server)自動擴充服務,基於已有SAP系統的PAS(Primary application server)建立Auto Scaling組,自動或手動擴充ECS執行個體並部署AAS,並將AAS自動加入SAP Logon groups
  name-en: ACS-SAP-SAPAutoScaling
  name-zh-cn: SAP AAS自動擴充
Parameters:
  PASInstanceId:
    Type: Json
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
    Description:
      zh-cn: 請選擇已有的SAP AS ABAP系統PAS所在的ECS
      en: Please select the ECS where the existing SAP AS ABAP system PAS is located
    Label:
      zh-cn: PAS執行個體ID
      en: PASInstanceId
  AASInstanceId:
    Type: Json
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
    Description:
      zh-cn: 請選擇已有的SAP AS ABAP系統AAS所在的ECS。選中執行個體的CPU負載也會參於計算CPU平均使用率。如果沒有其他AAS,或已有的AAS和PAS在同一台ECS執行個體,則無需選擇
      en: Please select the ECS where the existing SAP AS ABAP system AAS is located. The CPU load of the selected instance will also be used to calculate the average CPU usage. If there is no other AAS, or the existing AAS and PAS are in the same ECS instance, you do not need to select
    Label:
      zh-cn: AAS執行個體ID
      en: AASInstanceId
    Default: 
      Type: ResourceIds
      ResourceIds:
        - ""
      RegionId: '{{ ACS::RegionId }}'
  RootPassword:
    Type: String
    Description:
      zh-cn: PAS所在執行個體root使用者的密碼,為保障資料安全,僅支援使用參數倉庫的加密參數功能,請先點擊輸入框右側的按鈕,建立並選擇加密參數。更多詳細過程請參考<a href='https://help.aliyun.com/document_detail/186828.html' target='_blank'>建立加密參數</a>和<a href='https://help.aliyun.com/document_detail/193238.html' target='_blank'>使用加密參數</a>
      en: The password of the root user of the instance where the PAS is located. To ensure data security, only the encryption parameter function of the parameter warehouse is supported. Please click the button on the right side of the input box to create and select the encryption parameter. For more details, please refer to <a href='https://help.aliyun.com/document_detail/186828.html' target='_blank'>Create encryption parameters</a> and <a href='https:// help.aliyun.com/document_detail/193238.html' target='_blank'>Use encryption parameters</a>
    Label:
      zh-cn: root使用者密碼
      en: RootPassword
    AllowedPattern: '^\{\{oos-secret:.*$'
  SAPSID:
    Type: String
    Label:
      zh-cn: SAP系統SID
      en: SAPSID
  Username:
    Type: String
    Description:
      zh-cn: SAP AS ABAP系統SAP GUI的登入使用者名稱
      en: SAP AS ABAP system SAP GUI login user name
    Label:
      zh-cn: SAP系統使用者名稱
      en: Username
  UserPassword:
    Type: String
    Description:
      zh-cn: SAP GUI的登入使用者密碼,為保障資料安全,僅支援使用參數倉庫的加密參數功能,請先點擊輸入框右側的按鈕,建立並選擇加密參數。更多詳細過程請參考<a href='https://help.aliyun.com/document_detail/186828.html' target='_blank'>建立加密參數</a>和<a href='https://help.aliyun.com/document_detail/193238.html' target='_blank'>使用加密參數</a>
      en: The login user password of SAP GUI, in order to ensure data security, only supports the encryption parameter function of the parameter warehouse. Please click the button on the right side of the input box to create and select the encryption parameter. For more details, please refer to <a href='https://help.aliyun.com/document_detail/186828.html' target='_blank'>Create encryption parameters</a> and <a href='https:// help.aliyun.com/document_detail/193238.html' target='_blank'>Use encryption parameters</a>
    Label:
      zh-cn: SAP系統使用者密碼
      en: UserPassword
    AllowedPattern: '^\{\{oos-secret:.*$'
  ClientNumber:
    Type: String
    Description:
      zh-cn: SAP GUI的登入Client,如800、600
      en: Login Client of SAP GUI, such as 800, 600
    Label:
      zh-cn: SAP CLIENT
      en: ClientNumber
  ClassName:
    Type: String
    Description:
      zh-cn: SMLG登入組名。擴充出來的AAS將自動加入到SMLG登入組中,如果不填寫,則會自動加入到預設的'SPACE'組中,如果沒有設定SMLG組,則不需要填寫。為方便靈活的調整AAS加入的組,建議您使用<a href='https://help.aliyun.com/document_detail/193238.html' target='_blank'>加密參數</a>
      en: SMLG login group name. The extended AAS will be automatically added to the SMLG login group. If it is not filled in, it will be automatically added to the default 'SPACE' group. If the SMLG group is not set, it is not required to fill in. To facilitate and flexibly adjust the groups that AAS joins, it is recommended that you use <a href='https://help.aliyun.com/document_detail/193238.html' target='_blank'>encryption parameters</a>
    Label:
      zh-cn: SMLG登入組名
      en: ClassName
    Default: 'SPACE'
  AASCount:
    Type: Number
    Label:
      zh-cn: 可擴充的AAS數量
      en: AASCount
    MinValue: 1
    MaxValue: 2000
  CpuTargetValue:
    Type: String
    Description:
      zh-cn: PAS和AAS所在ECS的期望平均CPU使用率,平均CPU使用率=(PAS所在ECS執行個體+添加的AAS所在ECS執行個體+自動擴充的AAS所在ECS執行個體)CPU利用率總和/所有執行個體CPU總核心數x100%。每分鐘統計一次實際平均CPU使用率,當實際值連續超到期望值三次,則會觸發自動擴充AAS動作。如果需要自訂統計周期和觸發次數,請在執行完成後,在<a href='https://ess.console.aliyun.com/#/v3/welcome' target='_blank'>Auto Scaling控制台</a>添加相應的警示任務,詳細內容請參考<a href='https://help.aliyun.com/document_detail/25907.html' target='_blank'>建立警示任務</a>
      en: The expected average CPU usage of the ECS where the PAS and AAS are located. Average CPU usage = (the ECS instance where the PAS is located + the ECS instance where the added AAS is located + the ECS instance where the automatically expanded AAS is located) the sum of the CPU utilization / the total number of CPU cores in all instances x100 %. The actual average CPU usage is counted every minute. When the actual value exceeds the expected value three times in a row, the automatic expansion AAS action will be triggered. If you need to customize the statistics period and trigger times, please click the <a href='https://ess.console.aliyun.com/#/v3/welcome' target='_blank'> elastic scaling console after the execution is completed. </a>Add the corresponding alarm task. For details, please refer to <a href='https://help.aliyun.com/document_detail/25907.html' target='_blank'>Create an alarm task</a>
    Label:
      zh-cn: 期望平均CPU使用率
      en: CpuTargetValue
    Default: 80
  Cooldown:
    Type: Number
    Description:
      zh-cn: 觸發自動擴充AAS的間隔時間,單位:秒。例如:指定間隔時間為300秒,則在擴充一台AAS後的300秒內,即使平均CPU使用率超過'期望平均CPU使用率',也不會再次觸發擴充動作
      en: The interval for triggering automatic expansion of AAS, in seconds. For example, if the specified interval is 300 seconds, within 300 seconds after expanding an AAS, even if the average CPU usage exceeds the 'expected average CPU usage', the expansion action will not be triggered again
    Label:
      zh-cn: 觸發擴充間隔時間
      en: Cooldown
    Default: 300
    MinValue: 0
    MaxValue: 86400
  KeyPairName:
    Type: String
    Description:
      zh-cn: 擴充出的AAS所在ECS執行個體所綁定的金鑰組名稱,用於登入ECS執行個體,請預先在<a href='https://ecs.console.aliyun.com/#/keyPair/region/' target='_blank'>金鑰組控制台</a>建立和管理金鑰組
      en: The name of the key pair bound to the ECS instance where the extended AAS resides. It is used to log in to the ECS instance. Please pre-register in the <a href='https://ecs.console.aliyun.com/#/keyPair/region/' target ='_blank'>Key Pair Console</a>Create and manage key pairs
    Label:
      zh-cn: 金鑰組名稱
      en: KeyPairName
  UsrsapDiskSize:
    Type: String
    Description:
      zh-cn: 擴充出的AAS所在ECS執行個體的'/usr/sap'檔案系統大小,單位GB
      en: Size of the '/usr/sap' file system of the ECS instance where the extended AAS resides, in GB
    Label:
      zh-cn: /usr/sap檔案系統大小
      en: UsrsapDiskSize
  SwapDiskSize:
    Type: String
    Description:
      zh-cn: 擴充出的AAS所在ECS執行個體的Swap分區大小,單位GB
      en: Size of the swap partition of the ECS instance where the extended AAS resides, in GB
    Label:
      zh-cn: Swap大小
      en: SwapDiskSize
Tasks:
  - Name: getPASInstance
    Action: 'ACS::SelectTargets'
    Properties:
      ResourceType: 'ALIYUN::ECS::Instance'
      Filters:
        - '{{ PASInstanceId }}'
    Outputs:
      PASInstanceId:
        ValueSelector: 'Instances.Instance[0].InstanceId'
        Type: String
      VSwitchId:
        ValueSelector: 'Instances.Instance[0].VpcAttributes.VSwitchId'
        Type: String
      PASIP:
        ValueSelector: 'Instances.Instance[0].VpcAttributes.PrivateIpAddress.IpAddress[0]'
        Type: String
  - Name: getAASInstance
    Action: 'ACS::SelectTargets'
    Properties:
      ResourceType: 'ALIYUN::ECS::Instance'
      Filters:
        - '{{ AASInstanceId }}'
    Outputs:
      AASInstanceId:
        ValueSelector: 'Instances.Instance[].InstanceId'
        Type: List
  - Name: createStack
    Action: 'ACS::ExecuteAPI'
    Description:
      en: 'Create scaling group, scaling rule, scaling configuration and lifecycle hook.'
      zh-cn: 建立Auto Scaling組、Auto Scaling規則、Auto Scaling配置和生命週期掛鈎等雲資源
    Properties:
      Service: ROS
      API: CreateStack
      Parameters:
        StackName: 'AutoScaling-{{ACS::ExecutionId}}'
        TimeoutInMinutes: 10
        DisableRollback: true
        Parameters:
          - ParameterKey: ClassName
            ParameterValue: '{{ ClassName }}'
          - ParameterKey: ClientNumber
            ParameterValue: '{{ ClientNumber }}'
          - ParameterKey: UserPassword
            ParameterValue: '{{ UserPassword }}'
          - ParameterKey: Username
            ParameterValue: '{{ Username }}'
          - ParameterKey: SAPSID
            ParameterValue: '{{ SAPSID }}'
          - ParameterKey: PASInstanceId
            ParameterValue: '{{ getPASInstance.PASInstanceId }}'
          - ParameterKey: ExistingAASInstances
            ParameterValue: 
              'Fn::If':
                - 'Fn::Equals':
                  - []
                  - '{{ getAASInstance.AASInstanceId }}'
                - '[]'
                - 'Fn::Jq':
                  - First
                  - 'tostring'
                  - '{{ getAASInstance.AASInstanceId }}'
          - ParameterKey: RootPassword
            ParameterValue: '{{ RootPassword }}'
          - ParameterKey: PASIP
            ParameterValue: '{{ getPASInstance.PASIP }}'
          - ParameterKey: VSwitchId
            ParameterValue: '{{ getPASInstance.VSwitchId }}'
          - ParameterKey: AASCount
            ParameterValue: '{{ AASCount }}'
          - ParameterKey: Cooldown
            ParameterValue: '{{ Cooldown }}'
          - ParameterKey: CpuTargetValue
            ParameterValue: '{{ CpuTargetValue }}'
          - ParameterKey: UsrsapDiskSize
            ParameterValue: '{{ UsrsapDiskSize }}'
          - ParameterKey: SwapDiskSize
            ParameterValue: '{{ SwapDiskSize }}'
          - ParameterKey: KeyPairName
            ParameterValue: '{{ KeyPairName }}'
        TemplateURL: 'http://ros-template.cn-hangzhou.oss.aliyun-inc.com/S4HANA_Auto_Scaling.json'
    Outputs:
      StackId:
        Type: String
        ValueSelector: StackId
  - Name: untilStackReady
    Action: 'ACS::WaitFor'
    Description:
      en: Wait the stack status util CREATE_COMPLETE
      zh-cn: 等待資源棧至建立成功狀態
    Retries: 10
    Properties:
      Service: ROS
      API: GetStack
      Parameters:
        StackId: '{{createStack.StackId}}'
      DesiredValues:
        - CREATE_COMPLETE
      StopRetryValues:
        - CREATE_FAILED
        - CHECK_FAILED
        - ROLLBACK_FAILED
        - ROLLBACK_COMPLETE
        - CREATE_ROLLBACK_COMPLETE
        - CREATE_ROLLBACK_FAILED
      PropertySelector: Status
    Outputs:
      ScalingGroupId:
        Type: String
        ValueSelector: '.Outputs[] | select(.OutputKey == "ScalingGroupId") | .OutputValue'
Outputs:
  ScalingGroupId:
    Type: String
    Value: '{{ untilStackReady.ScalingGroupId }}'