From 6a0d7e7da219add48e61516e34f25307f4fee259 Mon Sep 17 00:00:00 2001 From: Vipul Kotkar Date: Fri, 3 May 2024 15:02:57 +0530 Subject: [PATCH] vcsim: Add PbmCheckCompatibility method in pbm simulator --- pbm/simulator/simulator.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pbm/simulator/simulator.go b/pbm/simulator/simulator.go index d230ea9d8..8f4b3fc30 100644 --- a/pbm/simulator/simulator.go +++ b/pbm/simulator/simulator.go @@ -242,3 +242,26 @@ func (m *PlacementSolver) PbmCheckRequirements(req *types.PbmCheckRequirements) return body } + +func (m *PlacementSolver) PbmCheckCompatibility(req *types.PbmCheckCompatibility) soap.HasFault { + body := new(methods.PbmCheckCompatibilityBody) + body.Res = new(types.PbmCheckCompatibilityResponse) + + for _, ds := range simulator.Map.All("Datastore") { + // TODO: filter + ref := ds.Reference() + body.Res.Returnval = append(body.Res.Returnval, types.PbmPlacementCompatibilityResult{ + Hub: types.PbmPlacementHub{ + HubType: ref.Type, + HubId: ref.Value, + }, + MatchingResources: nil, + HowMany: 0, + Utilization: nil, + Warning: nil, + Error: nil, + }) + } + + return body +}