To view the number of visible CPU cores, use the gcloud CLI or the Compute Engine API.
gcloud
Get information about the VM by using the following
gcloud beta compute instances describe
command.gcloud compute instances describe VM_NAME \ --zone=ZONE
Replace the following:
VM_NAME
: the name of the VMZONE
: the zone that contains the VM
The value of
visible-core-count
in the output is the number of visible CPU cores.
API
Get information about the VM by using the following
instances.get
method.GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME
Replace the following:
PROJECT_ID
: the ID of the projectZONE
: the zone that contains the VMVM_NAME
: the name of the VM
The value of
visibleCoreCount
in the output is the number of visible CPU cores.