Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ ms.date: 05/07/2024
---

# Introduction to MaintenanceControl on Service Fabric managed clusters
Service Fabric managed clusters have multiple background operations that are necessary to the keep all the cluster updated, thus ensuring security and reliability. Even though these operations are critical, but executing in the background can result in the service replica to move to a different node. This failover results in
undesired and unnecessary interruptions, if the maintenance operation executes during the peak business hours. With the support for MaintenanceControl in Service Fabric managed clusters, customers would be able to define a recurring (daily, weekly, monthly) and custom maintenance window for their SFMC cluster resource,
Service Fabric managed clusters have multiple background operations that are necessary to keep the entire cluster updated, thus ensuring security and reliability. Even though these operations are critical, executing them in the background can result in the service replica moving to a different node. This failover results in
undesired and unnecessary interruptions, if the maintenance operation executes during the peak business hours. With the support for MaintenanceControl in Service Fabric managed clusters, customers can define a recurring (daily, weekly, monthly) and custom maintenance window for their SFMC cluster resource,
as per their needs. All background maintenance operations will be allowed to execute only during this maintenance window. MaintenanceControl is applicable to these background operations:
* Automatic OS Upgrade
* Automatic extension upgrade
Expand Down Expand Up @@ -56,7 +56,7 @@ Download this sample, which contains all the required resources. [Standard SKU S

3) Configure maintenance control on the cluster using the following maintenance configuration:

This maintenance configuration defines a schedule for updates to happen everyday from 10PM PST for 5hours, starting 30-05-2023. [More details about maintenance configuration](/azure/templates/microsoft.maintenance/maintenanceconfigurations)
This maintenance configuration defines a schedule for updates to happen every day from 10PM PST for 5 hours, starting 30-05-2023. [More details about maintenance configuration](/azure/templates/microsoft.maintenance/maintenanceconfigurations)

```JSON
"resources": [
Expand Down Expand Up @@ -120,6 +120,22 @@ After the maintenance configuration is created, it has to be attached to the SFM
}
```

To check the status of the maintenance configuration, use the [Get Maintenance Window action](/rest/api/servicefabric/managedclusters/managed-maintenance-window-status/get).

```powershell
$resourceGroupName = "testResourceGroup"
$clusterName = "testCluster"
Invoke-AzResourceAction -ResourceGroupName $resourceGroupName -ResourceName $clusterName -ResourceType Microsoft.ServiceFabric/managedclusters -Action getMaintenanceWindowStatus
```

If there are missing notifications and there is a time critical pending update that can be safely applied, a 5 hour maintenance window can be manually applied using the [Apply Maintenance Window Status action](/rest/api/servicefabric/managedclusters/managed-apply-maintenance-window/post).

```powershell
$resourceGroupName = "testResourceGroup"
$clusterName = "testCluster"
Invoke-AzResourceAction -ResourceGroupName $resourceGroupName -ResourceName $clusterName -ResourceType Microsoft.ServiceFabric/managedclusters -Action applyMaintenanceWindow
```

>[!NOTE]
>* To disable the maintenance control on the cluster, unassign/delete the assignment for the cluster.
>* The maintenance resources and the SFMC cluster resource should be created in the same **Azure Region** and **Subscription**.
Expand Down