Skip to content

Commit eb53c23

Browse files
committed
api: add PodVMOverheadInfo type and HostCapability field
Signed-off-by: Doug MacEachern <[email protected]>
1 parent d62c8e9 commit eb53c23

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

vim25/types/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35363,6 +35363,8 @@ type HostCapability struct {
3536335363
NpivSupported *bool `xml:"npivSupported" json:"npivSupported,omitempty" vim:"9.0.0.0"`
3536435364
// Indicates whether this host supports license entitlements
3536535365
EntitlementSupported *bool `xml:"entitlementSupported" json:"entitlementSupported,omitempty" vim:"9.0.0.0"`
35366+
// Contains the memory overhead info for PodVMs for this host.
35367+
PodVMOverheadInfo *PodVMOverheadInfo `xml:"podVMOverheadInfo" vim:"9.0.1.0"`
3536635368
}
3536735369

3536835370
func init() {

vim25/types/unreleased.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,13 @@ type ClusterClusterRelocatePlacementAction struct {
134134
func init() {
135135
t["ClusterClusterRelocatePlacementAction"] = reflect.TypeOf((*ClusterClusterRelocatePlacementAction)(nil)).Elem()
136136
}
137+
138+
func init() {
139+
Add("PodVMOverheadInfo", reflect.TypeOf((*PodVMOverheadInfo)(nil)).Elem())
140+
}
141+
142+
type PodVMOverheadInfo struct {
143+
CrxPageSharingSupported bool `xml:"crxPageSharingSupported"`
144+
PodVMOverheadWithoutPageSharing int32 `xml:"podVMOverheadWithoutPageSharing"`
145+
PodVMOverheadWithPageSharing int32 `xml:"podVMOverheadWithPageSharing"`
146+
}

vim25/types/unreleased_test.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// © Broadcom. All Rights Reserved.
2+
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
package types_test
6+
7+
import (
8+
"context"
9+
"testing"
10+
11+
"github.com/vmware/govmomi/property"
12+
"github.com/vmware/govmomi/simulator"
13+
"github.com/vmware/govmomi/vim25"
14+
"github.com/vmware/govmomi/vim25/mo"
15+
"github.com/vmware/govmomi/vim25/types"
16+
)
17+
18+
func TestPodVMOverheadInfo(t *testing.T) {
19+
simulator.Test(func(ctx context.Context, c *vim25.Client) {
20+
host := simulator.Map(ctx).Any("HostSystem").(*simulator.HostSystem)
21+
22+
host.Capability.PodVMOverheadInfo = &types.PodVMOverheadInfo{
23+
CrxPageSharingSupported: true,
24+
PodVMOverheadWithoutPageSharing: int32(42),
25+
PodVMOverheadWithPageSharing: int32(53),
26+
}
27+
28+
var props mo.HostSystem
29+
pc := property.DefaultCollector(c)
30+
err := pc.RetrieveOne(ctx, host.Self, []string{"capability"}, &props)
31+
if err != nil {
32+
t.Fatal(err)
33+
}
34+
35+
if *props.Capability.PodVMOverheadInfo != *host.Capability.PodVMOverheadInfo {
36+
t.Errorf("%#v", props.Capability.PodVMOverheadInfo)
37+
}
38+
})
39+
}

0 commit comments

Comments
 (0)