This document provides solutions to common issues you might encounter when
updating a Compute Engine VM instance. For general instructions on how to
update a VM, see [Update instance properties](https://docs.cloud.google.com/compute/docs/instances/update-instance-properties).

## Best practices

To avoid common issues when updating a VM, follow these best practices:

- Use the `update-from-file` workflow: Export the instance configuration to a
  file, modify the file, and then use the
  `gcloud compute instances update-from-file` command to apply the changes. This
  approach helps prevent errors from manual commands.

- Use the `most-disruptive-allowed-action` flag: This flag prevents accidental
  restarts. Set it to `NO_EFFECT` to test your changes, `REFRESH` for
  non-disruptive updates, and `RESTART` only when you are sure a restart is
  acceptable.

## Common issues

This section lists errors you might encounter when updating a VM and provides
guidance on how to resolve them.

### Metadata fingerprint mismatch

This error occurs when you try to update a VM instance, but the VM's metadata
was updated by another process since you last refreshed the page or fetched the
instance data.

**Error message**:

    Supplied fingerprint does not match current metadata fingerprint

**Resolution**:

The instance fingerprint property in your request must match the current
fingerprint of the instance to prevent simultaneous update requests from
overwriting each other. Try the following:

- Refresh the page: If you're using the Google Cloud console, refresh the VM
  instance **Details** page before making your changes.

- Use the `--no-etag-cache` Google Cloud CLI flag: If you're using the
  Google Cloud CLI, use the `--no-etag-cache` flag with your
  `gcloud compute instances update` command.

- Retry after a few minutes: As a last resort, try stopping the VM, waiting a
  few minutes, and then attempt to make the change again.