자동화 프레임워크를 사용하여 SAP 워크로드 영역 배포

SAP 애플리케이션에는 일반적으로 여러 개발 계층이 있습니다. 예를 들어 개발, 품질 보증 및 프로덕션 계층이 있을 수 있습니다. SAP 배포 자동화 프레임워크에서는 이러한 계층을 워크로드 영역이라고 합니다. 여러 Azure 지역에서 워크로드 영역을 사용할 수 있습니다. 그런 다음 각 워크로드 영역에는 고유한 Azure Virtual Network 인스턴스가 있습니다.

SAP 워크로드 영역에서 제공하는 서비스는 다음과 같습니다.

  • 서브넷 및 네트워크 보안 그룹을 포함한 가상 네트워크
  • 시스템 자격 증명에 대한 Azure Key Vault 인스턴스
  • 부팅 진단에 대한 Azure Storage 계정
  • 클라우드 감시자를 위한 Storage 계정
  • Azure NetApp Files 계정 및 용량 풀(선택 사항)
  • Azure Files 네트워크 파일 공유(NFS) 공유 (선택 사항)
  • SAP용 Azure Monitor(선택 사항)

SAP 워크로드 영역을 보여 주는 다이어그램.

워크로드 영역은 일반적으로 허브-스포크 아키텍처에서 스포크에 배포됩니다. 각각 별도의 구독에 있을 수도 있습니다. 프라이빗 DNS는 컨트롤 플레인 또는 구성 가능한 원본에서 지원됩니다.

사전 요구 사항

핵심 구성

다음 예제 매개 변수 파일은 필수 매개 변수만 보여줍니다.

# The environment value is a mandatory field, it is used for partitioning the environments, for example (PROD and NP)
environment="DEV"

# The location value is a mandatory field, it is used to control where the resources are deployed
location="westeurope"

# The network logical name is mandatory - it is used in the naming convention and should map to the workload virtual network logical name
network_name="SAP01"

# network_address_space is a mandatory parameter when an existing virtual network is not used
network_address_space="10.110.0.0/16"

# admin_subnet_address_prefix is a mandatory parameter if the subnets are not defined in the workload or if existing subnets are not used
admin_subnet_address_prefix="10.110.0.0/19"

# db_subnet_address_prefix is a mandatory parameter if the subnets are not defined in the workload or if existing subnets are not used
db_subnet_address_prefix="10.110.96.0/19"

# app_subnet_address_prefix is a mandatory parameter if the subnets are not defined in the workload or if existing subnets are not used
app_subnet_address_prefix="10.110.32.0/19"

# The automation_username defines the user account used by the automation
automation_username="azureadm"

워크로드 영역 배포 자격 증명 준비

SAP Deployment Automation Framework는 배포를 수행할 때 서비스 주체를 사용합니다. 워크로드 영역 배포에 대한 서비스 주체를 만들려면 권한이 있는 계정을 사용하여 서비스 주체를 만듭니다.

az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/<subscriptionID>" --name="<environment>-Deployment-Account"

중요합니다

서비스 주체의 이름은 고유해야 합니다. 명령에서 출력 값을 기록합니다.

  • appId (앱 ID)
  • 암호
  • 테넌트

서비스 주체에 올바른 권한을 할당합니다.

az role assignment create --assignee <appId> \
    --scope /subscriptions/<subscriptionID> \
    --role "User Access Administrator"

SAP 워크로드 영역 배포

샘플 워크로드 영역 구성 파일 DEV-WEEU-SAP01-INFRASTRUCTURE.tfvars 은 폴더에 ~/Azure_SAP_Automated_Deployment/samples/Terraform/WORKSPACES/LANDSCAPE/DEV-WEEU-SAP01-INFRASTRUCTURE 있습니다.

다음 명령을 실행하여 SAP 워크로드 영역을 배포합니다.

배포자에서 이 작업을 수행합니다.

샘플 구성 파일을 복사하여 배포 자동화 프레임워크 테스트를 시작할 수 있습니다.

cd ~/Azure_SAP_Automated_Deployment

cp -R sap-automation/samples/WORKSPACES config
export  ARM_SUBSCRIPTION_ID="<subscriptionId>"
export        ARM_CLIENT_ID="<appId>"
export    ARM_CLIENT_SECRET="<password>"
export        ARM_TENANT_ID="<tenantId>"
export             env_code="DEV"
export          region_code="<region_code>"
export            vnet_code="SAP02"
export deployer_environment="MGMT"

export DEPLOYMENT_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/config/WORKSPACES"
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"

az login --service-principal -u "${ARM_CLIENT_ID}" -p="${ARM_CLIENT_SECRET}" --tenant "${ARM_TENANT_ID}"

cd "${CONFIG_REPO_PATH}/LANDSCAPE/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE"
parameterFile="${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars"

$SAP_AUTOMATION_REPO_PATH/deploy/scripts/install_workloadzone.sh   \
    --parameterfile "${parameterFile}"                             \
    --deployer_environment "${deployer_environment}"               \
    --subscription "${ARM_SUBSCRIPTION_ID}"                        \
    --spn_id "${ARM_CLIENT_ID}"                                    \
    --spn_secret "${ARM_CLIENT_SECRET}"                            \
    --tenant_id "${ARM_TENANT_ID}"

팁 (조언)

스크립트 실행이 실패하면 스크립트를 다시 실행하기 전에 때때로 ~/.sap_deployment_automation/~/.terraform.d/ 디렉터리를 제거하여 로컬 캐시 파일을 지우면 도움이 될 수 있습니다.