Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to create google cloud backend service fails - what am I doing wrong?

I am currently working through the Google Cloud "load balancing" code lab:

https://codelabs.developers.google.com/codelabs/cpo200-load-balancing

On page 4 of the lab, it requires me to run the following command in the Cloud Shell, to create a backend-service (for load balancing of a group of web server, i.e. HTTP, instances):

gcloud compute backend-services create \
guestbook-backend-service \
--http-health-checks guestbook-health-check

However, running this command results in the following error:

ERROR: (gcloud.compute.backend-services.create) Some requests did not succeed:
 - Invalid value for field 'resource.loadBalancingScheme': 'EXTERNAL'.
Backend Service based Network Load Balancing is not yet supported.

Assuming that all the preceding steps in the code lab are correct (which I have no reason to suspect is not the case), this appears to be a bug in the code lab.

I have submitted a bug report for this, however, since I am not expecting any response to the bug report any time soon but I do want to continue on with this lab, what command should I be running instead?

I presume there has been some sort of API change but the code lab has not caught up and the documentation does not appear to indicate any relevant changes.

I realize I could probably work out how to do this with the Cloud Console, but I would really like to learn the command line actions.

Does anyone have any ideas?

Thanks in advance!

like image 801
oclipa Avatar asked Mar 23 '17 11:03

oclipa


1 Answers

And, as is the nature of these things, shortly after I post this I discover the answer for myself...

The command should be:

gcloud compute backend-services create \
guestbook-backend-service \
--http-health-checks guestbook-health-check \
--global

It appears that what the error message is actually complaining about is that regional backend-services are not supported; they must be global.

Leaving aside the fact that the lab directions are inadequate, it would be nice if this was detailed in the documentation, but I guess we can't have everything...

like image 142
oclipa Avatar answered Oct 06 '22 01:10

oclipa