16

I am trying to setup an instance schedular for my VM instance to start and end at particular time. I am getting an error permission related to my google service account when trying to add the vm instance to the scheduler. I have added this roles (Compute Instance Administrator (Version 1),Compute administrator) to my service account via IAM but still getting the same error. the error message is "Compute Engine System service account service-xxx needs to have [compute.instances.start, compute.instances.stop] permissions applied in order to perform this operation"

Anyone who has faced similar issue please suggest on how to fix it?

Br, Ramkrishna

2
  • Which role did you add? Edit your question and list the roles that the service account has. You can find this information in the Google Cloud Console -> IAM. Jul 31, 2021 at 19:09
  • included the roles added for the default service account Aug 1, 2021 at 22:29

1 Answer 1

28

There are two types of service accounts for Compute Engine.

  1. The default service account is assigned to the instance.
  2. The Compute Engine Service Agent is used by Google services to manage your resources.

You assigned the role to the wrong service account. The Agent needs the role added.

The Compute Engine Service Agent has the following format:

[email protected]

Solution:

  • Login to the Google Cloud Console
  • To to IAM & Admin
  • Select IAM in the left panel
  • Click the box Include Google-provided role grants on the right side of the window. This enables showing Google-managed service accounts.
  • Locate the service account. Press CTRL-F5 to open a search box. Enter the text compute-system.
  • Click the pencil icon to edit the service account.
  • Click ADD ANOTHER ROLE
  • In the role filter enter Compute. Select Compute Instance Admin (v1).
  • Click SAVE

Wait a few minutes before trying to use the new permissions.

Compute Engine Service Agent

Scheduling a VM instance to start and stop

4
  • Thanks manage to resolve it with the steps mentioned below Aug 2, 2021 at 14:25
  • Thanks! saved my day! that checkbox is really tricky one to notice!! Dec 9, 2021 at 15:56
  • For once simple guide for google cloud. I don't understand how they've managed to mess up their guides so badly. Aug 30, 2022 at 7:21
  • Not sure why GCP docs are always confusing..Thank you lot 🙏
    – arvindwill
    Feb 15, 2023 at 9:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .