Skip to content

Conversation

rohith05
Copy link

@rohith05 rohith05 commented Sep 2, 2025

Description

This patch adds support to PodVMInfo VMODL APIs under HostRuntimeInfo which includes hasPodVM and podVMOverheadInfo properties. In addition this patch also adds UpdatePodVMProperty method under HostSystem. The PodVMInfo property and method will be updated by ESXi host and will be consumed by DRS to determine PodVM placement. The change also includes a unit test that tests the setting of PodVMInfo property.

Note: PodVMOverheadInfo that is currently exposed as part of HostCapability will be removed
as a follow-up change, once existing consumers have moved away from it.

Closes: VMKUW-2865

How Has This Been Tested?

  • make test:
    === RUN TestPodVMInfo
    --- PASS: TestPodVMInfo (0.69s)
  • Verified UpdatePodVMProperty() method from ESXi:
    --- PASS: TestSetOverheadVMODLProperty (0.20s)
    PASS

This patch adds support to PodVMInfo VMODL APIs under HostRuntimeInfo which
includes hasPodVM and podVMOverheadInfo properties. In addition this patch
also adds UpdatePodVMProperty method under HostSystem. The PodVMInfo property
and method will be updated by ESXi host and will be consumed by DRS to
determine PodVM placement. The change also includes a unit test that tests
the setting of PodVMInfo property.

Testing:
- make test:
  === RUN   TestPodVMInfo
  --- PASS: TestPodVMInfo (0.69s)
- Verified UpdatePodVMProperty() method from ESXi:
  --- PASS: TestSetOverheadVMODLProperty (0.20s)
  PASS
Copy link
Member

@akutz akutz left a comment

Choose a reason for hiding this comment

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

@rohith05 ,

I'm not sure we can support this change in the public repo as you've updated a generated type that will be wiped once the types are regenerated. You may need to make this change in the internal GoVmomi mirror.

PropertyPath: propertyPath,
}

if propertyPath == "podVMOverheadInfo" {
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a good use for a switch statement instead of so many if/elses.

return fmt.Errorf("unsupported propertyPath: %s", propertyPath)
}

_, err := methods.UpdatePodVMProperty(ctx, h.c, &req)
Copy link
Member

Choose a reason for hiding this comment

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

Rewrite as:

_, err := methods.UpdatePodVMProperty(ctx, h.c, &req)
return err

@@ -44786,6 +44786,8 @@ type HostRuntimeInfo struct {
PartialMaintenanceMode []HostPartialMaintenanceModeRuntimeInfo `xml:"partialMaintenanceMode,omitempty" json:"partialMaintenanceMode,omitempty" vim:"8.0.3.0"`
// Host persistent state encryption information.
StateEncryption *HostRuntimeInfoStateEncryptionInfo `xml:"stateEncryption,omitempty" json:"stateEncryption,omitempty" vim:"7.0.3.0"`
// PodVM related info for a host
PodVMInfo *HostRuntimeInfoPodVMInfo `xml:"podVMInfo,omitempty" json:"podVMInfo,omitempty" vim:"9.0.0.0"`
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, you have updated a generated type. I'm not sure we can support this.

Copy link
Author

Choose a reason for hiding this comment

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

This type is already part of HostRuntime VMODL (on main/9.1). Does that mean when HostRuntime is regenerated this property (PodVMInfo) will be re-added ?

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

Successfully merging this pull request may close these issues.

2 participants