nab
nab

Reputation: 4861

GCE: How to get instance type from SSH shell?

In Amazon AWS there is an option to fetch information about the instance you are on by making HTTP request to meta data like:

curl http://169.254.169.254/latest/meta-data/

Particularly if you need to know instance type you can use

curl http://169.254.169.254/latest/meta-data/instance-type

No special tools are required. Is there anything like AWS metadata at Google Compute Engine so that one can get instance info without specifying project/instance name?

Upvotes: 0

Views: 244

Answers (1)

Thomas Orozco
Thomas Orozco

Reputation: 55303

Yes, it's at: http://metadata.google.internal/computeMetadata/v1/

The specific key you'r looking for is at:

http://metadata.google.internal/computeMetadata/v1/instance/machine-type

See the docs here.

Upvotes: 2

Related Questions