'GCP VM Auto Stop and Start setup using GCP Instance schedule
I'm trying to setup an auto stop/start of some of my VMs in GCP and I already have an VM admin permission but when adding a VM to a instance schedule created I'm getting below error:
Compute Engine System service account [email protected] needs to have [compute.instances.start,compute.instances.stop] permissions applied in order to perform this operation.
Solution 1:[1]
The problem is that the service [email protected] does not have a role that contains the permissions compute.instances.start and compute.instances.stop.
The following roles contain that permission:
- Compute Instance Admin - roles/compute.instanceAdmin
- Compute Instance Admin (v1) - roles/compute.instanceAdmin.v1
Use the Google Cloud Console GUI to add the desired role or use the CLI:
gcloud projects add-iam-policy-binding REPLACE_WITH_PROECT_ID \
--member "serviceAccount:[email protected]" \
--role "roles/compute.instanceAdmin.v1"
Of course, use the correct service account email address.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | John Hanley |

