Cheat Sheet Google Cloud gcloud CLI
The gcloud command-line interface is the Swiss Army knife for managing Google Cloud resources.
Whether you’re spinning up VM instances, inspecting IAM roles, deploying networks, or automating configurations, gcloud lets you do it all directly from your terminal.
It’s built on top of the same APIs as the Cloud Console, giving you full control, repeatability, and scriptability for both interactive troubleshooting and infrastructure automation.
In this cheat sheet, you’ll find the most useful gcloud commands for everyday work, from listing resources and checking metadata to diagnosing VMs and extracting OS information when guest attributes are disabled.
Below I will show the basics about both and update the post on a regular basis.
Determine VM OS Version in GCP from the CLI
If both OS Inventory / VM Manager are disabled and you don’t have console access to the instance, you can still determine the operating system version using the gcloud CLI.
By inspecting the VM’s image or license metadata, you can identify the base OS family (for example, Ubuntu, Debian, SLES, or Windows) that was used when the instance was created, all without logging into the VM itself.

$ gcloud compute instances describe INSTANCE_NAME --zone=ZONE | grep -E "sourceImage|licenses" $ gcloud compute instances describe instance-site-a-vm01 --zone=europe-west3-a | grep -E "sourceImage|licenses"

Links
Google Cloud overview
https://cloud.google.com/docs/overview