This page lists the IAMroles and permissions that are required to backup, mount, and restore a Compute Engine instance.
IAM roles and permissions
To backup, mount, and restore an instance you need to assign the
Backup and DR Compute Engine Operatorrole to the service account of the
backup/recovery appliance or create a custom role and assign all the permissions listed on
this page.
The following lists the predefined Compute Engine IAM permissions that are required to back up, mount, and restore Compute Engine instances.
Backup Compute Engine instance
compute.disks.createSnapshotcompute.disks.getcompute.instances.listcompute.instances.setLabelscompute.regions.getcompute.regionOperations.getcompute.snapshots.createcompute.snapshots.deletecompute.snapshots.getcompute.snapshots.setLabelscompute.snapshots.useReadOnlycompute.zones.listcompute.zoneOperations.getiam.serviceAccounts.actAsiam.serviceAccounts.getiam.serviceAccounts.listresourcemanager.projects.getresourcemanager.projects.list
Mount to existing Compute Engine instance
compute.disks.createcompute.disks.deletecompute.disks.getcompute.disks.usecompute.diskTypes.getcompute.diskTypes.listcompute.images.createcompute.images.deletecompute.images.getcompute.images.useReadOnlycompute.instances.attachDiskcompute.instances.createcompute.instances.deletecompute.instances.detachDiskcompute.instances.getcompute.instances.listcompute.instances.setMetadatacompute.regions.getcompute.regions.listcompute.regionOperations.getcompute.zones.listiam.serviceAccounts.actAsiam.serviceAccounts.getiam.serviceAccounts.listresourcemanager.projects.get
Mount to new Compute Engine instance and restore instance
compute.addresses.listcompute.diskTypes.getcompute.diskTypes.listcompute.disks.createcompute.disks.createSnapshotcompute.disks.deletecompute.disks.getcompute.disks.setLabelscompute.disks.usecompute.firewalls.listcompute.globalOperations.getcompute.images.createcompute.images.deletecompute.images.getcompute.images.useReadOnlycompute.instances.attachDiskcompute.instances.createcompute.instances.deletecompute.instances.detachDiskcompute.instances.getcompute.instances.listcompute.instances.setLabelscompute.instances.setMetadatacompute.instances.setServiceAccountcompute.instances.setTagscompute.instances.startcompute.instances.stopcompute.machineTypes.getcompute.machineTypes.listcompute.networks.listcompute.nodeGroups.listcompute.nodeGroups.getcompute.nodeTemplates.getcompute.projects.getcompute.regions.getcompute.regionOperations.getcompute.snapshots.createcompute.snapshots.getcompute.snapshots.setLabelscompute.snapshots.useReadOnlycompute.subnetworks.listcompute.subnetworks.usecompute.subnetworks.useExternalIpcompute.zoneOperations.getcompute.zones.listiam.serviceAccounts.actAsiam.serviceAccounts.getiam.serviceAccounts.listresourcemanager.projects.get
Permissions to mount Compute Engine instance with customer managed encryption keys
To mount a Compute Engine backup image as an existing or new Compute Engine
instance, where the source disk is using customer-managed encryption keys
(CMEK), you need to copy the service account name of the Compute Engine
service agent from the target project and add it in the source project and
assign the role CryptoKey Encrypter/Decrypter detailed as follows.
Use the following instructions to add permissions when using CMEK:
- From the Project drop-down, select your target project.
- From the left-navigation menu, go to IAM & Admin > IAM
- Select Include Google-provided role grants.
- Find the Compute Engine Service Agent service account and copy the ID of the Principal. This is in an email address format, such as my-service-account@my-project.iam.gserviceaccount.com.
- Select your source project from the Project drop-down where the key was created.
- From the left-navigation menu, go to IAM & Admin > IAM.
- Select Grant Access.
- In Add Principals, paste the ID of the Compute Engine service agent from the target project.
- In Assign roles, assign the
Cloud KMS CryptoKey Encrypter/Decrypterrole. - Select Save.
The Backup and DR Compute Engine guide
- Check for the cloud credentials
- Discover and protect Compute Engine instances
- Mount backup images of Compute Engine instances
- Restore a Compute Engine instance
- Import persistent disk snapshot images