Skip to navigation

Compute Engine: Restore Disks in Place

Who can use this feature

Anyone with these permissions: Restore resources

Restoring the disks of an existing Compute Engine instance in place returns it to the state of an Eon snapshot without creating a new instance. The instance keeps its ID, network interfaces, private IP addresses, and configuration.

This article explains how to restore the disks of a Compute Engine instance in place from the Eon console.

To restore into a new instance instead, see Compute Engine: Restore a VM. To restore a single disk as a new disk, see Compute Engine: Restore a Disk.

Restore the disks of an instance

You can start from the inventory page in the Eon console.

Eon stops the instance while it swaps the disks, which interrupts anything running on it.

Before you start

Before you restore the disks of an instance in place, make sure:

  • The instance is running or stopped, and no managed instance group manages it. A suspended instance stays in that state until you resume it, so resume it first.

  • If the instance runs as a service account, the restore account can act as that service account. The restore account gets this access through the Service Account User role (roles/iam.serviceAccountUser). Connecting a restore project doesn’t grant it, so grant it on each service account that an instance you restore runs as. For instructions, see Let the restore account act as a service account. An instance without a service account needs nothing.

1

Find the snapshot you want to restore

  1. In your inventory, select the Compute Engine instance whose disks you want to restore. The resource details panel opens.

  2. Click the Eon snapshots tab. You’ll see a calendar view with colored dots on the days when snapshots were taken. There can be more than one snapshot per day.

    When you click a day, a list of Eon snapshots taken that day is displayed below the calendar.

  3. Expand the snapshot you want to restore. Under What do you want to restore?, select Restore disks in place, and then click Restore. The Restore disks in place wizard opens.

2

Choose the disks to restore

In the Disks step, Eon chooses the restore account and runs a plan check on the live instance. The read-only Restore account block shows the name of the restore account Eon uses. The plan check lists each disk of the snapshot in a table.

ColumnShows
SlotThe slot the restored disk takes: Boot (device name) for the boot disk, or a data disk’s device name.
Snapshot diskThe ID of the disk in the snapshot.
Attached nowThe disk in that slot on the instance now.
StatusSame disk when the snapshot’s disk is still in its slot, Different disk when another disk is in the slot, or Empty slot when no disk is in the slot.
SizeThe size the restored disk gets. When it differs from the disk it replaces, the column shows both sizes.
  1. Review the plan check results. If This VM’s disks can’t be restored in place appears, the instance has a blocker. If a disk can’t be restored, it’s listed with the reason and can’t be selected. For what each result means, see Plan check results.

  2. Clear the disks you don’t want to restore. Eon selects every disk that can be restored.

  3. Click Next.

Disks that were added to the instance after the snapshot was taken appear under Stays attached. Eon doesn’t touch them.

3

Review and start the restore

In the Review step, Eon summarizes how many of the snapshot’s disks it restores into the instance, and shows the Restore account block again.

  1. Select the checkbox for each warning under Acknowledge before you continue. The warnings that appear depend on the instance and your selection.

  2. To choose whether the instance is running after the restore, turn Start instance after restore on or off. If you don’t change the switch, Eon starts the instance after the swap only when the instance was running just before Eon stopped it.

  3. Click Restore disks. Eon starts the asynchronous restore job.

If the instance’s disks change while you review them, or Eon would now choose a different restore account, Eon asks you to review the changes or plan the restore again before you can restore.

You can monitor the restore job on the Restore jobs tab in the Jobs page. The job type is GCE in-place disk restore.

When the restore job succeeds, the restored disks are in the same slots as the disks they replaced. The instance is running only if Eon started it.

Plan check results

The plan check reads the instance live, so the result reflects its disks at the moment you open the wizard. The wizard words each blocker and warning slightly differently from the descriptions below.

Restore account

You don’t choose the restore account. Eon considers the restore projects connected for the GCP project that contains the instance. Of these, it keeps the active ones in the project that your role allows as a restore destination. Eon swaps the disks with the one that passes every check.

When no restore account passes every check, the plan check lists the blockers of the restore account closest to working, together, under This VM’s disks can’t be restored in place. When your role allows none of the restore accounts, the plan check fails with You can’t restore this VM’s disks in place: permission denied: restore account access restricted by role. Ask an administrator to change your role’s restore destination limits.

Instance blockers

A blocker at this level disables the restore for every disk.

BlockerWhat to do
The instance no longer exists.Restore into a new instance instead. An instance with the same name and zone but a different ID counts as a new instance.
The instance is starting, stopping, or changing state.Wait until the instance is running or stopped, and then run the plan check again. Resume a suspended instance first.
No restore account is connected for the instance’s cloud account.Connect a restore project for the GCP project that contains the instance, and then try again.
The restore account’s role predates in-place disk restore.Update the restore project’s permissions to version 1.8.0 or later, and then try again.
The restore account doesn’t allow in-place disk restore.Update the restore project with restore permissions turned on for VMs, and then try again.
Another in-place restore of this instance is still running.Wait for the other restore to finish.
A scaling group manages the instance and would replace or restart it.Use Compute Engine: Restore a VM instead.
The restore account can’t act as the instance’s service account, so Compute Engine won’t let it attach disks to the instance.Grant the restore account the Service Account User role on that service account, as described in Let the restore account act as a service account, and then try again.

Disk blockers

A disk blocker disables only the affected disk. The wizard lists it with the disk’s ID and the reason it can’t be restored, and you can restore the instance’s other disks.

BlockerWhat to do
The snapshot’s boot disk and the instance’s current boot disk differ in UEFI compatibility.Use Compute Engine: Restore a VM instead.
The disk is attached from another project, where the restore account can’t create its replacement.Restore the disk as a new disk with Compute Engine: Restore a Disk.
The restore account can’t read the disk, so its settings can’t be copied to the restored one.Restore the disk as a new disk with Compute Engine: Restore a Disk.
The disk is shared with other instances, so detaching it wouldn’t take it away from them.Restore the disk as a new disk with Compute Engine: Restore a Disk.
A regional disk can’t be recreated in the same form. Only Hyperdisk Balanced High Availability disks can be.Restore the disk as a new disk with Compute Engine: Restore a Disk.
The disk is encrypted with a customer-supplied key, which Eon doesn’t hold.Restore the disk as a new disk with Compute Engine: Restore a Disk.

Warnings to acknowledge

A warning doesn’t block the restore. You acknowledge each warning that applies on the Review step before you can start.

WarningShown when
Eon stops the instance while it swaps the disks.Every restore.
The instance’s ephemeral public IP address is released when it stops, and it gets a new one when it starts.A running instance has an external IP address. Eon can’t tell an ephemeral address from a reserved one, so it reports this for any external address.
Data on local SSD disks is lost when the instance stops.The instance has local SSD disks.
Not every disk of the snapshot is selected. A file system or volume group that spans disks may come back inconsistent.You leave out any of the snapshot’s disks.
A slot holds a different disk than the one the snapshot recorded. That disk is detached and kept.The disk in a slot isn’t the one the snapshot recorded.

What happens during the restore

Eon restores the data first, so the instance is unavailable only while Eon swaps the disks:

  1. Eon restores each selected disk from the snapshot into a new disk while the instance keeps running.

  2. Eon skips the scheduled backups and scans of the instance that haven’t started yet. They appear as Skipped in the job list. If a backup of the instance has already started, Eon waits until it has captured the disks, which usually takes a few minutes.

  3. Eon checks the instance’s disks again. If they changed since you reviewed them, the restore fails before it stops the instance.

  4. Eon stops the instance, detaches the selected disks, and attaches the restored disks in the same slots.

  5. Eon starts the instance if you chose to, or if you left the switch unchanged and the instance was running before the stop.

Disks that you didn’t select stay attached and aren’t changed.

Backups and scans after the restore

For one hour after the restore, Eon holds the scheduled backups and scans of the instance. When the hour ends, a held scheduled backup runs if its schedule window is still open. If the window has closed, the backup appears as Skipped.

On-demand backups aren’t held. Starting an on-demand backup of the instance ends the hold early.

What happens to the original disks

Eon keeps each original disk, detached and marked with the job ID, and never deletes it. The originals stay in your account and incur cost until you delete them. Eon labels each detached original disk with eon-in-place-restore-job-id, eon-in-place-restore-instance, and eon-in-place-restore-device.

The restore job’s details list each swap under Disk swap: the Slot, the Original disk (kept), and the Restored disk. The state next to the instance’s ID is Swapped after a successful restore. While the swap runs it shows Swap in progress. If a job ends while it still shows that state, check which disks are attached to the instance.

There’s no way to revert a restore in Eon. To go back to an original disk, stop the instance, detach the restored disk from the slot that Disk swap lists, and attach the original there.

If the restore fails

What Eon does depends on how far the restore got:

  • Before Eon stops the instance: The instance isn’t changed, and Eon deletes the disks it restored.

  • After the stop, before the swap: Eon starts the instance if it was running before, and deletes the disks it restored.

  • During the swap: Eon puts the original disks back in their slots, starts the instance if it was running before, and deletes the disks it restored. The job’s Disk swap state is Original disks put back.

  • If Eon can’t put the original disks back: The state is Putting the originals back failed, and Eon deletes nothing. The original disks and the restored disks are both kept, so you can attach the ones you want. The instance stays stopped.

  • If the instance doesn’t start again after Eon puts the original disks back: The job fails and the instance stays stopped. Eon still deletes the restored disks. Start the instance yourself.

  • If the instance doesn’t start after a successful swap: The job fails and the instance keeps the restored disks. Start the instance yourself, or stop it, detach the restored disks, and attach the original disks.

If Compute Engine refuses to attach disks during the swap because the restore account can’t act as the instance’s service account, the job error names that service account. To get the instance running with its original disks:

  1. Grant the restore account access, as described in Let the restore account act as a service account.

  2. Attach each original disk in the slot that Disk swap lists for it.

  3. Start the instance.

Let the restore account act as a service account

Compute Engine requires the restore account to act as an instance’s service account whenever it attaches a disk to that instance. Without this access, the job fails before it stops the instance, with an error that names the service account and the role.

To grant the access, you need permission to manage access to the instance’s service account, for example the Service Account Admin role.

The Service Account User role lets the restore account act as, or impersonate, the service account. Grant it on that service account only, not on the project.

For details, see Google’s Service account impersonation and Manage access to service accounts.

You need two emails: the instance’s service account, and the restore account’s service account. Then grant the role in the Google Cloud console or with gcloud.

Find the instance’s service account

In the Google Cloud console, the instance’s details page shows its service account under API and identity management. For more about it, see Google’s Change the service account of an instance.

Or run the following command, which prints the service account’s email:

gcloud compute instances describe <instance_name> \
--project=<project_id> \
--zone=<zone> \
--format="value(serviceAccounts[].email)"

Find the restore account’s service account

In the Google Cloud console, go to IAM & Admin → Service Accounts, and select the project that contains the instance. The restore account’s service account has this email:

eon-restore-<first_16_characters_of_eon_account_id>@<project_id>.iam.gserviceaccount.com

In the list, it’s the email that starts with eon-restore- and doesn’t have nd right before the @. The one with nd is another Eon service account.

Grant access in the Google Cloud console

  1. Go to IAM & Admin → Service Accounts, and select the project that contains the instance’s service account.

  2. Click the email of the instance’s service account, and then click the Permissions tab.

  3. Click Grant access.

  4. Enter the email of the restore account’s service account as the principal.

  5. Click Select a role, choose Service Account User, and then click Save.

Then run the plan check again.

Grant access with gcloud

Run the following command, with the instance’s service account as <instance_service_account_email>, the restore account’s service account as <restore_service_account_email>, and the project that contains the instance’s service account as <project_id>:

gcloud iam service-accounts add-iam-policy-binding <instance_service_account_email> \
--member="serviceAccount:<restore_service_account_email>" \
--role="roles/iam.serviceAccountUser" \
--project=<project_id>

Then run the plan check again.