A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/compute/docs/instances/simulating-host-maintenance below:

Simulate a host maintenance event | Compute Engine Documentation

Simulate a host maintenance event

Stay organized with collections Save and categorize content based on your preferences.

Linux Windows

This page describes how to test the effects of your Compute Engine instance's host maintenance policy on your applications.

You might simulate a maintenance event on your VMs to test the following:

If you try to simulate a host maintenance event on an instance that doesn't support live migration, the instance is either terminated or restarted, depending on the configured host maintenance policy.

Before you begin Limitations Simulate host maintenance events to test live migration

You can simulate a maintenance event for a compute instance by using either the Google Cloud CLI or an API request. This simulated event includes the different maintenance activities that occur in a regular maintenance event. This lets you observe the end-to-end process and test any automation that you might have implemented.

During the simulation of host maintenance event for an instance that uses live migration, the maintenance-event metadata key of the instance goes through the following changes:

  1. At the start of the simulation, the value of the maintenance-event metadata key changes from NONE to MIGRATE_ON_HOST_MAINTENANCE.
  2. Throughout the duration of the simulation event, the value remains as MIGRATE_ON_HOST_MAINTENANCE.
  3. After the simulation ends, the value returns to NONE.

To query the maintenance event key, see Query the maintenance event metadata key.

gcloud

Use the compute instances simulate-maintenance-event command to simulate a maintenance event for an instance and test its configured host maintenance policy settings:

gcloud compute instances simulate-maintenance-event INSTANCE_NAME \
    --zone=ZONE --with-extended-notifications=True

Replace the following:

REST

Construct a POST request to the compute.instances.simulateMaintenanceEvent method:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/simulateMaintenanceEvent

Replace the following:

Simulate host maintenance for compute instances that terminate

You can simulate a maintenance event for a compute instance by using either the Google Cloud CLI or an API request. This simulated event includes the different maintenance activities that occur in a regular maintenance event. This lets you observe the end-to-end process and test any automation that you might have implemented.

Additionally, by using the parameter --with-extended-notifications with a supported machine type you can test manually starting host maintenance during the simulated event.

gcloud
  1. Use the compute instances simulate-maintenance-event command to simulate a maintenance event for an instance and test its configured host maintenance policy settings. You can optionally include the --with-extended-notifications flag.

    gcloud compute instances simulate-maintenance-event INSTANCE_NAME \
       --zone=ZONE --with-extended-notifications=True
    

    Replace the following:

  2. Optional: To manually start the simulated maintenance event, use the compute instances perform-maintenance command.

    gcloud compute instances perform-maintenance INSTANCE_NAME \
       --zone=ZONE
    

    Replace the following:

REST
  1. Construct a POST request to the compute.instances.simulateMaintenanceEvent method. You can optionally include the query parameter withExtendedNotifications.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/simulateMaintenanceEvent?withExtendedNotifications=True
    

    Replace the following:

  2. Optional: To manually start the simulated maintenance event, construct a POST request to the compute.instances.performMaintenance method.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/performMaintenance
    

    Replace the following:

Simulate host maintenance events on sole-tenant nodes

You can simulate a host maintenance event on sole-tenant nodes using either the Google Cloud CLI or an API request. During the simulation of the host maintenance event on a sole-tenant VM, the maintenance-event metadata key value doesn't change and remains NONE throughout the simulation.

gcloud

Run the sole-tenancy node-groups simulate-maintenance-event command to force sole-tenant nodes to activate their configured maintenance policy:

 gcloud compute sole-tenancy node-groups simulate-maintenance-event NODE_GROUP \
    --nodes=NODE_NAMES \
    --zone=ZONE \
    --async

Replace the following:

REST

Construct a POST request to the compute.nodeGroups.simulateMaintenanceEvent method:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/nodeGroups/NODE_GROUP/simulateMaintenanceEvent

{
  "nodes": [
      "NODE_NAMES"
  ]
}

Replace the following:

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This page details how to simulate host maintenance events on Compute Engine instances to test the impact of different host maintenance policies on applications, including live migration, preemption, and shutdown behaviors."],["You can simulate maintenance events for both regular compute instances and sole-tenant nodes, observing how applications handle migration, termination, or restart processes during such events."],["The simulation process for standard compute instances will alter the `maintenance-event` metadata key, switching its value during the event, whereas with sole-tenant VMs, the value will remain unchanged at `NONE`."],["Simulating maintenance events can be done through the Google Cloud CLI or REST API, offering options to test various scenarios such as live migration, termination, or manual intervention in maintenance procedures."],["For sole-tenant node groups there are specific limitations to consider, such as the number of nodes that can have simultaneous maintenance events and the fact that the maintenance event needs to be sequentially triggered."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4