patch_jobs.proto 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.osconfig.v1beta;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/osconfig/v1beta/osconfig_common.proto";
  19. import "google/protobuf/duration.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta;osconfig";
  22. option java_outer_classname = "PatchJobs";
  23. option java_package = "com.google.cloud.osconfig.v1beta";
  24. // A request message to initiate patching across Compute Engine instances.
  25. message ExecutePatchJobRequest {
  26. // Required. The project in which to run this patch in the form `projects/*`
  27. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  28. // Description of the patch job. Length of the description is limited
  29. // to 1024 characters.
  30. string description = 2;
  31. // Required. Instances to patch, either explicitly or filtered by some criteria such
  32. // as zone or labels.
  33. PatchInstanceFilter instance_filter = 7 [(google.api.field_behavior) = REQUIRED];
  34. // Patch configuration being applied. If omitted, instances are
  35. // patched using the default configurations.
  36. PatchConfig patch_config = 4;
  37. // Duration of the patch job. After the duration ends, the patch job
  38. // times out.
  39. google.protobuf.Duration duration = 5;
  40. // If this patch is a dry-run only, instances are contacted but
  41. // will do nothing.
  42. bool dry_run = 6;
  43. // Display name for this patch job. This does not have to be unique.
  44. string display_name = 8;
  45. // Rollout strategy of the patch job.
  46. PatchRollout rollout = 9;
  47. }
  48. // Request to get an active or completed patch job.
  49. message GetPatchJobRequest {
  50. // Required. Name of the patch in the form `projects/*/patchJobs/*`
  51. string name = 1 [(google.api.field_behavior) = REQUIRED];
  52. }
  53. // Request to list details for all instances that are part of a patch job.
  54. message ListPatchJobInstanceDetailsRequest {
  55. // Required. The parent for the instances are in the form of `projects/*/patchJobs/*`.
  56. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  57. // The maximum number of instance details records to return. Default is 100.
  58. int32 page_size = 2;
  59. // A pagination token returned from a previous call
  60. // that indicates where this listing should continue from.
  61. string page_token = 3;
  62. // A filter expression that filters results listed in the response. This
  63. // field supports filtering results by instance zone, name, state, or
  64. // `failure_reason`.
  65. string filter = 4;
  66. }
  67. // A response message for listing the instances details for a patch job.
  68. message ListPatchJobInstanceDetailsResponse {
  69. // A list of instance status.
  70. repeated PatchJobInstanceDetails patch_job_instance_details = 1;
  71. // A pagination token that can be used to get the next page of results.
  72. string next_page_token = 2;
  73. }
  74. // Patch details for a VM instance. For more information about reviewing VM
  75. // instance details, see
  76. // [Listing all VM instance details for a specific patch
  77. // job](https://cloud.google.com/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details).
  78. message PatchJobInstanceDetails {
  79. // The instance name in the form `projects/*/zones/*/instances/*`
  80. string name = 1;
  81. // The unique identifier for the instance. This identifier is
  82. // defined by the server.
  83. string instance_system_id = 2;
  84. // Current state of instance patch.
  85. Instance.PatchState state = 3;
  86. // If the patch fails, this field provides the reason.
  87. string failure_reason = 4;
  88. // The number of times the agent that the agent attempts to apply the patch.
  89. int64 attempt_count = 5;
  90. }
  91. // A request message for listing patch jobs.
  92. message ListPatchJobsRequest {
  93. // Required. In the form of `projects/*`
  94. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  95. // The maximum number of instance status to return.
  96. int32 page_size = 2;
  97. // A pagination token returned from a previous call
  98. // that indicates where this listing should continue from.
  99. string page_token = 3;
  100. // If provided, this field specifies the criteria that must be met by patch
  101. // jobs to be included in the response.
  102. // Currently, filtering is only available on the patch_deployment field.
  103. string filter = 4;
  104. }
  105. // A response message for listing patch jobs.
  106. message ListPatchJobsResponse {
  107. // The list of patch jobs.
  108. repeated PatchJob patch_jobs = 1;
  109. // A pagination token that can be used to get the next page of results.
  110. string next_page_token = 2;
  111. }
  112. // A high level representation of a patch job that is either in progress
  113. // or has completed.
  114. //
  115. // Instance details are not included in the job. To paginate through instance
  116. // details, use `ListPatchJobInstanceDetails`.
  117. //
  118. // For more information about patch jobs, see
  119. // [Creating patch
  120. // jobs](https://cloud.google.com/compute/docs/os-patch-management/create-patch-job).
  121. message PatchJob {
  122. option (google.api.resource) = {
  123. type: "osconfig.googleapis.com/PatchJob"
  124. pattern: "projects/{project}/patchJobs/{patch_job}"
  125. };
  126. // Enumeration of the various states a patch job passes through as it
  127. // executes.
  128. enum State {
  129. // State must be specified.
  130. STATE_UNSPECIFIED = 0;
  131. // The patch job was successfully initiated.
  132. STARTED = 1;
  133. // The patch job is looking up instances to run the patch on.
  134. INSTANCE_LOOKUP = 2;
  135. // Instances are being patched.
  136. PATCHING = 3;
  137. // Patch job completed successfully.
  138. SUCCEEDED = 4;
  139. // Patch job completed but there were errors.
  140. COMPLETED_WITH_ERRORS = 5;
  141. // The patch job was canceled.
  142. CANCELED = 6;
  143. // The patch job timed out.
  144. TIMED_OUT = 7;
  145. }
  146. // A summary of the current patch state across all instances that this patch
  147. // job affects. Contains counts of instances in different states. These states
  148. // map to `InstancePatchState`. List patch job instance details to see the
  149. // specific states of each instance.
  150. message InstanceDetailsSummary {
  151. // Number of instances pending patch job.
  152. int64 pending_instance_count = 1;
  153. // Number of instances that are inactive.
  154. int64 inactive_instance_count = 2;
  155. // Number of instances notified about patch job.
  156. int64 notified_instance_count = 3;
  157. // Number of instances that have started.
  158. int64 started_instance_count = 4;
  159. // Number of instances that are downloading patches.
  160. int64 downloading_patches_instance_count = 5;
  161. // Number of instances that are applying patches.
  162. int64 applying_patches_instance_count = 6;
  163. // Number of instances rebooting.
  164. int64 rebooting_instance_count = 7;
  165. // Number of instances that have completed successfully.
  166. int64 succeeded_instance_count = 8;
  167. // Number of instances that require reboot.
  168. int64 succeeded_reboot_required_instance_count = 9;
  169. // Number of instances that failed.
  170. int64 failed_instance_count = 10;
  171. // Number of instances that have acked and will start shortly.
  172. int64 acked_instance_count = 11;
  173. // Number of instances that exceeded the time out while applying the patch.
  174. int64 timed_out_instance_count = 12;
  175. // Number of instances that are running the pre-patch step.
  176. int64 pre_patch_step_instance_count = 13;
  177. // Number of instances that are running the post-patch step.
  178. int64 post_patch_step_instance_count = 14;
  179. // Number of instances that do not appear to be running the agent. Check to
  180. // ensure that the agent is installed, running, and able to communicate with
  181. // the service.
  182. int64 no_agent_detected_instance_count = 15;
  183. }
  184. // Unique identifier for this patch job in the form
  185. // `projects/*/patchJobs/*`
  186. string name = 1;
  187. // Display name for this patch job. This is not a unique identifier.
  188. string display_name = 14;
  189. // Description of the patch job. Length of the description is limited
  190. // to 1024 characters.
  191. string description = 2;
  192. // Time this patch job was created.
  193. google.protobuf.Timestamp create_time = 3;
  194. // Last time this patch job was updated.
  195. google.protobuf.Timestamp update_time = 4;
  196. // The current state of the PatchJob.
  197. State state = 5;
  198. // Instances to patch.
  199. PatchInstanceFilter instance_filter = 13;
  200. // Patch configuration being applied.
  201. PatchConfig patch_config = 7;
  202. // Duration of the patch job. After the duration ends, the
  203. // patch job times out.
  204. google.protobuf.Duration duration = 8;
  205. // Summary of instance details.
  206. InstanceDetailsSummary instance_details_summary = 9;
  207. // If this patch job is a dry run, the agent reports that it has
  208. // finished without running any updates on the VM instance.
  209. bool dry_run = 10;
  210. // If this patch job failed, this message provides information about the
  211. // failure.
  212. string error_message = 11;
  213. // Reflects the overall progress of the patch job in the range of
  214. // 0.0 being no progress to 100.0 being complete.
  215. double percent_complete = 12;
  216. // Output only. Name of the patch deployment that created this patch job.
  217. string patch_deployment = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  218. // Rollout strategy being applied.
  219. PatchRollout rollout = 16;
  220. }
  221. // Patch configuration specifications. Contains details on how to apply the
  222. // patch(es) to a VM instance.
  223. message PatchConfig {
  224. // Post-patch reboot settings.
  225. enum RebootConfig {
  226. // The default behavior is DEFAULT.
  227. REBOOT_CONFIG_UNSPECIFIED = 0;
  228. // The agent decides if a reboot is necessary by checking signals such as
  229. // registry keys on Windows or `/var/run/reboot-required` on APT based
  230. // systems. On RPM based systems, a set of core system package install times
  231. // are compared with system boot time.
  232. DEFAULT = 1;
  233. // Always reboot the machine after the update completes.
  234. ALWAYS = 2;
  235. // Never reboot the machine after the update completes.
  236. NEVER = 3;
  237. }
  238. // Post-patch reboot settings.
  239. RebootConfig reboot_config = 1;
  240. // Apt update settings. Use this setting to override the default `apt` patch
  241. // rules.
  242. AptSettings apt = 3;
  243. // Yum update settings. Use this setting to override the default `yum` patch
  244. // rules.
  245. YumSettings yum = 4;
  246. // Goo update settings. Use this setting to override the default `goo` patch
  247. // rules.
  248. GooSettings goo = 5;
  249. // Zypper update settings. Use this setting to override the default `zypper`
  250. // patch rules.
  251. ZypperSettings zypper = 6;
  252. // Windows update settings. Use this override the default windows patch rules.
  253. WindowsUpdateSettings windows_update = 7;
  254. // The `ExecStep` to run before the patch update.
  255. ExecStep pre_step = 8;
  256. // The `ExecStep` to run after the patch update.
  257. ExecStep post_step = 9;
  258. // Allows the patch job to run on Managed instance groups (MIGs).
  259. bool mig_instances_allowed = 10;
  260. }
  261. // Namespace for instance state enums.
  262. message Instance {
  263. // Patch state of an instance.
  264. enum PatchState {
  265. // Unspecified.
  266. PATCH_STATE_UNSPECIFIED = 0;
  267. // The instance is not yet notified.
  268. PENDING = 1;
  269. // Instance is inactive and cannot be patched.
  270. INACTIVE = 2;
  271. // The instance is notified that it should be patched.
  272. NOTIFIED = 3;
  273. // The instance has started the patching process.
  274. STARTED = 4;
  275. // The instance is downloading patches.
  276. DOWNLOADING_PATCHES = 5;
  277. // The instance is applying patches.
  278. APPLYING_PATCHES = 6;
  279. // The instance is rebooting.
  280. REBOOTING = 7;
  281. // The instance has completed applying patches.
  282. SUCCEEDED = 8;
  283. // The instance has completed applying patches but a reboot is required.
  284. SUCCEEDED_REBOOT_REQUIRED = 9;
  285. // The instance has failed to apply the patch.
  286. FAILED = 10;
  287. // The instance acked the notification and will start shortly.
  288. ACKED = 11;
  289. // The instance exceeded the time out while applying the patch.
  290. TIMED_OUT = 12;
  291. // The instance is running the pre-patch step.
  292. RUNNING_PRE_PATCH_STEP = 13;
  293. // The instance is running the post-patch step.
  294. RUNNING_POST_PATCH_STEP = 14;
  295. // The service could not detect the presence of the agent. Check to ensure
  296. // that the agent is installed, running, and able to communicate with the
  297. // service.
  298. NO_AGENT_DETECTED = 15;
  299. }
  300. }
  301. // Message for canceling a patch job.
  302. message CancelPatchJobRequest {
  303. // Required. Name of the patch in the form `projects/*/patchJobs/*`
  304. string name = 1 [(google.api.field_behavior) = REQUIRED];
  305. }
  306. // Apt patching is completed by executing `apt-get update && apt-get
  307. // upgrade`. Additional options can be set to control how this is executed.
  308. message AptSettings {
  309. // Apt patch type.
  310. enum Type {
  311. // By default, upgrade will be performed.
  312. TYPE_UNSPECIFIED = 0;
  313. // Runs `apt-get dist-upgrade`.
  314. DIST = 1;
  315. // Runs `apt-get upgrade`.
  316. UPGRADE = 2;
  317. }
  318. // By changing the type to DIST, the patching is performed
  319. // using `apt-get dist-upgrade` instead.
  320. Type type = 1;
  321. // List of packages to exclude from update. These packages will be excluded
  322. repeated string excludes = 2;
  323. // An exclusive list of packages to be updated. These are the only packages
  324. // that will be updated. If these packages are not installed, they will be
  325. // ignored. This field cannot be specified with any other patch configuration
  326. // fields.
  327. repeated string exclusive_packages = 3;
  328. }
  329. // Yum patching is performed by executing `yum update`. Additional options
  330. // can be set to control how this is executed.
  331. //
  332. // Note that not all settings are supported on all platforms.
  333. message YumSettings {
  334. // Adds the `--security` flag to `yum update`. Not supported on
  335. // all platforms.
  336. bool security = 1;
  337. // Will cause patch to run `yum update-minimal` instead.
  338. bool minimal = 2;
  339. // List of packages to exclude from update. These packages are excluded by
  340. // using the yum `--exclude` flag.
  341. repeated string excludes = 3;
  342. // An exclusive list of packages to be updated. These are the only packages
  343. // that will be updated. If these packages are not installed, they will be
  344. // ignored. This field must not be specified with any other patch
  345. // configuration fields.
  346. repeated string exclusive_packages = 4;
  347. }
  348. // Googet patching is performed by running `googet update`.
  349. message GooSettings {
  350. }
  351. // Zypper patching is performed by running `zypper patch`.
  352. // See also https://en.opensuse.org/SDB:Zypper_manual.
  353. message ZypperSettings {
  354. // Adds the `--with-optional` flag to `zypper patch`.
  355. bool with_optional = 1;
  356. // Adds the `--with-update` flag, to `zypper patch`.
  357. bool with_update = 2;
  358. // Install only patches with these categories.
  359. // Common categories include security, recommended, and feature.
  360. repeated string categories = 3;
  361. // Install only patches with these severities.
  362. // Common severities include critical, important, moderate, and low.
  363. repeated string severities = 4;
  364. // List of patches to exclude from update.
  365. repeated string excludes = 5;
  366. // An exclusive list of patches to be updated. These are the only patches
  367. // that will be installed using 'zypper patch patch:<patch_name>' command.
  368. // This field must not be used with any other patch configuration fields.
  369. repeated string exclusive_patches = 6;
  370. }
  371. // Windows patching is performed using the Windows Update Agent.
  372. message WindowsUpdateSettings {
  373. // Microsoft Windows update classifications as defined in
  374. // [1]
  375. // https://support.microsoft.com/en-us/help/824684/description-of-the-standard-terminology-that-is-used-to-describe-micro
  376. enum Classification {
  377. // Invalid. If classifications are included, they must be specified.
  378. CLASSIFICATION_UNSPECIFIED = 0;
  379. // "A widely released fix for a specific problem that addresses a critical,
  380. // non-security-related bug." [1]
  381. CRITICAL = 1;
  382. // "A widely released fix for a product-specific, security-related
  383. // vulnerability. Security vulnerabilities are rated by their severity. The
  384. // severity rating is indicated in the Microsoft security bulletin as
  385. // critical, important, moderate, or low." [1]
  386. SECURITY = 2;
  387. // "A widely released and frequent software update that contains additions
  388. // to a product's definition database. Definition databases are often used
  389. // to detect objects that have specific attributes, such as malicious code,
  390. // phishing websites, or junk mail." [1]
  391. DEFINITION = 3;
  392. // "Software that controls the input and output of a device." [1]
  393. DRIVER = 4;
  394. // "New product functionality that is first distributed outside the context
  395. // of a product release and that is typically included in the next full
  396. // product release." [1]
  397. FEATURE_PACK = 5;
  398. // "A tested, cumulative set of all hotfixes, security updates, critical
  399. // updates, and updates. Additionally, service packs may contain additional
  400. // fixes for problems that are found internally since the release of the
  401. // product. Service packs my also contain a limited number of
  402. // customer-requested design changes or features." [1]
  403. SERVICE_PACK = 6;
  404. // "A utility or feature that helps complete a task or set of tasks." [1]
  405. TOOL = 7;
  406. // "A tested, cumulative set of hotfixes, security updates, critical
  407. // updates, and updates that are packaged together for easy deployment. A
  408. // rollup generally targets a specific area, such as security, or a
  409. // component of a product, such as Internet Information Services (IIS)." [1]
  410. UPDATE_ROLLUP = 8;
  411. // "A widely released fix for a specific problem. An update addresses a
  412. // noncritical, non-security-related bug." [1]
  413. UPDATE = 9;
  414. }
  415. // Only apply updates of these windows update classifications. If empty, all
  416. // updates are applied.
  417. repeated Classification classifications = 1;
  418. // List of KBs to exclude from update.
  419. repeated string excludes = 2;
  420. // An exclusive list of kbs to be updated. These are the only patches
  421. // that will be updated. This field must not be used with other
  422. // patch configurations.
  423. repeated string exclusive_patches = 3;
  424. }
  425. // A step that runs an executable for a PatchJob.
  426. message ExecStep {
  427. // The ExecStepConfig for all Linux VMs targeted by the PatchJob.
  428. ExecStepConfig linux_exec_step_config = 1;
  429. // The ExecStepConfig for all Windows VMs targeted by the PatchJob.
  430. ExecStepConfig windows_exec_step_config = 2;
  431. }
  432. // Common configurations for an ExecStep.
  433. message ExecStepConfig {
  434. // The interpreter used to execute the a file.
  435. enum Interpreter {
  436. // Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the
  437. // interpreter will be parsed from the shebang line of the script if
  438. // unspecified.
  439. INTERPRETER_UNSPECIFIED = 0;
  440. // Indicates that the script is run with `/bin/sh` on Linux and `cmd`
  441. // on Windows.
  442. SHELL = 1;
  443. // Indicates that the file is run with PowerShell flags
  444. // `-NonInteractive`, `-NoProfile`, and `-ExecutionPolicy Bypass`.
  445. POWERSHELL = 2;
  446. }
  447. // Location of the executable.
  448. oneof executable {
  449. // An absolute path to the executable on the VM.
  450. string local_path = 1;
  451. // A Google Cloud Storage object containing the executable.
  452. GcsObject gcs_object = 2;
  453. }
  454. // Defaults to [0]. A list of possible return values that the
  455. // execution can return to indicate a success.
  456. repeated int32 allowed_success_codes = 3;
  457. // The script interpreter to use to run the script. If no interpreter is
  458. // specified the script will be executed directly, which will likely
  459. // only succeed for scripts with [shebang lines]
  460. // (https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
  461. Interpreter interpreter = 4;
  462. }
  463. // Google Cloud Storage object representation.
  464. message GcsObject {
  465. // Required. Bucket of the Google Cloud Storage object.
  466. string bucket = 1 [(google.api.field_behavior) = REQUIRED];
  467. // Required. Name of the Google Cloud Storage object.
  468. string object = 2 [(google.api.field_behavior) = REQUIRED];
  469. // Required. Generation number of the Google Cloud Storage object. This is used to
  470. // ensure that the ExecStep specified by this PatchJob does not change.
  471. int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED];
  472. }
  473. // A filter to target VM instances for patching. The targeted
  474. // VMs must meet all criteria specified. So if both labels and zones are
  475. // specified, the patch job targets only VMs with those labels and in those
  476. // zones.
  477. message PatchInstanceFilter {
  478. // Represents a group of VMs that can be identified as having all these
  479. // labels, for example "env=prod and app=web".
  480. message GroupLabel {
  481. // Compute Engine instance labels that must be present for a VM instance to
  482. // be targeted by this filter.
  483. map<string, string> labels = 1;
  484. }
  485. // Target all VM instances in the project. If true, no other criteria is
  486. // permitted.
  487. bool all = 1;
  488. // Targets VM instances matching at least one of these label sets. This allows
  489. // targeting of disparate groups, for example "env=prod or env=staging".
  490. repeated GroupLabel group_labels = 2;
  491. // Targets VM instances in ANY of these zones. Leave empty to target VM
  492. // instances in any zone.
  493. repeated string zones = 3;
  494. // Targets any of the VM instances specified. Instances are specified by their
  495. // URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`,
  496. // `projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or
  497. // `https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`
  498. repeated string instances = 4;
  499. // Targets VMs whose name starts with one of these prefixes. Similar to
  500. // labels, this is another way to group VMs when targeting configs, for
  501. // example prefix="prod-".
  502. repeated string instance_name_prefixes = 5;
  503. }
  504. // Patch rollout configuration specifications. Contains details on the
  505. // concurrency control when applying patch(es) to all targeted VMs.
  506. message PatchRollout {
  507. // Type of the rollout.
  508. enum Mode {
  509. // Mode must be specified.
  510. MODE_UNSPECIFIED = 0;
  511. // Patches are applied one zone at a time. The patch job begins in the
  512. // region with the lowest number of targeted VMs. Within the region,
  513. // patching begins in the zone with the lowest number of targeted VMs. If
  514. // multiple regions (or zones within a region) have the same number of
  515. // targeted VMs, a tie-breaker is achieved by sorting the regions or zones
  516. // in alphabetical order.
  517. ZONE_BY_ZONE = 1;
  518. // Patches are applied to VMs in all zones at the same time.
  519. CONCURRENT_ZONES = 2;
  520. }
  521. // Mode of the patch rollout.
  522. Mode mode = 1;
  523. // The maximum number (or percentage) of VMs per zone to disrupt at any given
  524. // moment. The number of VMs calculated from multiplying the percentage by the
  525. // total number of VMs in a zone is rounded up.
  526. //
  527. // During patching, a VM is considered disrupted from the time the agent is
  528. // notified to begin until patching has completed. This disruption time
  529. // includes the time to complete reboot and any post-patch steps.
  530. //
  531. // A VM contributes to the disruption budget if its patching operation fails
  532. // either when applying the patches, running pre or post patch steps, or if it
  533. // fails to respond with a success notification before timing out. VMs that
  534. // are not running or do not have an active agent do not count toward this
  535. // disruption budget.
  536. //
  537. // For zone-by-zone rollouts, if the disruption budget in a zone is exceeded,
  538. // the patch job stops, because continuing to the next zone requires
  539. // completion of the patch process in the previous zone.
  540. //
  541. // For example, if the disruption budget has a fixed value of `10`, and 8 VMs
  542. // fail to patch in the current zone, the patch job continues to patch 2 VMs
  543. // at a time until the zone is completed. When that zone is completed
  544. // successfully, patching begins with 10 VMs at a time in the next zone. If 10
  545. // VMs in the next zone fail to patch, the patch job stops.
  546. FixedOrPercent disruption_budget = 2;
  547. }