How to delete the instance group

1,627 views
Skip to first unread message

TINA

unread,
Jul 13, 2018, 7:46:39 PM7/13/18
to gce-discussion
Hey,

Could you please guide me to delete my unused instance group,

When I try to delete my instance group, it always failed, the group can not be deleted and even can not be stopped. From the system message, I know there is a living "backend", while I can not find it in the GCP console. Do you know how to find the hide "backend" and delete it?

Delete VM instance group "instance-group-cchatty"
The instance_group_manager resource 'projects/windowtrafic/regions/asia-east1/instanceGroupManagers/instance-group-cchatty' is already being used by 'projects/windowtrafic/global/backendServices/backend'

Thanks,
/Tina 

Fady (Google Cloud Platform)

unread,
Jul 14, 2018, 7:44:45 PM7/14/18
to gce-discussion

Hello Tina,


Answering your question about deleting the backend service, you may achieve that in the console by accessing the load balancer list and clicking advanced settings. However, the backend service could also be in use by other resources like URL maps, and may throw another similar error. In this case, you may have to delete the resource from the advanced settings menu (some can only be deleted using gcloud commands), or delete the entire load balancer and its resources in one shot (select all check-boxes when the dialogue box appears).


Alternatively, you may use Google Cloud SDK commands like this Stackoverflow discussion. In Cloud Shell, execute this command to delete the backend service (assuming no other service is using it) as follows:


gcloud compute backend-services delete [backend-name] --global


As for deleting the instance group from console, you may try this link, or use this gcloud command as follows:


gcloud compute instance-groups managed delete [instance-group-name] --zone [Zone]



TINA

unread,
Jul 16, 2018, 9:04:25 AM7/16/18
to gce-discussion
Thanks Fady,

Do you know how to elevate the permission in Cloud Shell to delete the group, when I try to delete it in Shell, it shows that I don't have the permission. While I don't set the su password, so I am also don't know the su password.

Br,
/Tina

Fady (Google Cloud Platform)

unread,
Jul 16, 2018, 3:12:38 PM7/16/18
to gce-discussion

Hello Tina,


When making changes to any project resource from any Compute Engine instance, you need project IAM permissions and not necessarily only local instance (Linux permissions). That said, you need to check if your email account has the permissions first in IAM. Then, if you are an owner or editor (example), and if not authenticated, you need to authenticate using your account.


To list authenticated accounts you may use this command


gcloud auth list


To authenticate using your account and per this
SDK reference


gcloud auth login  or gcloud auth login [your email account]


In Cloud Shell though, you should be already authenticated, and if not you may check the above.


TINA

unread,
Jul 17, 2018, 8:45:07 PM7/17/18
to gce-discussion
Thank your help!

I am login in with the ower account, and checked in IAP permissions, it indeed the ower permission. 

While it still told me insufficient permission when I try to delete the backend use this command [gcloud compute backend-services delete backendServices --global]

Do you know what this issue is? Thanks a lot!

Fady (Google Cloud Platform)

unread,
Jul 18, 2018, 5:31:32 PM7/18/18
to gce-discussion

Hello Tina,


I am not really sure what other permission you may be missing. Thus, I suggest opening a private issue tracker report. Include in your report your project ID, the complete error message with the [--verbosity=debug] flag, and a screenshot of the [gcloud auth list] command. On the other hand, have you tried from console as I suggested in my past message?   


TINA

unread,
Jul 19, 2018, 3:41:09 AM7/19/18
to gce-discussion
Thank you, Fady!
I have tried your method, but unfortunately, it still doesn't work, so I will raise an issue in the tracker system. thanks again.

Fady (Google Cloud Platform)

unread,
Jul 19, 2018, 3:09:35 PM7/19/18
to gce-discussion

Hello Tina,


After checking the issue tracker, and for the benefit of the community, it seems that you were not executing the commands from the cloudshell prompt, but rather from one of the instances within the instance groups (maybe SSH’d from cloudshell to one of the instances). Furthermore, using the command you entered one of the instance’s name within the group rather than the name of the entire group. Hence, in both cases it threw this error:


ERROR: (gcloud.compute.instance-groups.managed.delete) Could not check if the Managed Instance Group is Autoscaled.

- Insufficient Permission


TINA

unread,
Jul 25, 2018, 10:11:37 AM7/25/18
to gce-discussion
Hey Fady,'
It works now, I deleted the group and instance, but I do nothing. I am not sure what the problem is, maybe network issue!  
https://issuetracker.google.com/issues/111565576
Reply all
Reply to author
Forward
0 new messages