user1614862
user1614862

Reputation: 4159

GCP access snapshots of one account from another account to create VM instace

I have two snapshots on my account1 which I would like to access and create VM instances from account2. I added my account2 as Cloud Storage Admin to IAM in my account1 and vice versa, still I cannot see snapshots of account1 on my account2. I was able to do this few months back, however I am not able to do this anymore, is anything changed at GCP or am I missing anything here??

Upvotes: 2

Views: 799

Answers (2)

marian.vladoi
marian.vladoi

Reputation: 8074

These are the steps that worked for me:

(project1)$ gcloud compute snapshots list
Listed 0 items.
(project2)$ gcloud compute snapshots list
NAME        DISK_SIZE_GB  SRC_DISK                        STATUS
snapshot-1  30            us-central1-a/disks/instance-1  READY

I added the user who owns project1 to project2 and granted the role: link

Snapshots: Select Compute Engine > Compute Storage Admin from the role selector.

Then I checked for the snapshots in project1 and was able to find the snapshot from project2:

(project1) gcloud compute snapshots  list --project project2
NAME        DISK_SIZE_GB  SRC_DISK                        STATUS
snapshot-1  30            us-central1-a/disks/instance-1  READY

Upvotes: 1

Ashish Kumar
Ashish Kumar

Reputation: 581

You can share access to images and snapshots with other users by granting them the following IAM roles or permissions at the resource, project, folder, or organization level.

Images: The roles/compute.imageUser role or the compute.images.useReadOnly permission.

Snapshots: The roles/compute.storageAdmin role or the compute.snapshots.useReadOnly permission.

I think you have given role as storage admin, instead give compute.storageAdmin.

Upvotes: 1

Related Questions