|
2 | 2 | title: Back up Azure VMs with Enhanced policy
|
3 | 3 | description: Learn how to configure Enhanced policy to back up VMs.
|
4 | 4 | ms.topic: how-to
|
5 |
| -ms.date: 04/01/2024 |
| 5 | +ms.date: 04/18/2024 |
6 | 6 | ms.reviewer: sharrai
|
7 | 7 | ms.service: backup
|
8 | 8 | ms.custom: devx-track-azurecli, devx-track-azurepowershell
|
@@ -106,27 +106,26 @@ Also, the output object for this cmdlet contains the following additional fields
|
106 | 106 | **Step 2: Set the backup schedule objects**
|
107 | 107 |
|
108 | 108 | ```azurepowershell
|
109 |
| -$startTime = Get-Date -Date "2021-12-22T06:10:00.00+00:00" |
110 |
| -$SchPol.ScheduleRunStartTime = $startTime |
111 |
| -$SchPol.ScheduleInterval = 6 |
112 |
| -$SchPol.ScheduleWindowDuration = 12 |
113 |
| -$SchPol.ScheduleRunTimezone = "PST" |
| 109 | +$schedulePolicy = Get-AzRecoveryServicesBackupSchedulePolicyObject -WorkloadType AzureVM -BackupManagementType AzureVM -PolicySubType Enhanced -ScheduleRunFrequency Hourly |
| 110 | +$timeZone = Get-TimeZone -ListAvailable | Where-Object { $_.Id -match "India" } |
| 111 | +$schedulePolicy.ScheduleRunTimeZone = $timeZone.Id |
| 112 | +$windowStartTime = (Get-Date -Date "2022-04-14T08:00:00.00+00:00").ToUniversalTime() |
| 113 | +$schPol.HourlySchedule.WindowStartTime = $windowStartTime |
| 114 | +$schedulePolicy.HourlySchedule.ScheduleInterval = 4 |
| 115 | +$schedulePolicy.HourlySchedule.ScheduleWindowDuration = 23 |
114 | 116 |
|
115 | 117 | ```
|
116 | 118 |
|
117 |
| -This sample cmdlet contains the following parameters: |
| 119 | +In this sample cmdlet: |
118 | 120 |
|
119 |
| -- `$ScheduleInterval`: Defines the difference (in hours) between two successive backups per day. Currently, the acceptable values are *4*, *6*, *8* and *12*. |
| 121 | +- The first command gets a base enhanced hourly SchedulePolicyObject for WorkloadType AzureVM, and then stores it in the $schedulePolicy variable. |
| 122 | +- The second and third command fetches the India timezone and updates the timezone in the $schedulePolicy. |
| 123 | +- The fourth and fifth command initializes the schedule window start time and updates the $schedulePolicy. |
120 | 124 |
|
121 |
| -- `$ScheduleWindowStartTime`: The time at which the first backup job is triggered in case of *hourly backups*. The current limits (in policy's timezone) are: |
122 |
| - - `Minimum: 00:00` |
123 |
| - - `Maximum:19:30` |
| 125 | + >[Note] |
| 126 | + >The start time must be in UTC even if the timezone is not UTC. |
124 | 127 |
|
125 |
| -- `$ScheduleRunTimezone`: Specifies the timezone in which backups are scheduled. The default schedule is *UTC*. |
126 |
| - |
127 |
| -- `$ScheduleWindowDuration`: The time span (in hours measured from the Schedule Window Start Time) beyond which backup jobs shouldn't be triggered. The current limits are: |
128 |
| - - `Minimum: 4` |
129 |
| - - `Maximum:23` |
| 128 | +- The sixth and seventh command updates the interval (in hours) after which the backup will be retriggered on the same day, duration (in hours) for which the schedule will run. |
130 | 129 |
|
131 | 130 | **Step 3: Create the backup retention policy**
|
132 | 131 |
|
|
0 commit comments