You are troubleshooting an unresponsive Linux Compute Engine virtual machine instance that is failing to accept SSH connections. You need to view the raw system console boot logs to identify why the startup process halted. Which gcloud command should you run to inspect these logs?
- gcloud compute instances get-serial-port-output [INSTANCE_NAME]Answer
- Bgcloud compute instances describe [INSTANCE_NAME]
- Cgcloud compute instances reset [INSTANCE_NAME] --show-logs
- Dgcloud logging read "resource.type=gce_instance" --limit=1
Answer
The command 'gcloud compute instances get-serial-port-output [INSTANCE_NAME]' is the correct choice because it retrieves the serial port output (console log) of a Compute Engine instance, enabling administrators to diagnose boot errors when SSH is inaccessible.
The command 'gcloud compute instances get-serial-port-output [INSTANCE_NAME]' directly reads the serial port output of the specified instance. This is the Google-recommended approach for troubleshooting VM startup failures, kernel panics, or SSH connectivity issues.
Step-by-Step Solution
Key Concept
Inspecting VM Serial Console Output for Diagnostics