vSAN Storage Policy Compliance Errors with pbmUpdate API for VMware vSAN
search cancel

vSAN Storage Policy Compliance Errors with pbmUpdate API for VMware vSAN

book

Article ID: 453819

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This article provides resolution steps for compliance errors occurring when using the pbmUpdate API to modify vSAN storage policies. If automation / workflows encounter datastore incompatibility or virtual machine compliance issues after attempting to set the datastoreSpaceEfficiency constraint to "No preference," follow the steps below to correct the API request.

Environment

  • VMware vSAN

Cause

The vSAN datastoreSpaceEfficiency capability does not recognize "No preference" as a valid string value. When an automation workflow explicitly includes this string as a constraint in the API request, it triggers a compliance failure because the system treats it as an invalid configuration. The only strictly allowed constraint values are:

  • DedupAndCompression
  • CompressionOnly
  • NoSpaceEfficiency

Resolution

To successfully apply a "No preference" state using the pbmUpdate API, the automation workflow must be modified:

  1. Identify the API request structure for the storage policy update.
  2. Locate the datastoreSpaceEfficiency constraint within the data service capability settings.
  3. Modify the script to completely omit the datastoreSpaceEfficiency constraint from the API request rather than providing a string value.
  4. Execute the updated API request.
  5. Verify the policy status in the vSphere Client to confirm the datastore is compatible and the storage policy compliance is met.

Additional Information

pbmUpdate API reference documentation:

https://developer.broadcom.com/xapis/vmware-storage-policy-api/latest/pbm.profile.ProfileManager.html#update