Configure schedule patching on Azure VMs to ensure business continuity
Applies to: ✔️ Windows VMs ✔️ Linux VMs ✔️ Azure VMs.
This article is an overview on how to configure Schedule patching and Automatic guest VM patching on Azure VMs using the new prerequisite to ensure business continuity. The steps to configure both the patching options on Arc VMs remain the same.
Currently, you can enable Automatic guest VM patching (Autopatch) by setting the patch mode to Azure-orchestrated/AutomaticByPlatform on Azure portal/REST API respectively, where patches are automatically applied during off-peak hours.
For customizing control over your patch installation, you can use schedule patching to define your maintenance window. You can enable schedule patching by setting the patch mode to Azure orchestrated/AutomaticByPlatform and attaching a schedule to the Azure VM. So, the VM properties couldn't be differentiated between schedule patching or Automatic guest VM patching as both had the patch mode set to Azure-Orchestrated.
Additionally, in some instances, when you remove the schedule from a VM, there is a possibility that the VM may be auto patched and rebooted. To overcome the limitations, we have introduced a new prerequisite - ByPassPlatformSafetyChecksOnUserSchedule, which can now be set to true to identify a VM using schedule patching. It means that VMs with this property set to true will no longer be auto patched when the VMs don't have an associated maintenance configuration.
Important
For a continued scheduled patching experience, you must ensure that the new VM property, BypassPlatformSafetyChecksOnUserSchedule, is enabled on all your Azure VMs (existing or new) that have schedules attached to them by 30th June 2023. This setting will ensure machines are patched using your configured schedules and not auto patched. Failing to enable by 30th June 2023 will give an error that the prerequisites aren't met.
Schedule patching in an availability set
- All VMs in a common availability set aren't updated concurrently.
- VMs in a common availability set are updated within Update Domain boundaries and, VMs across multiple Update Domains aren't updated concurrently.
Find VMs with associated schedules
To identify the list of VMs with the associated schedules for which you have to enable new VM property, follow these steps:
Go to Update Manager (preview) home page and select Machines tab.
In Patch orchestration filter, select Azure Managed - Safe Deployment.
Use the Select all option to select the machines and then select Export to CSV.
Open the CSV file and in the column Associated schedules, select the rows that have an entry.
In the corresponding Name column, you can view the list the VMs to which you would need to enable the ByPassPlatformSafetyChecksOnUserSchedule flag.
Enable schedule patching on Azure VMs
Prerequisite
Patch orchestration = Customer Managed Schedules.
Select the patch orchestration option as Customer Managed Schedules. The new patch orchestration option enables the following VM properties on your behalf after receiving your consent:
- Patch mode = Azure-orchestrated
- BypassPlatformSafetyChecksOnUserSchedule = TRUE
Enable for new VMs
You can select the patch orchestration option for new VMs that would be associated with the schedules:
To update the patch mode, follow these steps:
- Sign in to the Azure portal.
- Go to Virtual machine, and select +Create to open Create a virtual machine page.
- In Basics tab, complete all the mandatory fields.
- In Management tab, under Guest OS updates, for Patch orchestration options, select Azure-orchestrated.
- After you complete the entries in Monitoring, Advanced and Tags tabs.
- Select Review + Create and select Create to create a new VM with the appropriate patch orchestration option.
To schedule patch the newly created VMs, follow the procedure from step 2 in Enable for existing VMs.
Enable for existing VMs
You can update the patch orchestration option for existing VMs that either already have schedules associated or are to be newly associated with a schedule:
Note
If the Patch orchestration is set as Azure-orchestrated or Azure Managed - Safe Deployment (AutomaticByPlatform), the BypassPlatformSafetyChecksOnUserSchedule is set to False and there is no schedule associated, the VM(s) will be autopatched.
To update the patch mode, follow these steps:
- Sign in to the Azure portal.
- Go to Update Manager (preview), select Update Settings.
- In Change update settings, select +Add machine.
- In Select resources, select your VMs and then select Add.
- In Change update settings, under Patch orchestration, select Customer Managed Schedules and then select Save.
Attach a schedule after you complete the above steps.
To check if the BypassPlatformSafetyChecksOnUserSchedule is enabled, go to Virtual machine home page > Overview tab > JSON View.
Note
Currently, you can only enable the new prerequisite for schedule patching via Azure portal and REST API. It cannot be enabled via Azure CLI and PowerShell.
Enable automatic guest VM patching on Azure VMs
To enable automatic guest VM patching on your Azure VMs now, follow these steps:
Prerequisite
Patch mode = Azure-orchestrated
Enable for new VMs
You can select the patch orchestration option for new VMs that would be associated with the schedules:
To update the patch mode, follow these steps:
- Sign in to the Azure portal.
- Go to Virtual machine, and select +Create to open Create a virtual machine page.
- In Basics tab, complete all the mandatory fields.
- In Management tab, under Guest OS updates, for Patch orchestration options, select Azure-orchestrated.
- After you complete the entries in Monitoring, Advanced and Tags tabs.
- Select Review + Create and select Create to create a new VM with the appropriate patch orchestration option.
Enable for existing VMs
To update the patch mode, follow these steps:
- Sign in to the Azure portal.
- Go to Update Manager (preview), select Update Settings.
- In Change update settings, select +Add machine.
- In Select resources, select your VMs and then select Add.
- In Change update settings, under Patch orchestration, select Azure Managed - Safe Deployment and then select Save.
User scenarios
| Scenarios | Azure-orchestrated | BypassPlatformSafetyChecksOnUserSchedule | Schedule Associated | Expected behavior in Azure |
|---|---|---|---|---|
| Scenario 1 | Yes | True | Yes | The schedule patch runs as defined by user. |
| Scenario 2 | Yes | True | No | Neither autopatch nor the schedule patch will run. |
| Scenario 3 | Yes | False | Yes | Neither autopatch nor schedule patch will run. You'll get an error that the prerequisites for schedule patch aren't met. |
| Scenario 4 | Yes | False | No | The VM is autopatched. |
| Scenario 5 | No | True | Yes | Neither autopatch nor schedule patch will run. You'll get an error that the prerequisites for schedule patch aren't met. |
| Scenario 6 | No | True | No | Neither the autopatch nor the schedule patch will run. |
| Scenario 7 | No | False | Yes | Neither autopatch nor schedule patch will run. You'll get an error that the prerequisites for schedule patch aren't met. |
| Scenario 8 | No | False | No | Neither the autopatch nor the schedule patch will run. |
Next steps
- To troubleshoot issues, see the Troubleshoot Update Manager (preview).
Feedback
Submit and view feedback for