Resolution:
- Currently, there is no fix available for this issue. It is planned to be addressed in the next release.
Workaround:
- You can run an API call on each VM to check for compliance with the new memory allocation policy.
- Use the following API to check if a VM is compliant with the policy:
POST https://<vcd-url>/api/vApp/vm-<id>/action/checkComputePolicyCompliance
- You will receive a prompt to make the VM compliant.
- Click "Make compliant", the compliance action will be successfully applied.
For large environments, writing an automation script will be the most efficient solution. To automate the process, follow these steps:
- Fetch the List of VMs:
- Query each VM to check for compliance by making the following API call:
POST https://<vcd-url>/api/vApp/vm-<id>/action/checkComputePolicyCompliance
- Check Compliance:
- For each VM, check the compliance status by looking for "checkComputePolicyCompliance" in the API response.
- If a VM is non-compliant, trigger the reapplyComputePolicy API to apply the policy:
POST https://<vcd-url>/api/vApp/vm-<vm-id>/action/reapplyComputePolicy
- After performing the POST request, respective VM users will start receiving the compliance alert.