Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrAffinityRuleDupKey is raised when the name of the affinity rule // conflicts with another one in system that has already been enabled. ErrAffinityRuleDupKey = errors.New("name of affinity rule is duplicated") )
Functions ¶
Types ¶
type Querier ¶
type Querier interface { // GetHostFromVMID gets ESX server's hostname from VMID. GetHostFromVMID(vmid string) (string, error) // GetHostnameFromVMID gets the hostname of a virtual machine identified by // VMID. Empty string will be returned if it isn't found. GetHostnameFromVMID(hostname string) string // GetVMIDFromHostname gets the vSphere VMID from the virtual machine's // hostname. Empty string will be returned if it isn't found. GetVMIDFromHostname(vmid string) string }
Querier is a read-only interface for client to query vSphere.
VMID: unique reference id inside vSphere to represent VM as a managed object.
It's a string that looks like this: "VirtualMachine:vm-1".
type Vsphere ¶
type Vsphere interface { // Apply affinity rule to a list of vms so that DRS will schedule them on the // same host ApplyAffinityRule(name string, vms ...string) error // Apply anti-affinity rule to a list of vms so that DRS will schedule them on // different hosts ApplyAntiAffinityRule(name string, vms ...string) error // DeleteAffinityRule deletes an affinity rule DeleteAffinityRule(name string) error // DeleteAntiAffinityRule deletes an anti-affinity rule DeleteAntiAffinityRule(name string) error // Rules returns the applied VM-to-VM affinity and anti-affinity rules Rules() map[string]Rule // Logout signs off the session Logout() // Client returns the govmomi client Client() *govmomi.Client Querier }
Vsphere is the vSphere client to talk to vSphere
func NewCachedClient ¶
NewCachedClient creates a cached vsphere client.
Click to show internal directories.
Click to hide internal directories.