Skip to content

Commit 7f0ec00

Browse files
Merge pull request #252099 from KimForss/main
Workload deployment
2 parents 6edff97 + b232369 commit 7f0ec00

File tree

2 files changed

+105
-90
lines changed

2 files changed

+105
-90
lines changed

articles/sap/automation/bash/install-workloadzone.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
online version: https://github.com/Azure/sap-hana
2+
online version: https://github.com/Azure/SAP-automation
33
schema: 2.0.0
44
author: kimforss
55
ms.author: kimforss
66
ms.reviewer: kimforss
7-
ms.date: 10/21/2021
7+
ms.date: 09/19/2023
88
ms.topic: reference
99
ms.service: sap-on-azure
1010
ms.subservice: sap-automation
@@ -28,7 +28,7 @@ install_workloadzone.sh [ -p or --parameterfile ] <String>
2828
```
2929

3030
## Description
31-
The `install_workloadzone.sh` command deploys a new SAP workload zone. The workload zone contains the shared resources for all VMs.
31+
The `install_workloadzone.sh` script deploys a new SAP workload zone. The workload zone contains the shared resources for all SAP VMs.
3232

3333
## Examples
3434

@@ -48,14 +48,16 @@ This example deploys the workload zone, as defined by the parameter files. The p
4848
```bash
4949
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/LANDSCAPE/DEV-WEEU-SAP01-INFRASTRUCTURE
5050

51-
export subscriptionId=<subscriptionID>
52-
export appId=<appID>
53-
export spnSecret="<password>"
54-
export tenantId=<tenantID>
55-
export keyvault=<keyvaultName>
56-
export storageAccount=<storageaccountName>
51+
export subscriptionId=<subscriptionID>
52+
export appId=<appID>
53+
export spnSecret="<password>"
54+
export tenantId=<tenantID>
55+
export keyvault=<keyvaultName>
56+
export storageAccount=<storageaccountName>
5757
export statefileSubscription=<statefile_subscription>
5858

59+
export DEPLOYMENT_REPO_PATH=~/Azure_SAP_Automated_Deployment/sap-automation
60+
5961
${DEPLOYMENT_REPO_PATH}/deploy/scripts/install_workloadzone.sh \
6062
--parameter_file DEV-WEEU-SAP01-INFRASTRUCTURE.tfvars \
6163
--keyvault $keyvault \

articles/sap/automation/tutorial.md

Lines changed: 94 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,16 @@ A valid SAP user account (SAP-User or S-User account) with software download pri
138138
1. Create the deployment folder and clone the repository.
139139
140140
```cloudshell-interactive
141-
mkdir -p ~/Azure_SAP_Automated_Deployment
141+
mkdir -p ~/Azure_SAP_Automated_Deployment; cd $_
142142
143-
cd ~/Azure_SAP_Automated_Deployment
143+
git clone https://github.com/Azure/sap-automation-bootstrap.git config
144144
145-
git clone https://github.com/Azure/sap-automation.git
145+
git clone https://github.com/Azure/sap-automation.git sap-automation
146146
147-
git clone https://github.com/Azure/sap-automation-samples.git
147+
git clone https://github.com/Azure/sap-automation-samples.git samples
148+
149+
cp -Rp samples/Terraform/WORKSPACES ~/Azure_SAP_Automated_Deployment/WORKSPACES
150+
148151
```
149152
150153
1. Optionally, validate the versions of Terraform and the Azure CLI available on your instance of Cloud Shell.
@@ -156,7 +159,7 @@ A valid SAP user account (SAP-User or S-User account) with software download pri
156159
To run the automation framework, update to the following versions:
157160
158161
- `az` version 2.4.0 or higher.
159-
- `terraform` version 1.2.8 or higher. [Upgrade by using the Terraform instructions](https://www.terraform.io/upgrade-guides/0-12.html), as necessary.
162+
- `terraform` version 1.5 or higher. [Upgrade by using the Terraform instructions](https://www.terraform.io/upgrade-guides/0-12.html), as necessary.
160163
161164
## Create a service principal
162165
@@ -214,7 +217,7 @@ If you don't assign the User Access Administrator role to the service principal,
214217
1. Open Visual Studio Code from Cloud Shell.
215218
216219
```cloudshell-interactive
217-
cd ~/Azure_SAP_Automated_Deployment/sap-automation-samples/Terraform
220+
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES
218221
code .
219222
```
220223
@@ -275,27 +278,28 @@ The sample SAP library configuration file `MGMT-NOEU-SAP_LIBRARY.tfvars` is in t
275278
1. Create the deployer and the SAP library. Add the service principal details to the deployment key vault.
276279
277280
```bash
278-
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES
279281
280282
export subscriptionId="<subscriptionId>"
281283
export spn_id="<appId>"
282284
export spn_secret="<password>"
283285
export tenant_id="<tenantId>"
284286
export env_code="MGMT"
287+
export vnet_code="DEP00"
285288
export region_code="<region_code>"
286289
287290
export DEPLOYMENT_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
288-
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation-samples/Terraform/WORKSPACES"
289-
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
291+
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/WORKSPACES"
290292
export ARM_SUBSCRIPTION_ID="${subscriptionId}"
291293
292-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/deploy_controlplane.sh \
293-
--deployer_parameter_file DEPLOYER/${env_code}-${region_code}-DEP00-INFRASTRUCTURE/${env_code}-${region_code}-DEP00-INFRASTRUCTURE.tfvars \
294-
--library_parameter_file LIBRARY/${env_code}-${region_code}-SAP_LIBRARY/${env_code}-${region_code}-SAP_LIBRARY.tfvars \
295-
--subscription "${subscriptionId}" \
296-
--spn_id "${spn_id}" \
297-
--spn_secret "${spn_secret}" \
298-
--tenant_id "${tenant_id}" \
294+
cd $CONFIG_REPO_PATH
295+
296+
${DEPLOYMENT_REPO_PATH}/deploy/scripts/deploy_controlplane.sh \
297+
--deployer_parameter_file DEPLOYER/${env_code}-${region_code}-DEP00-INFRASTRUCTURE/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars \
298+
--library_parameter_file LIBRARY/${env_code}-${region_code}-SAP_LIBRARY/${env_code}-${region_code}-SAP_LIBRARY.tfvars \
299+
--subscription "${subscriptionId}" \
300+
--spn_id "${spn_id}" \
301+
--spn_secret "${spn_secret}" \
302+
--tenant_id "${tenant_id}" \
299303
--auto-approve
300304
```
301305
@@ -419,11 +423,12 @@ To connect to the deployer:
419423
To configure the deployer, run the following script:
420424
421425
```bash
422-
mkdir -p ~/Azure_SAP_Automated_Deployment
423426
424-
cd ~/Azure_SAP_Automated_Deployment
427+
mkdir -p ~/Azure_SAP_Automated_Deployment; cd $_
425428
426-
git clone https://github.com/Azure/sap-automation.git
429+
git clone https://github.com/Azure/sap-automation.git sap-automation
430+
431+
git clone https://github.com/Azure/sap-automation-samples.git samples
427432
428433
cd sap-automation/deploy/scripts
429434
@@ -591,20 +596,22 @@ For this example configuration, the resource group is `MGMT-NOEU-DEP00-INFRASTRU
591596
- Select **Library resource group** > **State storage account** > **Containers** > `tfstate`. Copy the name of the deployer state file.
592597
- Following from the preceding example, the name of the blob is `MGMT-NOEU-DEP00-INFRASTRUCTURE.terraform.tfstate`.
593598

594-
1. If necessary, register the SPN.
599+
1. If necessary, register the Service Principal.
595600

596-
The first time an environment is instantiated, an SPN must be registered. In this tutorial, the control plane is in the `MGMT` environment and the workload zone is in `DEV`. Therefore, an SPN must be registered for `DEV` at this time.
601+
The first time an environment is instantiated, a Service Principal must be registered. In this tutorial, the control plane is in the `MGMT` environment and the workload zone is in `DEV`. Therefore, a Service Principal must be registered for the `DEV` environment.
597602

598603
```bash
599-
export subscriptionId="<subscriptionId>"
600-
export spn_id="<appID>"
601-
export spn_secret="<password>"
602-
export tenant_id="<tenant>"
603-
export key_vault="<vaultID>"
604-
export env_code="DEV"
605-
export region_code="<region_code>"
604+
export subscriptionId="<subscriptionId>"
605+
export spn_id="<appID>"
606+
export spn_secret="<password>"
607+
export tenant_id="<tenant>"
608+
export key_vault="<vaultID>"
609+
export env_code="DEV"
610+
export region_code="<region_code>"
611+
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
612+
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/WORKSPACES"
606613
607-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/set_secrets.sh \
614+
${SAP_AUTOMATION_REPO_PATH}/deploy/scripts/set_secrets.sh \
608615
--environment "${env_code}" \
609616
--region "${region_code}" \
610617
--vault "${key_vault}" \
@@ -618,22 +625,6 @@ For this example configuration, the resource group is `MGMT-NOEU-DEP00-INFRASTRU
618625

619626
1. Connect to your deployer VM for the following steps. A copy of the repo is now there.
620627

621-
1. Go to the `sap-automation` folder and optionally refresh the repository.
622-
623-
```bash
624-
cd ~/Azure_SAP_Automated_Deployment/sap-automation/
625-
626-
git pull
627-
```
628-
629-
1. Go into the `WORKSPACES/LANDSCAPE` folder and copy the sample configuration files to use from the repository.
630-
631-
```bash
632-
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/LANDSCAPE
633-
634-
cp -Rp ../../sap-automation/training-materials/WORKSPACES/LANDSCAPE/DEV-[REGION]-SAP01-INFRASTRUCTURE .
635-
```
636-
637628
## Deploy the workload zone
638629

639630
Use the [install_workloadzone](bash/install-workloadzone.md) script to deploy the SAP workload zone.
@@ -665,16 +656,36 @@ Use the [install_workloadzone](bash/install-workloadzone.md) script to deploy th
665656
export sap_env_code="DEV"
666657
export region_code="<region_code>"
667658
export key_vault="<vaultID>"
668-
659+
660+
export deployer_vnet_code="DEP01"
661+
export vnet_code="SAP02"
662+
663+
export ARM_SUBSCRIPTION_ID="<subscriptionId>"
664+
export ARM_CLIENT_ID="<appId>"
665+
export ARM_CLIENT_SECRET="<password>"
666+
export ARM_TENANT_ID="<tenantId>"
667+
669668
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/LANDSCAPE/${sap_env_code}-${region_code}-SAP01-INFRASTRUCTURE
670-
671-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/install_workloadzone.sh \
672-
--parameterfile ./${sap_env_code}-${region_code}-SAP01-INFRASTRUCTURE.tfvars \
673-
--deployer_environment "${deployer_env_code}" \
674-
--deployer_tfstate_key "${deployer_env_code}-${region_code}-DEP00-INFRASTRUCTURE.terraform.tfstate" \
675-
--keyvault "${key_vault}" \
676-
--storageaccountname "${tfstate_storage_account}" \
677-
--auto-approve
669+
670+
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/WORKSPACES"
671+
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
672+
673+
az login --service-principal -u "${ARM_CLIENT_ID}" -p="${ARM_CLIENT_SECRET}" --tenant "${ARM_TENANT_ID}"
674+
675+
cd "${CONFIG_REPO_PATH}/LANDSCAPE/${sap_env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE"
676+
parameterFile="${sap_env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars"
677+
deployerState="${deployer_env_code}-${region_code}-${deployer_vnet_code}-INFRASTRUCTURE.terraform.tfstate"
678+
679+
$SAP_AUTOMATION_REPO_PATH/deploy/scripts/install_workloadzone.sh \
680+
--parameterfile "${parameterFile}" \
681+
--deployer_environment "${deployer_env_code}" \
682+
--deployer_tfstate_key "${deployerState}" \
683+
--keyvault "${key_vault}" \
684+
--storageaccountname "${tfstate_storage_account}" \
685+
--subscription "${ARM_SUBSCRIPTION_ID}" \
686+
--spn_id "${ARM_CLIENT_ID}" \
687+
--spn_secret "${ARM_CLIENT_SECRET}" \
688+
--tenant_id "${ARM_TENANT_ID}"
678689
```
679690

680691
The workload zone deployment should start automatically.
@@ -687,12 +698,6 @@ Connect to your deployer VM for the following steps. A copy of the repo is now t
687698

688699
Go into the `WORKSPACES/SYSTEM` folder and copy the sample configuration files to use from the repository.
689700

690-
```bash
691-
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/SYSTEM
692-
693-
cp -Rp ../../sap-automation/training-materials/WORKSPACES/SYSTEM/DEV-[REGION]-SAP01-X00 .
694-
```
695-
696701
## Deploy the SAP system infrastructure
697702

698703
After the workload zone is finished, you can deploy the SAP system infrastructure resources. The SAP system creates your VMs and supporting components for your SAP application. Use the [installer.sh](bash/installer.md) script to deploy the SAP system.
@@ -708,18 +713,21 @@ Deploy the SAP system.
708713

709714
```bash
710715
711-
export sap_env_code="DEV"
712-
export region_code="<region_code>"
716+
export sap_env_code="DEV"
717+
export region_code="<region_code>"
718+
export vnet_code="SAP01"
713719
714-
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/SYSTEM/${sap_env_code}-${region_code}-SAP01-X00
720+
export CONFIG_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/WORKSPACES"
721+
export SAP_AUTOMATION_REPO_PATH="${HOME}/Azure_SAP_Automated_Deployment/sap-automation"
715722
716-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/installer.sh \
717-
--parameterfile "${sap_env_code}-${region_code}-SAP01-X00.tfvars" \
718-
--type sap_system \
719-
--auto-approve
723+
cd ${CONFIG_REPO_PATH}/SYSTEM/${sap_env_code}-${region_code}-${vnet_code}-X00
724+
725+
${DEPLOYMENT_REPO_PATH}/deploy/scripts/installer.sh \
726+
--parameterfile "${sap_env_code}-${region_code}-${vnet_code}-X00.tfvars" \
727+
--type sap_system
720728
```
721729

722-
The deployment command for the `northeurope` example will look like:
730+
The deployment command for the `northeurope` example looks like:
723731

724732
```bash
725733
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/SYSTEM/DEV-NOEU-SAP01-X00
@@ -742,7 +750,7 @@ Go to the system deployment folder.
742750
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/SYSTEM/DEV-NOEU-SAP01-X00/
743751
```
744752

745-
Make sure you have the following files in the current folders: `sap-parameters.yaml` and `SID_host.yaml`.
753+
Make sure you have the following files in the current folders: `sap-parameters.yaml` and `X00_host.yaml`.
746754

747755
For a standalone SAP S/4HANA system, there are eight playbooks to run in sequence. One way you can run the playbooks is to use the **Configuration** menu.
748756

@@ -766,14 +774,14 @@ This playbook does the SAP OS configuration setup on all the machines. The steps
766774

767775
This playbook downloads the SAP software to the SCS virtual machine.
768776

769-
### Playbook: HANA DB install
770-
771-
This playbook installs the HANA database instances.
772-
773777
### Playbook: SCS Install
774778

775779
This playbook installs SAP central services. For highly available configurations, the playbook also installs the SAP ERS instance and configures Pacemaker.
776780

781+
### Playbook: HANA DB install
782+
783+
This playbook installs the HANA database instances.
784+
777785
### Playbook: DB load
778786

779787
This playbook invokes the database load task from the primary application server.
@@ -814,11 +822,12 @@ Go to the `DEV-NOEU-SAP01-X00` subfolder inside the `SYSTEM` folder. Then, run t
814822
```bash
815823
export sap_env_code="DEV"
816824
export region_code="NOEU"
825+
export vnet_code="SAP01"
817826
818-
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/SYSTEM/${sap_env_code}-${region_code}-SAP01-X00
827+
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/SYSTEM/${sap_env_code}-${region_code}-${vnet_code}-X00
819828
820829
${DEPLOYMENT_REPO_PATH}/deploy/scripts/remover.sh \
821-
--parameterfile "${sap_env_code}-${region_code}-SAP01-X00.tfvars" \
830+
--parameterfile "${sap_env_code}-${region_code}-${vnet_code}-X00.tfvars" \
822831
--type sap_system
823832
```
824833

@@ -830,11 +839,12 @@ Go to the `DEV-XXXX-SAP01-INFRASTRUCTURE` subfolder inside the `LANDSCAPE` folde
830839
831840
export sap_env_code="DEV"
832841
export region_code="NOEU"
842+
export vnet_code="SAP01"
833843
834-
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/LANDSCAPE/${sap_env_code}-${region_code}-SAP01-INFRASTRUCTURE
844+
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES/LANDSCAPE/${sap_env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE
835845
836-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/remover.sh \
837-
--parameterfile ${sap_env_code}-${region_code}-SAP01-INFRASTRUCTURE.tfvars \
846+
${DEPLOYMENT_REPO_PATH}/deploy/scripts/remover.sh \
847+
--parameterfile ${sap_env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars \
838848
--type sap_landscape
839849
```
840850

@@ -859,10 +869,13 @@ Run the following command:
859869

860870
```bash
861871
export region_code="NOEU"
872+
export env_code="MGMT"
873+
export vnet_code="DEP00"
862874
863-
${DEPLOYMENT_REPO_PATH}/deploy/scripts/remove_controlplane.sh \
864-
--deployer_parameter_file DEPLOYER/MGMT-${region_code}-DEP00-INFRASTRUCTURE/MGMT-${region_code}-DEP00-INFRASTRUCTURE.tfvars \
865-
--library_parameter_file LIBRARY/MGMT-${region_code}-SAP_LIBRARY/MGMT-${region_code}-SAP_LIBRARY.tfvars
875+
cd ~/Azure_SAP_Automated_Deployment/WORKSPACES
876+
${DEPLOYMENT_REPO_PATH}/deploy/scripts/remove_controlplane.sh \
877+
--deployer_parameter_file DEPLOYER/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE/${env_code}-${region_code}-${vnet_code}-INFRASTRUCTURE.tfvars \
878+
--library_parameter_file LIBRARY/${env_code}-${region_code}-SAP_LIBRARY/${env_code}-${region_code}-SAP_LIBRARY.tfvars
866879
```
867880

868881
Verify that all resources are cleaned up.

0 commit comments

Comments
 (0)