Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

GCE-GCS Challenge 1 – Bucket Issues

I followed the steps, but I’m unable to see my log file in my bucket. When I SSH into the machine, I’ve tried running the lines from "Report that we’re done" one by one.

I get an Error 404 – Not Found:

The requested URL /computeMetadata/v1/instance/attributes/lab-logs-bucket was not found on this server. That’s all we know. must match exactly 1 URL

Does anyone know what I’m doing wrong, or have any suggestions on how to troubleshoot this?

UPDATE: Well, I started the next section, and the template I built seems to work. I’m going to chock it up on a type on my part somewhere. Though I would still love some troubleshooting tips.

1 Answers

Hello Eddie,

I’m not sure what could have gone wrong with your trail, but, follow the below, adjusting it to your own needs:

#: create the new project  
gcloud projects create pimballeke-new-project005 --enable-cloud-apis  

#: current documentation does not mention what are the APIs enabled when crating a   
#: new project with the --enable-cloud-apis flag. I opened a request for better docs:   
#: enable the billing account for the created project  
#: list billing accounts  
gcloud alpha billing accounts list  

#: link the project and the billing acocunt  
gcloud alpha billing projects link pimballeke-new-project005 --billing-account XXXXXX-XXXXXX-XXXXXX  

#: set the current session project's  
gcloud config set project pimballeke-new-project005  

#: set the default region and the default zone on the cloud shell  
gcloud config set compute/region us-west2  
gcloud config set compute/zone us-west2-b  

#: list enabled apis  
gcloud services list --enabled  
NAME                              TITLE           BigQuery API    BigQuery Storage API          Google Cloud APIs      Cloud Debugger API         Cloud Trace API            Compute Engine API          Cloud Datastore API            Cloud Logging API         Cloud Monitoring API            Cloud OS Login API  Service Management API       Service Usage API      Cloud SQL        Stackdriver API        Google Cloud Storage JSON API  Cloud Storage  
#: enable the as we're going to create a VM  
gcloud services enable  

#: list enabled APIs - the below command will delay a little  
gcloud services list | grep -i compute            Compute Engine API  

#: list configurations  
gcloud config configurations list  

#: create the bucket  
gsutil mb gs://pimballeke-new-project005/  

#: create the instance with the user-data script, the metadata for the bucket and the scopes for monitoring, storage and logging  
gcloud compute instances create myvm01 --metadata lab-logs-bucket=gs://pimballeke-new-project005/ --metadata-from-file --scopes storage-rw,monitoring-write,logging-write --machine-type f1-micro --deletion-protection  

#: ssh in to check top  
gcloud compute ssh myvm01  

#: check contents on the bucket  
$ gsutil ls -a gs://pimballeke-new-project005/  
-- cleaning up  

#: deleting the vm instance  
$ gcloud compute instances update myvm01 --no-deletion-protection  
Setting deletion protection of instance [myvm01] to [False]...done.  

$ gcloud compute instances delete myvm01  

 - [myvm01] in [us-west2-b]  

Do you want to continue (Y/n)?  Y  

Deleted [].  

#: deleting the bucket created  
$ gsutil rm -r gs://pimballeke-new-project005/  
Removing gs://pimballeke-new-project005/machine-myvm01-finished.txt#1596746013258924...  
/ [1 objects]  
The operation completed over 1 objects.  
Removing gs://pimballeke-new-project005/...

I hope it helps.


Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?