Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Can't enable Enhanced PMU mode on my C4 Compute Engine Machine

Hi,

I need to enable Enhanced mode of the PMU on my C4, as some counters are not available in Normal mode. According to this article https://cloud.google.com/compute/docs/enable-pmu-in-vms, I need to add to json file:

advancedMachineFeatures:
  performanceMonitoringUnit:Enhanced

And then update-from-file. However, I get the following error
ERROR: (gcloud.compute.instances.update-from-file) Could not fetch resource:
- Invalid value for field 'resource.advancedMachineFeatures.performanceMonitoringUnit': 'ENHANCED'. Invalid performance monitoring unit.

System is running hpc-rocky-linux-8-v20250508

0 1 38
1 REPLY 1

Hi @LowLevel

Welcome to Google Cloud Community! 

Fix the JSON/YAML Configuration
Check for YAML Parsing Issues: As noted in the GCP documentation, avoid YAML parsing errors by ensuring label values like yes or no in the file are enclosed in single quotes (e.g., 'yes').
For example:

labels:
  some-label: 'yes'

Update the VM
Apply the updated configuration and restart the VM:

gcloud compute instances update-from-file [VM_NAME] \
    --most-disruptive-allowed-action=RESTART \
    --source=[YAML_FILE] \
    --zone=[ZONE]

If updating the existing VM continues to fail, create a new VM with Enhanced PMU enabled from the start to avoid configuration issues.
Create a New VM with Enhanced PMU

gcloud compute instances create sample \
    --machine-type=sample \
    --performance-monitoring-unit=sample \
    --zone=sample \
    --create-disk=auto-delete=sample,boot=sample,device-name=sample,image=sample,mode=sample,provisioned-iops=sample,provisioned-throughput=sample,size=sample,type=sample

Verify PMU is Enabled
After updating or creating the VM, confirm that Enhanced PMU is enabled:

gcloud compute instances describe [VM_NAME] --zone=[ZONE] --format='value(advancedMachineFeatures.performanceMonitoringUnit)'

For more information you may check the following documentation: 

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.