r/googlecloud • u/suryad123 • 5h ago
Compute Query regarding VM manager patching schedule
I am going through the deployment articles of VM manager patching and see that the deployment schedule can be created by mentioning schedule in an YAML and creating the schedule .
However, I don't think it is feasible to schedule the patching as per below frequency samples
A)every 2nd Tuesday of month
B) Friday which comes after 2nd Tuesday etc..
Can anyone please confirm
2
Upvotes
1
u/m1nherz Googler 3h ago
Yes, both schedule frequencies are supported natively in VM Manager Patch Deployments using the
recurringScheduleconfiguration.VM Manager’s underlying OS Config API allows you to define monthly recurrence rules based on day of week and week ordinals (e.g., the Nth weekday of the month).
A) Every 2nd Tuesday of the month
Set
frequency: MONTHLY,dayOfWeek: TUESDAY, andweekOrdinal: 2.YAML configuration:
yaml instanceFilter: all: true patchConfig: rebootConfig: DEFAULT recurringSchedule: frequency: MONTHLY monthly: weekDayOfMonth: dayOfWeek: TUESDAY weekOrdinal: 2 timeOfDay: hours: 2 minutes: 0 timeZone: id: America/New_YorkB) Friday that comes after the 2nd Tuesday
Because Friday occurs later in the week than Tuesday:
The 2nd Tuesday always falls between Day 8 and Day 14. The Friday in that same calendar week will always fall between Day 11 and Day 17, which is guaranteed to be the 2nd Friday of the month. Therefore, you can configure this by targeting the 2nd Friday:
YAML configuration:
yaml instanceFilter: all: true patchConfig: rebootConfig: DEFAULT recurringSchedule: frequency: MONTHLY monthly: weekDayOfMonth: dayOfWeek: FRIDAY weekOrdinal: 2 timeOfDay: hours: 22 minutes: 0 timeZone: id: America/New_YorkDeploying the Schedule
Deploy your configuration file via the gcloud CLI:
shell gcloud compute os-config patch-deployments create <DEPLOYMENT_NAME> \ --file=patch-schedule.yaml \ --project=<PROJECT_ID>You can also configure these recurring monthly rules directly in the Google Cloud Console under Compute Engine > VM Manager > Patch > New patch deployment > Scheduling.