-
Notifications
You must be signed in to change notification settings - Fork 927
Add PodVMInfo type and method #3850
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
base: main
Are you sure you want to change the base?
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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"` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
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?
=== RUN TestPodVMInfo
--- PASS: TestPodVMInfo (0.69s)
--- PASS: TestSetOverheadVMODLProperty (0.20s)
PASS