Prepare and test your skills

Prepare and test your skills

Command-Line Resource Discovery is the practice of using the Google Cloud CLI (opens in a new tab) to find and inspect Compute Engine (opens in a new tab) instances in a project. Each instance belongs to a Google Cloud project and has a zone, machine type, status, and network addresses. The command gcloud compute instances list displays all virtual machine (VM) instances in the current project as a human-readable table, so an operator can quickly confirm what is running without opening the console.
Listing virtual machine instances with gcloud compute instances list returns the most relevant data for each VM in the project. The default table view is designed for quick operational checks, including instance name, zone, status, machine type, and assigned internal and external IP addresses. Each network interface of a Compute Engine instance is attached to a subnet of a VPC network, which is why the list output distinguishes an internal address used inside the VPC from an external address used from the internet. Use this list command first when you need to discover instance names before running a more detailed command.
Customizing output with formatting flags lets you control which fields are shown and which instances are returned. The flags apply to the data returned from Compute Engine before it is displayed, so traffic flows from the Compute Engine API to the gcloud client and then to the formatted table or structured output.
--format selects the output shape and fields, such as --format="table(name,zone,status,machineType,networkInterfaces)" or json, yaml, and text.--filter returns only matching resources, such as VMs with GPUs or with local SSDs.--limit sets the maximum number of results to return.--sort-by orders results by a field, with a ~ prefix for descending order.The --format flag is the key tool for retrieving essential data because you can request exactly the status, machine type, and IP address fields you need. Filtering and sorting then narrow that result when a project contains many instances.
Getting full details for a single instance uses gcloud compute instances describe VM_NAME, where VM_NAME is the name found from the list command. The describe command returns all data associated with that one VM, and its default output is YAML format. You can add --format json, --format yaml, or --format text when you need to parse the output or read one property per line.
| Command | Scope | Output |
|---|---|---|
gcloud compute instances list | All VMs in a project | Human-readable table of key fields, customizable with --format and --filter |
gcloud compute instances describe VM_NAME | One named VM | Complete details for that VM, default YAML with json, yaml, or text options |
The list command depends on knowing the project, while the describe command depends on knowing the instance name from the list. Choose list for discovery and status checks across many VMs, and choose describe only after you have the exact name and need full configuration.
Exam tip: Use list to discover VMs and shape columns with --format, and use describe VM_NAME to get all data for one VM.
Cloud Console Navigation and Instance Monitoring is the practice of using the Google Cloud console to find all running Compute Engine (opens in a new tab) virtual machines (VMs) and check their health from one place. Each Compute Engine instance belongs to a Google Cloud project, and a project can contain one or more instances in different zones. Metrics from those instances flow into Cloud Monitoring (opens in a new tab), which displays them on the VM details page and on centralized dashboards.
The VM instances page is the central list where you view all current running Compute Engine instances in the selected project. To open the VM instances page, go to the Google Cloud console and navigate to Compute Engine, or use the search bar and select the result whose subheading is Compute Engine. You must first select the correct project in the toolbar, verify billing is enabled, and enable the Compute Engine and Cloud Monitoring APIs. After a new VM is created and started, it appears on the VM instances page with a green status icon when it is ready.
The VM instances list shows configuration details that identify where each VM runs and how it connects. Each row names the instance and shows its zone, operating system, and machine type, which are set when the instance is created in a project. Each network interface of a Compute Engine instance is associated with a subnet of a unique Virtual Private Cloud (VPC) network, so the list and the instance details connect the VM to its network location. From this list you can click an instance name to open its details, or click SSH for Linux and use Remote Desktop Protocol (RDP) for Windows to connect for further checks.
The Observability tab is the built-in health view for a single Compute Engine VM instance. The Observability tab displays utilization metrics, throughput metrics, and data about logs for that instance, so CPU, memory, network throughput, and log activity appear together. The tab depends on Cloud Monitoring, and charts may take a few minutes to show data after a VM is first created.
To open the Observability tab for a VM:
You can keep these health signals alongside logs by creating an editable copy:
Cloud Monitoring dashboards provide the project-wide view of Compute Engine health across zones and networks. When you add a VM instance to a project, Cloud Monitoring automatically installs dashboards for the instance and its disks. To view these dashboards, go to the Dashboards page in the console, select the correct project, and in the My Dashboards pane filter Type to Google Services.
| Dashboard view | Scope | Use when |
|---|---|---|
| VM Instances | One selected VM and its logs | You need metrics and logs for an individual VM |
| GCE VM Instance Monitoring | All VMs in the project | You need to compare health and throughput across all active VMs |
The Compute Engine Observability tab shows the same metrics and logs for a VM that Cloud Monitoring shows for that VM, so the two views stay consistent. You cannot delete or modify the automatically created Google Services dashboards, but you can copy them into a custom dashboard and then add widgets, add labels, resize, or delete the copy.
Exam tip: To change an automatically created dashboard, use Copy dashboard first and edit the copy, because the original cannot be modified or deleted.
Advanced filtering and metadata inspection is the practice of narrowing a large list of Compute Engine (opens in a new tab) instances down to specific running instances and then checking their configuration details for compliance. Each instance belongs to a Google Cloud project and is defined by its zone, operating system, and machine type, so filtering by project and zone is the starting point for operational review. Administrators perform this work using the Google Cloud console, the gcloud command-line tool, and the Compute Engine API, which all expose the same instance records.
Isolating specific instances means using search and filter controls in an administrative interface to show only the instances that need review. In the VM instances page, the list shows the running instances in the selected project, and in backup workflows the onboarding wizard lists instances after a cloud credential, Project ID, and Zone are selected and Search is clicked. This project-to-zone-to-list flow ensures the displayed instances depend on both the credential scope and the selected location. For a large instance list, the appliance management console provides four status filters to isolate instances by protection state:
After filtering, selected instances can be onboarded, added to a logical group, added as unmanaged, or marked as ignored, and discovered instances are then found under App Manager and Applications.
Detailed metadata inspection means opening an instance record to verify its labels, network tags, disk configuration, and related settings against operational requirements. A Compute Engine instance record includes its machine type, network interfaces, IP settings, service accounts, labels, and tags, plus storage details. By default each instance has a small boot disk that contains the operating system, and additional disks can be added at creation time or while the instance is running. Each network interface of the instance is associated with a subnet of a unique Virtual Private Cloud (VPC) network, so network review connects the instance to its interface and then to the subnet and VPC network on the other side.
Metadata scope also controls access behavior. Public Secure Shell (SSH) keys stored in project metadata apply to all instances in that project, while SSH keys stored in instance metadata apply only to that individual instance. Labels require special care during copies, because when an instance copy is created with Create Machine Image or Create Similar, labels from the source instance are copied to the new instance and may not read correctly in the appliance management console.
Exam tip: Remove labels from a copied instance before onboarding it, because labels copied by Create Machine Image or Create Similar may not be read correctly.
Verifying instance details with administrative tools means using the console for visual inspection and gcloud for precise, repeatable queries. The console, gcloud, and REST API all access the same Compute Engine data, so an operator can start in the console and then confirm the same record from the command line. To inspect a single running virtual machine (VM) in the console, follow this ordered sequence:
To inspect the same instance from the command line, traffic flows from the gcloud compute instances describe command to the Compute Engine API, which returns the instance resource including its physical host topology (opens in a new tab) and configuration fields. Filtering can also narrow operational history, such as using gcloud compute operations list --filter="zone:(ZONE)" to list only operations in a specific zone. Together, console selection and filtered command-line queries let an administrator isolate the right instances first and then examine their full metadata for compliance.
gcloud compute instances list shows all VMs in a project with name, zone, status, machine type, and internal and external IP addresses, while gcloud compute instances describe VM_NAME returns complete details for one VM in YAML by default.gcloud compute instances list displays all virtual machine instances in the current project as a human-readable table with name, zone, status, machine type and internal and external IP addresses, while gcloud compute instances describe VM_NAME returns all data for one named virtual machine with YAML output by default. Use the list command first to discover instance names and check status across many virtual machines, then use describe after you have the exact name and need full configuration.
Open the VM instances page in the Google Cloud console for the correct project to view all current running Compute Engine instances, then click an instance name to open its details page and select the Observability tab. The Observability tab displays utilization metrics, throughput metrics and log data such as CPU, memory, network throughput and log activity for that instance and depends on Cloud Monitoring.
You can control which fields are shown and which instances are returned with flags that apply to the data returned from the Compute Engine API before it is displayed in the gcloud client. The --format flag selects the output shape and fields such as a table with name, zone, status, machine type and network interfaces or json, yaml and text, while the --filter flag returns only matching resources, the --limit flag sets the maximum number of results and the --sort-by flag orders results with a tilde prefix for descending order.
No, automatically created Cloud Monitoring dashboards cannot be modified or deleted directly. To change one, copy it into a custom dashboard first and then edit the copy by adding widgets, adding labels, resizing or deleting.
Your organization operates hundreds of Compute Engine virtual machine (VM) instances across multiple zones in a Google Cloud project. During an audit, you need to quickly locate all currently running instances that have the label environment=production to verify their disk configurations and network metadata.
Which command should you execute in Google Cloud CLI?
Last updated