If an Organization VDC using Flex Allocation Model is showing an unexpected value for CPU allocation used in the VMware Cloud Director UI, review the VMs within the Organization VDC and confirm if they are using custom VM Sizing Policies.
To verify if a VM Sizing Policy has a custom vCPU Speed defined view the VM Sizing Policy in the Cloud Director Provider portal in Resources, Cloud Resources, VM Sizing Policies, VM Sizing Policy, CPU, vCPU Speed.
Workaround:
To verify what vCPU speed Virtual Machines in an Organization VDC are using, it is also possible to query the Cloud Director Database.
- Connect to the VCD Database:
- SSH to the Primary Cell and log in with root credentials (if running on an Appliance-based environment).
- Run the following command to connect to the Database:
sudo -i -u postgres psql vcloud
- Run the following query from the Database using the Organization VDC name <ORG_VDC_NAME> we wish to check:
SELECT
vapp_vm.name as vapp_vm_name,
vdc_compute_policy.name as compute_policy_name,
vapp_vm.is_compute_policy_compliant,
vapp_vm.vcpu_speed_mhz as vapp_vm_vcpu_speed,
vrp.vcpu_mhz as org_vdc_default_vcpu_speed,
vm_inv.vcpu_count,
CASE
WHEN vrp.allocation_model = 3 THEN (vm_inv.vcpu_count * COALESCE(vapp_vm.vcpu_speed_mhz, vrp.vcpu_mhz))
ELSE 0
END AS cpu_used_mhz,
(vm_inv.cpu_reservation) AS cpu_res_used_mhz
FROM config, computevm
JOIN vrp ON vrp.id = computevm.vrp_id
JOIN vrp_rp ON vrp.id = vrp_rp.vrp_id
JOIN vm_inv ON computevm.vc_id = vm_inv.vc_id AND computevm.vmmoref::text = vm_inv.moref::text AND (vm_inv.state = 1 OR computevm.deployment_status::text = 'DEPLOYED'::text OR computevm.deployment_status::text = 'PENDING_DEPLOYMENT'::text)
JOIN vapp_vm ON vapp_vm.cvm_id = computevm.id
JOIN resource_pool_inv ON vrp_rp.sub_rp_vc_id = resource_pool_inv.vc_id AND vrp_rp.sub_rp_moref::text = resource_pool_inv.moref::text
JOIN vdc_logical_resource ON vdc_logical_resource.fo_id = vrp.id
JOIN org_prov_vdc ON org_prov_vdc.id = vdc_logical_resource.vdc_id
JOIN vdc_compute_policy ON vdc_compute_policy.id = vapp_vm.vdc_compute_policy_id
WHERE vrp.allocation_model <> 2 AND config.cat::text = 'vcloud'::text AND config.name::text = 'compute.allocationpool.elastic'::text AND vm_inv.resource_pool_moref::text = resource_pool_inv.moref::text
AND org_prov_vdc.name = '<ORG_VDC_NAME>'
ORDER BY vapp_vm.vcpu_speed_mhz;
- The output will provide a list of Powered On Virtual Machines along with their vCPU speed (vapp_vm_vcpu_speed) and their number of vCPUs (vcpu_count). It is normal for the vapp_vm_vcpu_speed and org_vdc_default_vcpu_speed in the output to be different ONLY if the VM has a VM Sizing Policy attached which has a custom vCPU Speed defined.
- If it is suspected that the vCPU speed differs from what a Virtual Machine should be using, follow the below steps to reset the Virtual Machine's vCPU speed:
- From the Cloud Director Tenant portal, navigate to the Virtual Machine which is utilizing an incorrect vCPU speed.
- Go to Compute.
- Click Edit to review the current compute settings and ensure they are correct.
- After ensuring the compute settings are correct click Save to have Cloud Director re-apply the settings on the VM. If the vCPU speed was incorrect Cloud Director should now correct it.