Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

GCS & GCE Challenge Lesson Demo Log file not getting copied

As per shown in demo, i tried to do the same. First time when i followed activity, log file was copied to bucket. but later its not working while i am tryinig multiple times from console as well as shell. below steps i used from gcloud shell. please suggest. everything working, but log file is not getting generated and copied to bucket.

Gcloud shell

Project creation —

gcloud projects create mychallenge-nishad-lab

gcloud config set compute/region us-west4

gcloud config set compute/zone us-west4-b

gcloud config set project mychallenge-nishad-lab

link project to billing account —

gcloud alpha billing accounts list

gcloud beta billing projects link mychallenge-nishad-lab –billing-account=011DEB-EA764E-82CE81

Create bucket

gsutil mb gs://challenge-lab1-cmd-nishad

gsutil ls

gsutil du -sh gs://challenge-lab1-cmd-nishad – for size of bucket

gsutil ls -L -b gs://challenge-lab1-cmd-nishad – For informattion of bucket

GCE – Gcloud compute engine API

Enable and list —

gcloud compute instances list — > Y It will enable Gcloud compute engine api

Create vm instances

gcloud compute instances create challengelab1nishad-vm –project=mychallenge-nishad-lab –zone=us-west4-b –machine-type=e2-micro –metadata=lab-logs-bucket=gs://challenge-lab1-cmd-nishad –scopes=https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/trace.append,https://www.googleapis.com/auth/devstorage.write_only –metadata-from-file=startup-script=/home/nishad_virkud/gcp-cloud-engineer/worker-startup-script.sh

1 Answers

It might be the agent

In the script provided by the instructor replace:

curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh

bash install-logging-agent.sh

with:

curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh

bash add-logging-agent-repo.sh –also-install

======

See the docs here for more info about the change https://cloud.google.com/logging/docs/agent/installation as google may update their services.

Sign In
Welcome Back!

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

Get Started
Who’s going to be learning?