Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cannot login to my VM, it says I must grant compute.instances.setMetadata permission

I am a very new user of GCM using it to transfer some data between two cloud storage services.

Everything was going fine until just recently, and now I am unable to login to my VM.

When I try, I get the error:

You do not have sufficient permissions to SSH into this instance. You need the following IAM permission: compute.instances.setMetadata.

Currently trying to figure out how to enable it, but as my understanding of this platform is pretty remedial, I have not been able to figure it out.

Any help would be appreciated, thank you

1 1 3,461
1 REPLY 1

Hi @highfiverobot,

Welcome to the Google Cloud Community!

Based on the error message that you received, it seems that you or a service account lacks a specific Permission called compute.instances.setMetadata. Basically in Google Cloud, a role contains a set of permissions that allows you to perform specific actions on Google Cloud resources[1].

Please verify that you have the appropriate Role to SSH into an instance, you may do so by:

1. Head to your Google Cloud Console.

2. You may search IAM in the search bar as shown in the image.

IAM.png

3. Find a service account called Compute Engine default service account, check if it has the Compute Instance Admin (v1) role.

4. Head to Compute Engine, then click on the name of your instance.

5. In the Details tab, scroll down until you find the Service Account. Then, verify if it's the same with the one that has the Compute Instance Admin (v1) role.

Please let me know if that was helpful. Thank you! 😃

[1]. https://cloud.google.com/iam/docs/roles-overview