Skip to content

Commit 470f640

Browse files
Merge pull request #209507 from msftrobiro/sap-pacemaker-msi-aug29
SAP Pacemaker using MSI update
2 parents 28f3e1d + 59106a9 commit 470f640

File tree

2 files changed

+98
-20
lines changed

2 files changed

+98
-20
lines changed

articles/virtual-machines/workloads/sap/high-availability-guide-rhel-pacemaker.md

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.topic: article
1313
ms.tgt_pltfrm: vm-windows
1414
ms.workload: infrastructure-services
1515
ms.custom: subject-rbac-steps
16-
ms.date: 08/16/2022
16+
ms.date: 08/29/2022
1717
ms.author: radeltch
1818

1919
---
@@ -115,6 +115,13 @@ The following items are prefixed with either **[A]** - applicable to all nodes,
115115
> RHEL 7.4: fence-agents-4.0.11-66.el7_4.12
116116
> For more information, see [Azure VM running as a RHEL High Availability cluster member take a very long time to be fenced, or fencing fails / times-out before the VM shuts down](https://access.redhat.com/solutions/3408711).
117117
118+
> [!IMPORTANT]
119+
> We recommend the following versions of Azure Fence agent (or later) for customers wishing to use Managed Identities for Azure resources instead of service principal names for the fence agent.
120+
> RHEL 8.4: fence-agents-4.2.1-54.el8
121+
> RHEL 8.2: fence-agents-4.2.1-41.el8_2.4
122+
> RHEL 8.1: fence-agents-4.2.1-30.el8_1.4
123+
> RHEL 7.9: fence-agents-4.2.1-41.el7_9.4.
124+
118125
Check the version of the Azure fence agent. If necessary, update it to a version equal to or later than the stated above.
119126

120127
<pre><code># Check the version of the Azure Fence Agent
@@ -222,7 +229,13 @@ The following items are prefixed with either **[A]** - applicable to all nodes,
222229

223230
## Create STONITH device
224231

225-
The STONITH device uses a Service Principal to authorize against Microsoft Azure. Follow these steps to create a Service Principal.
232+
The STONITH device uses either a managed identity for Azure resource or service principal to authorize against Microsoft Azure.
233+
234+
### Using Managed Identity
235+
To create a managed identity (MSI), [create a system-assigned](/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#system-assigned-managed-identity) managed identity for each VM in the cluster. Should a system-assigned managed identity already exist, it will be used. User assigned managed identities should not be used with Pacemaker at this time.
236+
237+
### Using Service Principal
238+
Follow these steps to create a service principal, if not using managed identity.
226239

227240
1. Go to the [Azure portal](https://portal.azure.com).
228241
1. Open the Azure Active Directory blade
@@ -234,12 +247,12 @@ The STONITH device uses a Service Principal to authorize against Microsoft Azure
234247
The sign-on URL is not used and can be any valid URL
235248
1. Select Certificates and Secrets, then click New client secret
236249
1. Enter a description for a new key, select "Never expires" and click Add
237-
1. Make a node the Value. It is used as the **password** for the Service Principal
238-
1. Select Overview. Make a note the Application ID. It is used as the username (**login ID** in the steps below) of the Service Principal
250+
1. Make a node the Value. It is used as the **password** for the service principal
251+
1. Select Overview. Make a note the Application ID. It is used as the username (**login ID** in the steps below) of the service principal
239252

240253
### **[1]** Create a custom role for the fence agent
241254

242-
The Service Principal does not have permissions to access your Azure resources by default. You need to give the Service Principal permissions to start and stop (power-off) all virtual machines of the cluster. If you did not already create the custom role, you can create it using [PowerShell](../../../role-based-access-control/custom-roles-powershell.md) or [Azure CLI](../../../role-based-access-control/custom-roles-cli.md)
255+
Neither managed identity nor service principal have permissions to access your Azure resources by default. You need to give the managed identity or service principal permissions to start and stop (power-off) all virtual machines of the cluster. If you did not already create the custom role, you can create it using [PowerShell](../../../role-based-access-control/custom-roles-powershell.md) or [Azure CLI](../../../role-based-access-control/custom-roles-cli.md)
243256

244257
Use the following content for the input file. You need to adapt the content to your subscriptions that is, replace *xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx* and *yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy* with the Ids of your subscription. If you only have one subscription, remove the second entry in AssignableScopes.
245258

@@ -262,11 +275,20 @@ Use the following content for the input file. You need to adapt the content to y
262275
}
263276
```
264277

265-
### **[A]** Assign the custom role to the Service Principal
278+
### **[A]** Assign the custom role
279+
280+
#### Using Managed Identity
281+
282+
Assign the custom role "Linux Fence Agent Role" that was created in the last chapter to each managed identity of the cluster VMs. Each VM system-assigned managed identity needs the role assigned for every cluster VM's resource. For detailed steps, see [Assign a managed identity access to a resource by using the Azure portal](/azure/active-directory/managed-identities-azure-resources/howto-assign-access-portal). Verify each VM's managed identity role assignment contains all cluster VMs.
283+
284+
> [!IMPORTANT]
285+
> Be aware assignment and removal of authorization with managed identities [can be delayed](/azure/active-directory/managed-identities-azure-resources/managed-identity-best-practice-recommendations#limitation-of-using-managed-identities-for-authorization) until effective.
286+
287+
#### Using Service Principal
288+
289+
Assign the custom role "Linux Fence Agent Role" that was created in the last chapter to the service principal. Do not use the Owner role anymore! For detailed steps, see [Assign Azure roles using the Azure portal](../../../role-based-access-control/role-assignments-portal.md).
290+
Make sure to assign the role for both cluster nodes.
266291

267-
Assign the custom role "Linux Fence Agent Role" that was created in the last chapter to the Service Principal. Do not use the Owner role anymore! For detailed steps, see [Assign Azure roles using the Azure portal](../../../role-based-access-control/role-assignments-portal.md).
268-
Make sure to assign the custom role to the service principal at all VM (cluster node) scopes.
269-
270292
### **[1]** Create the STONITH devices
271293

272294
After you edited the permissions for the virtual machines, you can configure the STONITH devices in the cluster.
@@ -279,18 +301,43 @@ sudo pcs property set stonith-timeout=900
279301
> Option 'pcmk_host_map' is ONLY required in the command, if the RHEL host names and the Azure VM names are NOT identical. Specify the mapping in the format **hostname:vm-name**.
280302
> Refer to the bold section in the command. For more information, see [What format should I use to specify node mappings to stonith devices in pcmk_host_map](https://access.redhat.com/solutions/2619961)
281303
304+
305+
#### [Managed Identity](#tab/msi)
306+
282307
For RHEL **7.X**, use the following command to configure the fence device:
283-
<pre><code>sudo pcs stonith create rsc_st_azure fence_azure_arm login="<b>login ID</b>" passwd="<b>password</b>" resourceGroup="<b>resource group</b>" tenantId="<b>tenant ID</b>" subscriptionId="<b>subscription id</b>" <b>pcmk_host_map="prod-cl1-0:prod-cl1-0-vm-name;prod-cl1-1:prod-cl1-1-vm-name"</b> \
308+
<pre><code>sudo pcs stonith create rsc_st_azure fence_azure_arm <b>msi=true</b> resourceGroup="<b>resource group</b>" \
309+
subscriptionId="<b>subscription id</b>" <b>pcmk_host_map="prod-cl1-0:prod-cl1-0-vm-name;prod-cl1-1:prod-cl1-1-vm-name"</b> \
284310
power_timeout=240 pcmk_reboot_timeout=900 pcmk_monitor_timeout=120 pcmk_monitor_retries=4 pcmk_action_limit=3 pcmk_delay_max=15 \
285311
op monitor interval=3600
286312
</code></pre>
287313

288314
For RHEL **8.X**, use the following command to configure the fence device:
289-
<pre><code>sudo pcs stonith create rsc_st_azure fence_azure_arm username="<b>login ID</b>" password="<b>password</b>" resourceGroup="<b>resource group</b>" tenantId="<b>tenant ID</b>" subscriptionId="<b>subscription id</b>" <b>pcmk_host_map="prod-cl1-0:prod-cl1-0-vm-name;prod-cl1-1:prod-cl1-1-vm-name"</b> \
315+
<pre><code>sudo pcs stonith create rsc_st_azure fence_azure_arm <b>msi=true</b> resourceGroup="<b>resource group</b>" \
316+
subscriptionId="<b>subscription id</b>" <b>pcmk_host_map="prod-cl1-0:prod-cl1-0-vm-name;prod-cl1-1:prod-cl1-1-vm-name"</b> \
290317
power_timeout=240 pcmk_reboot_timeout=900 pcmk_monitor_timeout=120 pcmk_monitor_retries=4 pcmk_action_limit=3 pcmk_delay_max=15 \
291318
op monitor interval=3600
292319
</code></pre>
293320

321+
#### [Service Principal](#tab/spn)
322+
323+
For RHEL **7.X**, use the following command to configure the fence device:
324+
<pre><code>sudo pcs stonith create rsc_st_azure fence_azure_arm login="<b>login ID</b>" passwd="<b>password</b>" \
325+
resourceGroup="<b>resource group</b>" tenantId="<b>tenant ID</b>" subscriptionId="<b>subscription id</b>" \
326+
<b>pcmk_host_map="prod-cl1-0:prod-cl1-0-vm-name;prod-cl1-1:prod-cl1-1-vm-name"</b> \
327+
power_timeout=240 pcmk_reboot_timeout=900 pcmk_monitor_timeout=120 pcmk_monitor_retries=4 pcmk_action_limit=3 pcmk_delay_max=15 \
328+
op monitor interval=3600
329+
</code></pre>
330+
331+
For RHEL **8.X**, use the following command to configure the fence device:
332+
<pre><code>sudo pcs stonith create rsc_st_azure fence_azure_arm username="<b>login ID</b>" password="<b>password</b>" \
333+
resourceGroup="<b>resource group</b>" tenantId="<b>tenant ID</b>" subscriptionId="<b>subscription id</b>" \
334+
<b>pcmk_host_map="prod-cl1-0:prod-cl1-0-vm-name;prod-cl1-1:prod-cl1-1-vm-name"</b> \
335+
power_timeout=240 pcmk_reboot_timeout=900 pcmk_monitor_timeout=120 pcmk_monitor_retries=4 pcmk_action_limit=3 pcmk_delay_max=15 \
336+
op monitor interval=3600
337+
</code></pre>
338+
339+
---
340+
294341
> [!TIP]
295342
> Only configure the `pcmk_delay_max` attribute in two node Pacemaker clusters. For more information on preventing fence races in a two node Pacemaker cluster, see [Delaying fencing in a two node cluster to prevent fence races of "fence death" scenarios](https://access.redhat.com/solutions/54829).
296343

articles/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.topic: article
1313
ms.tgt_pltfrm: vm-windows
1414
ms.workload: infrastructure-services
1515
ms.custom: subject-rbac-steps
16-
ms.date: 08/16/2022
16+
ms.date: 08/30/2022
1717
ms.author: radeltch
1818

1919
---
@@ -74,7 +74,7 @@ You can configure the SBD device by using either of two options:
7474
- For more information about limitations for Azure shared disks, carefully review the "Limitations" section of [Azure shared disk documentation](../../disks-shared.md#limitations).
7575

7676
### Use an Azure fence agent
77-
You can set up STONITH by using an Azure fence agent. Azure fence agents require a service principal that manages restarting failed nodes via Azure APIs. Azure fence agents don't require the deployment of additional virtual machines.
77+
You can set up STONITH by using an Azure fence agent. Azure fence agent require managed identities for the cluster VMs or a service principal, that manages restarting failed nodes via Azure APIs. Azure fence agent doesn't require the deployment of additional virtual machines.
7878

7979
## SBD with an iSCSI target server
8080

@@ -468,7 +468,14 @@ This section applies only if you want to use a STONITH device with an Azure fenc
468468

469469
### Create an Azure fence agent STONITH device
470470

471-
This section applies only if you're using a STONITH device that's based on an Azure fence agent. The STONITH device uses a service principal to authorize against Microsoft Azure. To create a service principal, do the following:
471+
This section applies only if you're using a STONITH device that's based on an Azure fence agent. The STONITH device uses either a managed identity or a service principal to authorize against Microsoft Azure.
472+
473+
#### Using managed identity
474+
To create a managed identity (MSI), [create a system-assigned](/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#system-assigned-managed-identity) managed identity for each VM in the cluster. Should a system-assigned managed identity already exist, it will be used. User assigned managed identities should not be used with Pacemaker at this time.
475+
476+
#### Using service principal
477+
478+
To create a service principal, do the following:
472479

473480
1. In the [Azure portal](https://portal.azure.com), select **Azure Active Directory** > **Properties**, and then write down the Directory ID. This is the **tenant ID**.
474481
1. Select **App registrations**.
@@ -483,7 +490,7 @@ This section applies only if you're using a STONITH device that's based on an Az
483490

484491
### **[1]** Create a custom role for the fence agent
485492

486-
By default, the service principal doesn't have permissions to access your Azure resources. You need to give the service principal permissions to start and stop (deallocate) all virtual machines in the cluster. If you didn't already create the custom role, you can do so by using [PowerShell](../../../role-based-access-control/custom-roles-powershell.md#create-a-custom-role) or the [Azure CLI](../../../role-based-access-control/custom-roles-cli.md).
493+
By default, neither managed identity norservice principal have permissions to access your Azure resources. You need to give the managed identity or service principal permissions to start and stop (deallocate) all virtual machines in the cluster. If you didn't already create the custom role, you can do so by using [PowerShell](../../../role-based-access-control/custom-roles-powershell.md#create-a-custom-role) or the [Azure CLI](../../../role-based-access-control/custom-roles-cli.md).
487494

488495
Use the following content for the input file. You need to adapt the content to your subscriptions. That is, replace *xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx* and *yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy* with your own subscription IDs. If you have only one subscription, remove the second entry under AssignableScopes.
489496

@@ -506,7 +513,16 @@ Use the following content for the input file. You need to adapt the content to y
506513
}
507514
```
508515

509-
### **[A]** Assign the custom role to the service principal
516+
### **[A]** Assign the custom role
517+
518+
#### Using Managed Identity
519+
520+
Assign the custom role "Linux Fence Agent Role" that was created in the last chapter to each managed identity of the cluster VMs. Each VM system-assigned managed identity needs the role assigned for every cluster VM's resource. For detailed steps, see [Assign a managed identity access to a resource by using the Azure portal](/azure/active-directory/managed-identities-azure-resources/howto-assign-access-portal). Verify each VM's managed identity role assignment contains all cluster VMs.
521+
522+
> [!IMPORTANT]
523+
> Be aware assignment and removal of authorization with managed identities [can be delayed](/azure/active-directory/managed-identities-azure-resources/managed-identity-best-practice-recommendations#limitation-of-using-managed-identities-for-authorization) until effective.
524+
525+
#### Using Service Principal
510526

511527
Assign the custom role *Linux fence agent Role* that you already created to the service principal. Do *not* use the *Owner* role anymore. For more information, see [Assign Azure roles by using the Azure portal](../../../role-based-access-control/role-assignments-portal.md).
512528

@@ -768,15 +784,30 @@ Make sure to assign the custom role to the service principal at all VM (cluster
768784
</code></pre>
769785

770786
1. **[1]** If you're using an Azure fence agent as STONITH, run the following commands. After you've assigned roles to both cluster nodes, you can configure the STONITH devices in the cluster.
787+
788+
<pre><code>sudo crm configure property stonith-enabled=true
789+
crm configure property concurrent-fencing=true
790+
</code></pre>
771791

772792
> [!NOTE]
773793
> The 'pcmk_host_map' option is required in the command only if the hostnames and the Azure VM names are *not* identical. Specify the mapping in the format *hostname:vm-name*.
774794
> Refer to the bold section in the following command.
775-
776-
<pre><code>sudo crm configure property stonith-enabled=true
777-
crm configure property concurrent-fencing=true
795+
796+
If using **managed identity** for your fence agent, run the following command (SLES 15 SP1 and newer, only)
797+
<pre><code>
798+
# replace the bold strings with your subscription ID and resource group of the VM
799+
800+
sudo crm configure primitive rsc_st_azure stonith:fence_azure_arm \
801+
params <b>msi=true</b> subscriptionId="<b>subscription ID</b>" resourceGroup="<b>resource group</b>" \
802+
pcmk_monitor_retries=4 pcmk_action_limit=3 power_timeout=240 pcmk_reboot_timeout=900 <b>pcmk_host_map="prod-cl1-0:prod-cl1-0-vm-name;prod-cl1-1:prod-cl1-1-vm-name"</b> \
803+
op monitor interval=3600 timeout=120
778804

779-
# replace the bold string with your subscription ID, resource group of the VM, tenant ID, service principal application ID and password
805+
sudo crm configure property stonith-timeout=900
806+
</code></pre>
807+
808+
If using **service principal** for your fence agent, run the following command
809+
<pre><code>
810+
# replace the bold strings with your subscription ID, resource group of the VM, tenant ID, service principal application ID and password
780811

781812
sudo crm configure primitive rsc_st_azure stonith:fence_azure_arm \
782813
params subscriptionId="<b>subscription ID</b>" resourceGroup="<b>resource group</b>" tenantId="<b>tenant ID</b>" login="<b>application ID</b>" passwd="<b>password</b>" \

0 commit comments

Comments
 (0)