nerdexam
Google

ASSOCIATE-CLOUD-ENGINEER · Question #253

You want your application hosted on a VM to fetch metadata of that instance. Which command will help you to fetch it?

The correct answer is C. curl metadata.google.internal/computeMetadata/v1/. To fetch metadata from a Google Cloud VM instance, applications should use the specific internal domain metadata.google.internal and the /computeMetadata/v1/ path with the appropriate Metadata-Flavor header.

Submitted by chiamaka_o· Mar 30, 2026Ensuring successful operation of a cloud solution

Question

You want your application hosted on a VM to fetch metadata of that instance. Which command will help you to fetch it?

Options

  • Acurl metadata.google.internal/compute-metadata/v1/
  • Bcurl <instance-private-ip>/metadata/v1/
  • Ccurl metadata.google.internal/computeMetadata/v1/
  • Dcurl internal.googleapi.com/computeMetadata/v1/

How the community answered

(39 responses)
  • B
    3% (1)
  • C
    95% (37)
  • D
    3% (1)

Why each option

To fetch metadata from a Google Cloud VM instance, applications should use the specific internal domain `metadata.google.internal` and the `/computeMetadata/v1/` path with the appropriate `Metadata-Flavor` header.

Acurl metadata.google.internal/compute-metadata/v1/

The path `compute-metadata` with a hyphen is incorrect; the correct path uses camel case `computeMetadata`.

Bcurl <instance-private-ip>/metadata/v1/

Directly querying the instance's private IP for metadata is not the standard or recommended method; the special internal DNS name `metadata.google.internal` is used.

Ccurl metadata.google.internal/computeMetadata/v1/Correct

The standard and recommended method for applications running on a Google Cloud VM to access instance metadata is to send a `curl` request to `http://metadata.google.internal/computeMetadata/v1/`, including the `Metadata-Flavor: Google` header.

Dcurl internal.googleapi.com/computeMetadata/v1/

The domain `internal.googleapi.com` is used for other internal Google APIs, not specifically for fetching instance metadata from a VM itself.

Concept tested: Accessing Google Cloud instance metadata

Source: https://cloud.google.com/compute/docs/storing-retrieving-metadata#default

Topics

#Compute Engine metadata#metadata server#instance metadata#curl

Community Discussion

No community discussion yet for this question.

Full ASSOCIATE-CLOUD-ENGINEER Practice