Search code examples
shellgoogle-cloud-platformgoogle-compute-enginegcloud

Retrieving total RAM amount of a GCP instance


I wonder if there is a way with Google SDK and the gcloud command on a linux shell to retrieve the total RAM amount of a GCP instance. I have already tried with gcloud compute instances describe but it doesn't seem to indicate what I am looking for.

Have you got any suggestions?

Thanks.


Solution

  • You may get machine type of your instance this way

    gcloud compute instances list INSTANCE --format="value(machineType.scope(machineTypes))"

    and describe its machine-type this way

    gcloud compute machine-types describe NAME

    Therefore giving you RAM and some other characteristics.