我初始化了一个go客户端以连接到vCenter,如下所示。我正在尝试使用客户端获取vCenter的版本。我没有为这个找到一个很好的来源。
在retrieve()应用程序接口中使用哪些参数来获取与vCenter集群相关的版本和其他信息?
import (
"context"
"fmt"
"net/url"
"github.com/vmware/govmomi"
)
func main() {
vURL := url.URL{
Scheme: "https",
Host: "10.30.8.34",
Path: "sdk",
}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
client, err := govmomi.NewClient(ctx, vURL, true)
if err != nil {
fmt.Printf("Logging in error: %s\n", err.Error())
return
}
fmt.Println("Log in successful")
client.Logout(ctx)
}发布于 2021-08-12 20:37:52
你在找VsanHostConfigInfoEx吗?
type VsanHostConfigInfoEx struct {
types.VsanHostConfigInfo
EncryptionInfo *VsanHostEncryptionInfo `xml:"encryptionInfo,omitempty"`
DataEfficiencyInfo *VsanDataEfficiencyConfig `xml:"dataEfficiencyInfo,omitempty"`
ResyncIopsLimitInfo *ResyncIopsInfo `xml:"resyncIopsLimitInfo,omitempty"`
ExtendedConfig *VsanExtendedConfig `xml:"extendedConfig,omitempty"`
DatastoreInfo BaseVsanDatastoreConfig `xml:"datastoreInfo,omitempty,typeattr"`
UnmapConfig *VsanUnmapConfig `xml:"unmapConfig,omitempty"`
WitnessHostConfig []VsanWitnessHostConfig `xml:"witnessHostConfig,omitempty"`
InternalExtendedConfig *VsanInternalExtendedConfig `xml:"internalExtendedConfig,omitempty"`
MetricsConfig *VsanMetricsConfig `xml:"metricsConfig,omitempty"`
UnicastConfig *VsanHostServerClusterUnicastConfig `xml:"unicastConfig,omitempty"`
DataInTransitEncryptionInfo *VsanInTransitEncryptionInfo `xml:"dataInTransitEncryptionInfo,omitempty"`
}它实现了VsanHostConfigInfo
type VsanHostConfigInfo struct {
DynamicData
Enabled *bool `xml:"enabled"`
HostSystem *ManagedObjectReference `xml:"hostSystem,omitempty"`
ClusterInfo *VsanHostConfigInfoClusterInfo `xml:"clusterInfo,omitempty"`
StorageInfo *VsanHostConfigInfoStorageInfo `xml:"storageInfo,omitempty"`
NetworkInfo *VsanHostConfigInfoNetworkInfo `xml:"networkInfo,omitempty"`
FaultDomainInfo *VsanHostFaultDomainInfo `xml:"faultDomainInfo,omitempty"`
}https://stackoverflow.com/questions/66770324
复制相似问题