Send feedback
View the number of visible CPU cores
Stay organized with collections
Save and categorize content based on your preferences.
Linux
Windows
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 gcloud compute
instances describe
command .
gcloud compute instances describe VM_NAME \
--zone=ZONE
Replace the following:
In the output, the value of the visible-core-count
field is the number
of visible CPU cores. If the visible-core-count
field doesn't appear
in the output, then the VM has the
default number of visible CPU cores .
REST
Get information about the VM by using the following instances.get
method .
GET http://compute.googleapis.com/compute/v1/projects/PROJECT_ID /zones/ZONE /instances/VM_NAME
Replace the following:
PROJECT_ID
: the ID of the project
ZONE
: the zone that contains the VM
VM_NAME
: the name of the VM
In the output, the value of the visibleCoreCount
field is the number
of visible CPU cores.
What's next
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-12 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?