vsphere

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VCENTER_ADDR             = "VCENTER_ADDR"
	VCENTER_USER             = "VCENTER_USER"
	VCENTER_PASSWORD         = "VCENTER_PASSWORD"
	VCENTER_CONSOLE_USER     = "VCENTER_CONSOLE_USER"
	VCENTER_CONSOLE_PASSWORD = "VCENTER_CONSOLE_PASSWORD"
	VCENTER_INSECURE         = "VCENTER_INSECURE"
)
View Source
const PortDoesNotExist = "Port does not exist"
View Source
const PortGrpMatchAny = "*"
View Source
const TagAlreadyExists = "ALREADY_EXISTS"
View Source
const TagFieldCidr = "cidr"
View Source
const TagFieldDomain = "domain"
View Source
const TagFieldFlavor = "flavor"
View Source
const TagFieldGroup = "group"
View Source
const TagFieldIp = "ip"
View Source
const TagFieldNetName = "netname"
View Source
const TagFieldRole = "role"
View Source
const TagFieldSubnetName = "subnetname"
View Source
const TagFieldVlan = "vlan"
View Source
const TagFieldVmName = "vmname"
View Source
const TagNotFound = "tag not found"
View Source
const VLAN_START uint32 = 1000
View Source
const VMMatchAny = "*"

Variables

View Source
var AccessVarProps = map[string]*edgeproto.PropertyInfo{
	VCENTER_ADDR: {
		Name:      "VCenter API URL",
		Mandatory: true,
	},
	VCENTER_USER: {
		Name:      "VCenter user name",
		Mandatory: true,
	},
	VCENTER_PASSWORD: {
		Name:      "VCenter user password",
		Mandatory: true,
	},
	VCENTER_CONSOLE_USER: {
		Name: "VCenter console user name",
	},
	VCENTER_CONSOLE_PASSWORD: {
		Name: "VCenter console user password",
	},
	VCENTER_INSECURE: {
		Name:        "VCenter insecure mode",
		Description: "VCenter insecure mode defaults to false, set to \"true\" to disable TLS cert validation",
	},
}
View Source
var VSphereProps = map[string]*edgeproto.PropertyInfo{

	"MEX_COMPUTE_CLUSTER": {
		Name:        "vSphere Compute Cluster Name",
		Description: "vSphere Compute Cluster Name",
		Value:       "compute-cluster",
	},
	"MEX_MANAGEMENT_CLUSTER": {
		Name:        "vSphere Management Cluster Name",
		Description: "Optional vSphere Management Cluster Name for platform VMs; if not specified, platform VMs run on the same cluster as compute VMs",
	},
	"MEX_DATASTORE": {
		Name:        "vSphere Datastore Name",
		Description: "vSphere Datastore Name",
		Mandatory:   true,
	},
	"MEX_MANAGEMENT_DATASTORE": {
		Name:        "vSphere Management Datastore Name",
		Description: "Optional vSphere Management Datastore Name for platform VMs; if not specified, platform VMs run on the same datastore as compute VMs",
	},
	"MEX_EXTERNAL_IP_RANGES": {
		Name:        "External IP Ranges",
		Description: "Range of external IP addresses, Format: StartCIDR-EndCIDR",
		Mandatory:   true,
	},
	"MEX_MANAGEMENT_EXTERNAL_IP_RANGES": {
		Name:        "Management External IP Ranges",
		Description: "Optional Range of external IP addresses for management cluster; if not specified, platform VMs use same IP range as compute VMs.",
	},
	"MEX_EXTERNAL_NETWORK_GATEWAY": {
		Name:        "External Network Gateway",
		Description: "External Network Gateway",
		Mandatory:   true,
	},
	"MEX_MANAGEMENT_EXTERNAL_NETWORK_GATEWAY": {
		Name:        "Management External Network Gateway",
		Description: "Optional External Network Gateway for management cluster; if not specified, platform VMs use same gateway as compute VMs",
	},
	"MEX_EXTERNAL_NETWORK_MASK": {
		Name:        "External Network Mask",
		Description: "External Network Mask",
		Mandatory:   true,
	},
	"MEX_MANAGEMENT_EXTERNAL_NETWORK_MASK": {
		Name:        "Management External Network Mask",
		Description: "Optional External Network Mask for manangement cluster; if not specified, platform VMs use same netmask as compute VMs",
	},
	"MEX_INTERNAL_NETWORK_MASK": {
		Name:        "Internal Network Mask",
		Description: "Internal Network Mask in bits, e.g. 24",
		Value:       "24",
	},
	"MEX_EXTERNAL_VSWITCH": {
		Name:        "vSphere External vSwitch Name",
		Description: "vSphere External vSwitch Name",
		Mandatory:   true,
	},
	"MEX_MANAGEMENT_EXTERNAL_VSWITCH": {
		Name:        "vSphere Management External vSwitch Name",
		Description: "Optional vSphere External vSwitch Name for management cluster; if not specified, platform VMs use same external vSwitch as compute VMs",
	},
	"MEX_INTERNAL_VSWITCH": {
		Name:        "vSphere Internal vSwitch Name",
		Description: "vSphere Internal vSwitch Name",
		Mandatory:   true,
	},
	"MEX_TEMPLATE_FOLDER": {
		Name:        "vSphere Template Folder Name",
		Description: "vSphere Template Folder Name",
		Value:       "templates",
	},

	"MEX_VM_VERSION": {
		Name:        "vSphere VM Version",
		Description: "vSphere VM Compatibility Version, e.g. 6.7 or 7.0",
		Value:       "6.7",
	},
}

Functions

func NewPlatform

func NewPlatform() platform.Platform

Types

type DPGNetwork

type DPGNetwork struct {
	Type  string
	Value string
}

type DeployScriptParams

type DeployScriptParams struct {
	DataCenterName string
	DataStoreName  string
	Cluster        string
	ResourcePool   string
	VMName         string
	Network        string
	Gateway        string
	Netmask        string
	Tags           *[]vmlayer.TagOrchestrationParams
	VM             *vmlayer.VMOrchestrationParams
	EnvVars        *map[string]string
}

type DistributedPortGroup

type DistributedPortGroup struct {
	Name    string
	Network DPGNetwork
	Path    string
}

type GovcDatastore

type GovcDatastore struct {
	Summary GovcDatastoreSummary
}

type GovcDatastoreInfo

type GovcDatastoreInfo struct {
	Datastores []GovcDatastore
}

type GovcDatastoreSummary

type GovcDatastoreSummary struct {
	Capacity  uint64
	FreeSpace uint64
}

type GovcDeviceBacking

type GovcDeviceBacking struct {
	Port GovcDeviceBackingPort
}

type GovcDeviceBackingPort

type GovcDeviceBackingPort struct {
	PortgroupKey string
}

type GovcHost

type GovcHost struct {
	Hardware GovcHostHardware
}

type GovcHostCpuInfo

type GovcHostCpuInfo struct {
	NumCpuCores   uint64
	NumCpuThreads uint64
}

type GovcHostHardware

type GovcHostHardware struct {
	CpuInfo    GovcHostCpuInfo
	MemorySize uint64
}

type GovcHosts

type GovcHosts struct {
	HostSystems []GovcHost
}

type GovcMetricSample

type GovcMetricSample struct {
	SampleInfo []GovcMetricSampleInfo
	Value      []GovcMetricSampleValue
}

type GovcMetricSampleInfo

type GovcMetricSampleInfo struct {
	Interval  uint64
	Timestamp string
}

type GovcMetricSampleValue

type GovcMetricSampleValue struct {
	Instance string
	Name     string
	Value    []uint64
}

type GovcMetricSamples

type GovcMetricSamples struct {
	Sample []GovcMetricSample
}

type GovcNetwork

type GovcNetwork struct {
	Type  string
	Value string
}

type GovcNetworkElement

type GovcNetworkElement struct {
	Object GovcNetworkObject
}

type GovcNetworkElementSummary

type GovcNetworkElementSummary struct {
	Name    string
	Network GovcNetwork
}

type GovcNetworkObject

type GovcNetworkObject struct {
	Summary GovcNetworkElementSummary
}

type GovcNetworkObjects

type GovcNetworkObjects struct {
	Elements []GovcNetworkElement `json:"elements"`
}

type GovcPool

type GovcPool struct {
	Name    string
	Path    string
	Runtime GovcPoolRuntime
}

type GovcPoolRuntime

type GovcPoolRuntime struct {
	Memory GovcResourceInfo
	Cpu    GovcResourceInfo
}

type GovcPools

type GovcPools struct {
	ResourcePools []GovcPool
}

type GovcResourceInfo

type GovcResourceInfo struct {
	MaxUsage     uint64
	OverallUsage uint64
}

type GovcRuntime

type GovcRuntime struct {
	PowerState string
}

type GovcTag

type GovcTag struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	Category string `json:"category_id"`
}

type GovcTagCategory

type GovcTagCategory struct {
	Name string `json:"name"`
}

type GovcVM

type GovcVM struct {
	Name     string
	Runtime  GovcRuntime
	Config   GovcVMConfig
	Guest    GovcVMGuest
	Path     string
	LayoutEx GovcVMLayout
}

type GovcVMConfig

type GovcVMConfig struct {
	Hardware GovcVMHardware
}

type GovcVMDevice

type GovcVMDevice struct {
	Name string
	Type string
}

type GovcVMDeviceList

type GovcVMDeviceList struct {
	Devices []GovcVMDevice
}

type GovcVMFile

type GovcVMFile struct {
	Name string
	Size uint64
}

type GovcVMGuest

type GovcVMGuest struct {
	GuestState  string
	ToolsStatus string
	Net         []GovcVMNet
}

type GovcVMHardware

type GovcVMHardware struct {
	MemoryMB uint64
	NumCPU   uint64
	Device   []GovcVMHardwareDevice
}

type GovcVMHardwareDevice

type GovcVMHardwareDevice struct {
	Backing    GovcDeviceBacking
	MacAddress string
}

type GovcVMLayout

type GovcVMLayout struct {
	File []GovcVMFile
}

type GovcVMNet

type GovcVMNet struct {
	IpAddress  []string
	MacAddress string
	Network    string
}

type GovcVMs

type GovcVMs struct {
	VirtualMachines []GovcVM
}

type MetricsCollectionRequestType

type MetricsCollectionRequestType struct {
	CollectNetworkStats bool
	CollectCPUStats     bool
	CollectMemStats     bool
}

type MetricsResult

type MetricsResult struct {
	BytesTxAverage  uint64
	BytesRxAverage  uint64
	CpuUsagePercent float64
	MemUsageBytes   uint64
	DiskUsageBytes  uint64
	Interval        uint64
	Timestamp       string
}

type SubnetTagContents

type SubnetTagContents struct {
	SubnetName string
	Cidr       string
	Vlan       uint32
	Domain     string
}

type VMDomainTagContents

type VMDomainTagContents struct {
	Vmname string
	Domain string
	Role   string
	Flavor string
}

type VMIpTagContents

type VMIpTagContents struct {
	Vmname  string
	Network string
	Ipaddr  string
	Domain  string
}

type VSpherePlatform

type VSpherePlatform struct {
	TestMode bool
	// contains filtered or unexported fields
}

func (VSpherePlatform) ActiveChanged

func (s VSpherePlatform) ActiveChanged(ctx context.Context, platformActive bool) error

func (*VSpherePlatform) AddImageIfNotPresent

func (v *VSpherePlatform) AddImageIfNotPresent(ctx context.Context, imageInfo *infracommon.ImageInfo, updateCallback edgeproto.CacheUpdateCallback) error

func (*VSpherePlatform) AttachPortToServer

func (v *VSpherePlatform) AttachPortToServer(ctx context.Context, serverName string, subnetNames vmlayer.SubnetNames, portName string, ips infracommon.IPs, action vmlayer.ActionType) error

AttachPortToServer adds a port to the server with the given ipaddr

func (*VSpherePlatform) CheckServerReady

func (s *VSpherePlatform) CheckServerReady(ctx context.Context, client ssh.Client, serverName string) error

func (*VSpherePlatform) ConfigureCloudletSecurityRules

func (v *VSpherePlatform) ConfigureCloudletSecurityRules(ctx context.Context, egressRestricted bool, TrustPolicy *edgeproto.TrustPolicy, rootlbClients map[string]platform.RootLBClient, action vmlayer.ActionType, updateCallback edgeproto.CacheUpdateCallback) error

func (*VSpherePlatform) ConfigureTrustPolicyExceptionSecurityRules

func (o *VSpherePlatform) ConfigureTrustPolicyExceptionSecurityRules(ctx context.Context, TrustPolicyException *edgeproto.TrustPolicyException, rootLbClients map[string]platform.RootLBClient, action vmlayer.ActionType, updateCallback edgeproto.CacheUpdateCallback) error

func (*VSpherePlatform) ConnectNetworksForVM

func (v *VSpherePlatform) ConnectNetworksForVM(ctx context.Context, vmName string) error

func (*VSpherePlatform) CreateImageFromUrl

func (v *VSpherePlatform) CreateImageFromUrl(ctx context.Context, imageName, imageUrl, md5Sum string, diskSize uint64) error

CreateImageFromUrl downloads image from URL and then imports to the datastore

func (*VSpherePlatform) CreatePool

func (v *VSpherePlatform) CreatePool(ctx context.Context, poolName string) error

CreatePool creates a resource pool

func (*VSpherePlatform) CreatePortGroup

func (v *VSpherePlatform) CreatePortGroup(ctx context.Context, dvs string, pgName string, vlan uint32) error

CreatePortGroup creates a portgroup on a DVS for a particular VLAN. Since Govc does not currently support deleting port groups, we use a generic name "VLAN-x" and re-use the port groups when subnets are deleted/added

func (*VSpherePlatform) CreateTag

func (*VSpherePlatform) CreateTagCategories

func (v *VSpherePlatform) CreateTagCategories(ctx context.Context) error

func (*VSpherePlatform) CreateTagCategory

func (v *VSpherePlatform) CreateTagCategory(ctx context.Context, category string) error

func (*VSpherePlatform) CreateTemplateFolder

func (v *VSpherePlatform) CreateTemplateFolder(ctx context.Context) error

func (*VSpherePlatform) CreateTemplateFromImage

func (v *VSpherePlatform) CreateTemplateFromImage(ctx context.Context, imageFolder string, imageFile string) error

CreateTemplateFromImage creates a vm template from the image file

func (*VSpherePlatform) CreateVM

func (v *VSpherePlatform) CreateVM(ctx context.Context, vm *vmlayer.VMOrchestrationParams, poolName string) error

CreateVM create a VM in the given pool

func (*VSpherePlatform) CreateVMs

func (*VSpherePlatform) DeleteImage

func (v *VSpherePlatform) DeleteImage(ctx context.Context, folder, image string) error

DeleteImage deletes the image folder and any contents from the datastore

func (*VSpherePlatform) DeletePool

func (v *VSpherePlatform) DeletePool(ctx context.Context, poolName string) error

DeletePool deletes a resource pool

func (*VSpherePlatform) DeleteResourcesForGroup

func (v *VSpherePlatform) DeleteResourcesForGroup(ctx context.Context, groupName string) error

DeleteResourcesForGroup deletes all VMs, tags, and pools for a given resource group

func (*VSpherePlatform) DeleteTag

func (v *VSpherePlatform) DeleteTag(ctx context.Context, tagname string) error

func (*VSpherePlatform) DeleteVM

func (v *VSpherePlatform) DeleteVM(ctx context.Context, vmName string) error

func (*VSpherePlatform) DeleteVMAndTags

func (v *VSpherePlatform) DeleteVMAndTags(ctx context.Context, vmName string) error

DeleteVMAndTags deletes VM and any tags associated with it. This is used for deleting a single VM from a group without deleting the group

func (*VSpherePlatform) DeleteVMs

func (v *VSpherePlatform) DeleteVMs(ctx context.Context, vmGroupName, ownerID string) error

func (*VSpherePlatform) DetachPortFromServer

func (v *VSpherePlatform) DetachPortFromServer(ctx context.Context, serverName string, subnetNames vmlayer.SubnetNames, portName string) error

DetachPortFromServer does not actually detach the port (not supported in govc), but removes the tags

func (*VSpherePlatform) GatherCloudletInfo

func (v *VSpherePlatform) GatherCloudletInfo(ctx context.Context, info *edgeproto.CloudletInfo) error

func (*VSpherePlatform) GetAllVmIpsFromTags

func (v *VSpherePlatform) GetAllVmIpsFromTags(ctx context.Context) (map[string][]string, error)

GetAllVmIpsFromTags returns a map of vmname to ip list

func (*VSpherePlatform) GetApiEndpointAddr

func (v *VSpherePlatform) GetApiEndpointAddr(ctx context.Context) (string, error)

func (*VSpherePlatform) GetCloudletImageSuffix

func (v *VSpherePlatform) GetCloudletImageSuffix(ctx context.Context) string

func (*VSpherePlatform) GetCloudletInfraResourcesInfo

func (s *VSpherePlatform) GetCloudletInfraResourcesInfo(ctx context.Context) ([]edgeproto.InfraResource, error)

func (*VSpherePlatform) GetCloudletManifest

func (v *VSpherePlatform) GetCloudletManifest(ctx context.Context, name string, cloudletImagePath string, vmgp *vmlayer.VMGroupOrchestrationParams) (string, error)

GetCloudletManifest follows the standard practice for vSphere to use OVF for this purpose. We store the OVF in artifactory along with with the vmdk formatted disk. No customization is needed per cloudlet as the OVF import tool will prompt for datastore and portgroup.

func (*VSpherePlatform) GetClusterAdditionalResourceMetric

func (s *VSpherePlatform) GetClusterAdditionalResourceMetric(ctx context.Context, cloudlet *edgeproto.Cloudlet, resMetric *edgeproto.Metric, resources []edgeproto.VMResource) error

func (*VSpherePlatform) GetClusterAdditionalResources

func (s *VSpherePlatform) GetClusterAdditionalResources(ctx context.Context, cloudlet *edgeproto.Cloudlet, vmResources []edgeproto.VMResource, infraResMap map[string]edgeproto.InfraResource) map[string]edgeproto.InfraResource

func (*VSpherePlatform) GetConsoleUrl

func (v *VSpherePlatform) GetConsoleUrl(ctx context.Context, serverName string) (string, error)

func (*VSpherePlatform) GetDataStore

func (v *VSpherePlatform) GetDataStore() string

func (*VSpherePlatform) GetDataStoreInfo

func (v *VSpherePlatform) GetDataStoreInfo(ctx context.Context) (*GovcDatastoreInfo, error)

func (*VSpherePlatform) GetDatacenterName

func (v *VSpherePlatform) GetDatacenterName(ctx context.Context) string

func (*VSpherePlatform) GetDistributedPortGroups

func (v *VSpherePlatform) GetDistributedPortGroups(ctx context.Context, portgrpNameMatch string) (map[string]DistributedPortGroup, error)

func (*VSpherePlatform) GetDomainFromTag

func (v *VSpherePlatform) GetDomainFromTag(ctx context.Context, tag string) (string, error)

GetDomainFromTag get the domain from the tag which is always the last field

func (*VSpherePlatform) GetExternalGateway

func (v *VSpherePlatform) GetExternalGateway(ctx context.Context, extNetName string) (string, error)

func (*VSpherePlatform) GetExternalIPCounts

func (v *VSpherePlatform) GetExternalIPCounts(ctx context.Context) (uint64, uint64, error)

GetExternalIPCounts returns Total, Used

func (*VSpherePlatform) GetExternalIPForServer

func (v *VSpherePlatform) GetExternalIPForServer(ctx context.Context, server string) (string, error)

func (*VSpherePlatform) GetExternalIpNetworkCidr

func (v *VSpherePlatform) GetExternalIpNetworkCidr(ctx context.Context) (string, error)

func (*VSpherePlatform) GetExternalIpRanges

func (v *VSpherePlatform) GetExternalIpRanges() ([]string, error)

func (*VSpherePlatform) GetExternalNetmask

func (v *VSpherePlatform) GetExternalNetmask() string

func (*VSpherePlatform) GetExternalVSwitch

func (v *VSpherePlatform) GetExternalVSwitch() string

func (*VSpherePlatform) GetFeatures

func (o *VSpherePlatform) GetFeatures() *edgeproto.PlatformFeatures

func (*VSpherePlatform) GetFlavor

func (v *VSpherePlatform) GetFlavor(ctx context.Context, flavorName string) (*edgeproto.FlavorInfo, error)

func (*VSpherePlatform) GetFlavorList

func (v *VSpherePlatform) GetFlavorList(ctx context.Context) ([]*edgeproto.FlavorInfo, error)

func (*VSpherePlatform) GetFreeExternalIP

func (v *VSpherePlatform) GetFreeExternalIP(ctx context.Context) (string, error)

func (*VSpherePlatform) GetGPUSetupStage

func (v *VSpherePlatform) GetGPUSetupStage(ctx context.Context) vmlayer.GPUSetupStage

func (*VSpherePlatform) GetGovcVm

func (v *VSpherePlatform) GetGovcVm(ctx context.Context, vmname string) (*GovcVM, error)

func (*VSpherePlatform) GetHostCluster

func (v *VSpherePlatform) GetHostCluster() string

func (*VSpherePlatform) GetHosts

func (v *VSpherePlatform) GetHosts(ctx context.Context) (*GovcHosts, error)

func (*VSpherePlatform) GetInternalNetmask

func (v *VSpherePlatform) GetInternalNetmask() string

func (*VSpherePlatform) GetInternalPortPolicy

func (v *VSpherePlatform) GetInternalPortPolicy() vmlayer.InternalPortAttachPolicy

func (*VSpherePlatform) GetInternalVSwitch

func (v *VSpherePlatform) GetInternalVSwitch() string

func (*VSpherePlatform) GetIpsFromTagsForVM

func (v *VSpherePlatform) GetIpsFromTagsForVM(ctx context.Context, vmName string, sd *vmlayer.ServerDetail) error

func (*VSpherePlatform) GetMetrics

func (v *VSpherePlatform) GetMetrics(ctx context.Context, vmMatch string, collectRequest *MetricsCollectionRequestType) (*MetricsResult, error)

func (*VSpherePlatform) GetNetworkList

func (v *VSpherePlatform) GetNetworkList(ctx context.Context) ([]string, error)

func (*VSpherePlatform) GetNetworkListForVm

func (v *VSpherePlatform) GetNetworkListForVm(ctx context.Context, vmname string) ([]string, error)

GetNetworkListForVm get a sorted list of attached network names for the VM

func (*VSpherePlatform) GetPlatformResourceInfo

func (v *VSpherePlatform) GetPlatformResourceInfo(ctx context.Context) (*vmlayer.PlatformResources, error)

func (*VSpherePlatform) GetPortGroup

func (v *VSpherePlatform) GetPortGroup(ctx context.Context, serverName, network string) (string, error)

func (*VSpherePlatform) GetRemoteDeployScript

func (v *VSpherePlatform) GetRemoteDeployScript(ctx context.Context, vmgp *vmlayer.VMGroupOrchestrationParams) (string, error)

func (*VSpherePlatform) GetResourceID

func (v *VSpherePlatform) GetResourceID(ctx context.Context, resourceType vmlayer.ResourceType, resourceName string) (string, error)

func (*VSpherePlatform) GetResourcePools

func (v *VSpherePlatform) GetResourcePools(ctx context.Context) (*GovcPools, error)

func (*VSpherePlatform) GetRouterDetail

func (v *VSpherePlatform) GetRouterDetail(ctx context.Context, routerName string) (*vmlayer.RouterDetail, error)

func (*VSpherePlatform) GetServerDetail

func (v *VSpherePlatform) GetServerDetail(ctx context.Context, vmname string) (*vmlayer.ServerDetail, error)

func (*VSpherePlatform) GetServerGroupResources

func (v *VSpherePlatform) GetServerGroupResources(ctx context.Context, name string) (*edgeproto.InfraResources, error)

func (*VSpherePlatform) GetSubnetTag

func (v *VSpherePlatform) GetSubnetTag(ctx context.Context, group, subnetName, cidr string, vlan uint32) string

func (*VSpherePlatform) GetSubnetTagCategory

func (v *VSpherePlatform) GetSubnetTagCategory(ctx context.Context) string

func (*VSpherePlatform) GetTagCategories

func (v *VSpherePlatform) GetTagCategories(ctx context.Context) ([]GovcTagCategory, error)

func (*VSpherePlatform) GetTagFieldMap

func (v *VSpherePlatform) GetTagFieldMap(tag string) (map[string]string, error)

func (*VSpherePlatform) GetTagMatchingField

func (v *VSpherePlatform) GetTagMatchingField(ctx context.Context, category, fieldName, fieldVal string) (*GovcTag, error)

func (*VSpherePlatform) GetTagsForCategory

func (v *VSpherePlatform) GetTagsForCategory(ctx context.Context, category string, domainMatch vmlayer.VMDomain) ([]GovcTag, error)

func (*VSpherePlatform) GetTagsMatchingField

func (v *VSpherePlatform) GetTagsMatchingField(ctx context.Context, fieldName string, fieldValue string, category string) ([]GovcTag, error)

func (*VSpherePlatform) GetTemplateFolder

func (v *VSpherePlatform) GetTemplateFolder() string

func (*VSpherePlatform) GetUsedExternalIPs

func (v *VSpherePlatform) GetUsedExternalIPs(ctx context.Context) (map[string]string, error)

func (*VSpherePlatform) GetUsedSubnetCIDRs

func (v *VSpherePlatform) GetUsedSubnetCIDRs(ctx context.Context) (map[string]string, error)

func (*VSpherePlatform) GetVCenterAddress

func (v *VSpherePlatform) GetVCenterAddress() (string, string, error)

GetVSphereAddress returns host and port for the vcenter server

func (*VSpherePlatform) GetVCenterConsolePassword

func (v *VSpherePlatform) GetVCenterConsolePassword() string

func (*VSpherePlatform) GetVCenterConsoleSessionCookie

func (v *VSpherePlatform) GetVCenterConsoleSessionCookie(ctx context.Context) (string, error)

GetConsoleSessionCookie does a UI login with the console user to get a cookie which can then be used to login remotely to the VM console. The login is a 3 part process 1) GET to UI login Page 2) Redirect to SAML Request URL 3) POST to SSO login page with form data based on SAMLResponse

func (*VSpherePlatform) GetVCenterConsoleUser

func (v *VSpherePlatform) GetVCenterConsoleUser() string

func (*VSpherePlatform) GetVCenterInsecure

func (v *VSpherePlatform) GetVCenterInsecure() string

func (*VSpherePlatform) GetVCenterPassword

func (v *VSpherePlatform) GetVCenterPassword() string

func (*VSpherePlatform) GetVCenterUser

func (v *VSpherePlatform) GetVCenterUser() string

func (*VSpherePlatform) GetVMDomainTagCategory

func (v *VSpherePlatform) GetVMDomainTagCategory(ctx context.Context) string

func (*VSpherePlatform) GetVMStats

func (v *VSpherePlatform) GetVMStats(ctx context.Context, appInst *edgeproto.AppInst) (*vmlayer.VMMetrics, error)

func (*VSpherePlatform) GetVMVersion

func (v *VSpherePlatform) GetVMVersion() string

func (*VSpherePlatform) GetVMs

func (v *VSpherePlatform) GetVMs(ctx context.Context, vmNameMatch string, domainMatch vmlayer.VMDomain) (*GovcVMs, error)

func (*VSpherePlatform) GetValueForTagField

func (v *VSpherePlatform) GetValueForTagField(tag string, fieldName string) (string, error)

func (*VSpherePlatform) GetVmDomainTag

func (v *VSpherePlatform) GetVmDomainTag(ctx context.Context, group, vmName, role, flavor string) string

func (*VSpherePlatform) GetVmIpTag

func (v *VSpherePlatform) GetVmIpTag(ctx context.Context, group, vmName, network, ipaddr string) string

func (*VSpherePlatform) GetVmIpTagCategory

func (v *VSpherePlatform) GetVmIpTagCategory(ctx context.Context) string

func (*VSpherePlatform) GetVmNamesFromTags

func (v *VSpherePlatform) GetVmNamesFromTags(ctx context.Context, tags []GovcTag) (map[string]string, error)

func (*VSpherePlatform) GetVsphereVars

func (v *VSpherePlatform) GetVsphereVars(ctx context.Context, accessApi platform.AccessApi) error

func (*VSpherePlatform) IdSanitize

func (v *VSpherePlatform) IdSanitize(name string) string

IdSanitize is NameSanitize plus removing "."

func (*VSpherePlatform) ImportImage

func (v *VSpherePlatform) ImportImage(ctx context.Context, folder, imageFile string) error

ImportImage imports the image file into the datastore

func (*VSpherePlatform) InitApiAccessProperties

func (v *VSpherePlatform) InitApiAccessProperties(ctx context.Context, accessApi platform.AccessApi, vars map[string]string) error

func (*VSpherePlatform) InitData

func (v *VSpherePlatform) InitData(ctx context.Context, caches *platform.Caches)

func (*VSpherePlatform) InitOperationContext

func (v *VSpherePlatform) InitOperationContext(ctx context.Context, operationStage vmlayer.OperationInitStage) (context.Context, vmlayer.OperationInitResult, error)

func (*VSpherePlatform) InitProvider

func (v *VSpherePlatform) InitProvider(ctx context.Context, caches *platform.Caches, stage vmlayer.ProviderInitStage, updateCallback edgeproto.CacheUpdateCallback) error

func (*VSpherePlatform) InternalCloudletUpdatedCallback

func (v *VSpherePlatform) InternalCloudletUpdatedCallback(ctx context.Context, old *edgeproto.CloudletInternal, new *edgeproto.CloudletInternal)

func (*VSpherePlatform) IsPortGrpAttached

func (v *VSpherePlatform) IsPortGrpAttached(ctx context.Context, serverName, portGrpName string) (bool, error)

func (*VSpherePlatform) NameSanitize

func (v *VSpherePlatform) NameSanitize(name string) string

alphanumeric plus -_. first char must be alpha, <= 255 chars.

func (*VSpherePlatform) ParseSubnetTag

func (v *VSpherePlatform) ParseSubnetTag(ctx context.Context, tag string) (*SubnetTagContents, error)

ParseSubnetTag returns subnetName, cidr, vlan, domain

func (*VSpherePlatform) ParseVMDomainTag

func (v *VSpherePlatform) ParseVMDomainTag(ctx context.Context, tag string) (*VMDomainTagContents, error)

ParseVMDomainTag returns vmname, domain, role, flavor

func (*VSpherePlatform) ParseVMIpTag

func (v *VSpherePlatform) ParseVMIpTag(ctx context.Context, tag string) (*VMIpTagContents, error)

ParseVMIpTag returns vmname, network, ipaddr, domain

func (*VSpherePlatform) PrepareRootLB

func (v *VSpherePlatform) PrepareRootLB(ctx context.Context, client ssh.Client, rootLBName string, secGrpName string, TrustPolicy *edgeproto.TrustPolicy, updateCallback edgeproto.CacheUpdateCallback) error

func (*VSpherePlatform) RemoveWhitelistSecurityRules

func (v *VSpherePlatform) RemoveWhitelistSecurityRules(ctx context.Context, client ssh.Client, wlParams *infracommon.WhiteListParams) error

func (*VSpherePlatform) SetPowerState

func (v *VSpherePlatform) SetPowerState(ctx context.Context, serverName, serverAction string) error

func (*VSpherePlatform) SetVMProperties

func (v *VSpherePlatform) SetVMProperties(vmProperties *vmlayer.VMProperties)

func (*VSpherePlatform) TimedGovcCommand

func (v *VSpherePlatform) TimedGovcCommand(ctx context.Context, name string, a ...string) ([]byte, error)

func (*VSpherePlatform) UpdateVMs

UpdateVMs calculates which VMs need to be added or removed from the given group and then does so. It also deletes and removes tags as needed.

func (*VSpherePlatform) ValidateAdditionalNetworks

func (v *VSpherePlatform) ValidateAdditionalNetworks(ctx context.Context, additionalNets map[string]vmlayer.NetworkType) error

func (*VSpherePlatform) VerifyVMs

func (s *VSpherePlatform) VerifyVMs(ctx context.Context, vms []edgeproto.VM) error

func (*VSpherePlatform) VmAppChangedCallback

func (v *VSpherePlatform) VmAppChangedCallback(ctx context.Context, appInst *edgeproto.AppInst, newState edgeproto.TrackedState)

func (*VSpherePlatform) WhitelistSecurityRules

func (v *VSpherePlatform) WhitelistSecurityRules(ctx context.Context, client ssh.Client, wlParams *infracommon.WhiteListParams) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL