Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PbmCheckCompatibility method in pbm simulator #3431

Merged
merged 1 commit into from
May 4, 2024

Conversation

vdkotkar
Copy link
Contributor

@vdkotkar vdkotkar commented May 3, 2024

Description

Add PbmCheckCompatibility method in pbm simulator code similar to PbmCheckRequirements.
This simulator function is getting called from the vSphere CSI plugin unit tests. Without this function following error is observed.

“failed to find datastore compatibility with storage policy ID <storage-policy-ID>. Error: ServerFaultCode: PbmPlacementSolver:placementSolver does not implement: PbmCheckCompatibility”

Closes: #(issue-number)

Type of change

Please mark options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update
  • Build related change

How Has This Been Tested?

Unit tests in vSphere CSI plugin using Storage Policy were using workaround till now, so PbmCheckCompatibility function in simulator was not getting called. But to test the relevant code in CSI, we are planning to remove this workaround. So, we need to implement simulated function PbmCheckCompatibility.
After locally adding this code, unit tests are passing in CSI plugin.

  • Test Description 1
    1. Create new Storage Policy using pbm
    2. Pass newly created storage policy name to CreateVolume call through parameters
    3. Make sure that volume creation is successful and volume is using the correct storage policy.
  • Test Description 2

Checklist:

  • My code follows the CONTRIBUTION guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

@vmwclabot
Copy link
Member

@vdkotkar, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@vmwclabot
Copy link
Member

@vdkotkar, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

Copy link
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vdkotkar , lgtm. I added vcsim: prefix to the commit message for the CL generator. See: https://github.com/vmware/govmomi/blob/main/CONTRIBUTING.md#format-of-the-commit-message

@dougm dougm merged commit 9f380fe into vmware:main May 4, 2024
10 checks passed
@vmwclabot
Copy link
Member

@vdkotkar, your company's legal contact did not review your signed contributor license agreement within the 14 day limit. The merge can not proceed. Click here to resign the agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants