Documentation ¶
Index ¶
- Constants
- func GetStoragePodMoList(ctx context.Context, client *vim25.Client, ...) ([]mo.StoragePod, error)
- func GetVMObject(ctx context.Context, conn *vclib.VSphereConnection, vmUUID string) (*vclib.VirtualMachine, error)
- func IsDevMode() bool
- func IsStoragePod(ctx context.Context, vmObj *vclib.VirtualMachine, name string) (bool, *object.StoragePod, error)
- func NewClient(cfg *VSphereConfig, conn *vclib.VSphereConnection, storeParams *store.Params, ...) (cloudops.Ops, error)
- type VSphereConfig
- type VSphereInstance
- type VirtualCenterConfig
- type VirtualDisk
Constants ¶
const ( // DiskAttachMode for attaching vmdk to vms // persistent, independent-persistent, independent-persistent DiskAttachMode = "DiskAttachMode" DiskSCSIPrefix = "wwn-0x" VCenterEnvKey = "VSPHERE_VCENTER" VCenterPortEnvKey = "VSPHERE_VCENTER_PORT" UserEnvKey = "VSPHERE_USER" PasswordEnvKey = "VSPHERE_PASSWORD" InsecureEnvKey = "VSPHERE_INSECURE" // for tests VMUUIDEnvKey = "VSPHERE_VM_UUID" TestDatastoreEnvKey = "VSPHERE_TEST_DATASTORE" )
Variables ¶
This section is empty.
Functions ¶
func GetStoragePodMoList ¶
func GetStoragePodMoList( ctx context.Context, client *vim25.Client, storagePodRefs []types.ManagedObjectReference, properties []string) ([]mo.StoragePod, error)
GetStoragePodMoList fetches the managed storage pod objects for the given references
Only the properties is the given property list will be populated in the response
func GetVMObject ¶
func GetVMObject(ctx context.Context, conn *vclib.VSphereConnection, vmUUID string) (*vclib.VirtualMachine, error)
GetVMObject fetches the VirtualMachine object corresponding to the given virtual machine uuid
func IsDevMode ¶
func IsDevMode() bool
IsDevMode checks if requirement env variables are set to run the pkg outside vsphere in dev mode
func IsStoragePod ¶
func IsStoragePod(ctx context.Context, vmObj *vclib.VirtualMachine, name string) (bool, *object.StoragePod, error)
IsStoragePod checks if the object with given name is a StoragePod (Datastore cluster)
Types ¶
type VSphereConfig ¶
type VSphereConfig struct { // User is the vCenter username. User string // Password is the vCenter password in clear text. Password string // VCenterIP is the vcenter IP to connect on VCenterIP string // VCenterPort is the vcenter port to connect on VCenterPort string // InsecureFlag True if vCenter uses self-signed cert. InsecureFlag bool // RoundTripperCount is the Soap round tripper count (retries = RoundTripper - 1) RoundTripperCount uint // VMUUID is the VM Instance UUID of virtual machine which can be retrieved from instanceUuid // property in VmConfigInfo, or also set as vc.uuid in VMX file. // If not set, will be fetched from the machine via sysfs (requires root) VMUUID string }
VSphereConfig represents the vsphere configuration derived from https://github.com/kubernetes/kubernetes/blob/release-1.9/pkg/cloudprovider/providers/vsphere/vsphere_util.go#L94
func ReadVSphereConfigFromEnv ¶
func ReadVSphereConfigFromEnv() (*VSphereConfig, error)
ReadVSphereConfigFromEnv sources vsphere config from well known environment variables
type VSphereInstance ¶
type VSphereInstance struct {
// contains filtered or unexported fields
}
VSphereInstance Represents a vSphere instance where one or more kubernetes nodes are running.
type VirtualCenterConfig ¶
type VirtualCenterConfig struct { // vCenter username. User string // vCenter password in clear text. Password string // vCenter port VCenterPort string // Datacenter in which VMs are located. Datacenter string // Soap round tripper count (retries = RoundTripper - 1) RoundTripperCount uint }
VirtualCenterConfig represents Virtual Center configuration
type VirtualDisk ¶
type VirtualDisk struct { diskmanagers.VirtualDisk // DatastoreRef is the managed object reference of the datastore on which the disk belongs DatastoreRef types.ManagedObjectReference }
VirtualDisk encapsulates the existing virtual disk object to add a managed object reference to the datastore of the disk