Documentation ¶
Index ¶
- Constants
- Variables
- func NewPlatform() platform.Platform
- type DPGNetwork
- type DeployScriptParams
- type DistributedPortGroup
- type GovcDatastore
- type GovcDatastoreInfo
- type GovcDatastoreSummary
- type GovcDeviceBacking
- type GovcDeviceBackingPort
- type GovcHost
- type GovcHostCpuInfo
- type GovcHostHardware
- type GovcHosts
- type GovcMetricSample
- type GovcMetricSampleInfo
- type GovcMetricSampleValue
- type GovcMetricSamples
- type GovcNetwork
- type GovcNetworkElement
- type GovcNetworkElementSummary
- type GovcNetworkObject
- type GovcNetworkObjects
- type GovcPool
- type GovcPoolRuntime
- type GovcPools
- type GovcResourceInfo
- type GovcRuntime
- type GovcTag
- type GovcTagCategory
- type GovcVM
- type GovcVMConfig
- type GovcVMDevice
- type GovcVMDeviceList
- type GovcVMFile
- type GovcVMGuest
- type GovcVMHardware
- type GovcVMHardwareDevice
- type GovcVMLayout
- type GovcVMNet
- type GovcVMs
- type MetricsCollectionRequestType
- type MetricsResult
- type SubnetTagContents
- type VMDomainTagContents
- type VMIpTagContents
- type VSpherePlatform
- func (s VSpherePlatform) ActiveChanged(ctx context.Context, platformActive bool) error
- func (v *VSpherePlatform) AddImageIfNotPresent(ctx context.Context, imageInfo *infracommon.ImageInfo, ...) error
- func (v *VSpherePlatform) AttachPortToServer(ctx context.Context, serverName string, subnetNames vmlayer.SubnetNames, ...) error
- func (s *VSpherePlatform) CheckServerReady(ctx context.Context, client ssh.Client, serverName string) error
- func (v *VSpherePlatform) ConfigureCloudletSecurityRules(ctx context.Context, egressRestricted bool, TrustPolicy *edgeproto.TrustPolicy, ...) error
- func (o *VSpherePlatform) ConfigureTrustPolicyExceptionSecurityRules(ctx context.Context, TrustPolicyException *edgeproto.TrustPolicyException, ...) error
- func (v *VSpherePlatform) ConnectNetworksForVM(ctx context.Context, vmName string) error
- func (v *VSpherePlatform) CreateImageFromUrl(ctx context.Context, imageName, imageUrl, md5Sum string, diskSize uint64) error
- func (v *VSpherePlatform) CreatePool(ctx context.Context, poolName string) error
- func (v *VSpherePlatform) CreatePortGroup(ctx context.Context, dvs string, pgName string, vlan uint32) error
- func (v *VSpherePlatform) CreateTag(ctx context.Context, tag *vmlayer.TagOrchestrationParams) error
- func (v *VSpherePlatform) CreateTagCategories(ctx context.Context) error
- func (v *VSpherePlatform) CreateTagCategory(ctx context.Context, category string) error
- func (v *VSpherePlatform) CreateTemplateFolder(ctx context.Context) error
- func (v *VSpherePlatform) CreateTemplateFromImage(ctx context.Context, imageFolder string, imageFile string) error
- func (v *VSpherePlatform) CreateVM(ctx context.Context, vm *vmlayer.VMOrchestrationParams, poolName string) error
- func (v *VSpherePlatform) CreateVMs(ctx context.Context, vmgp *vmlayer.VMGroupOrchestrationParams, ...) error
- func (v *VSpherePlatform) DeleteImage(ctx context.Context, folder, image string) error
- func (v *VSpherePlatform) DeletePool(ctx context.Context, poolName string) error
- func (v *VSpherePlatform) DeleteResourcesForGroup(ctx context.Context, groupName string) error
- func (v *VSpherePlatform) DeleteTag(ctx context.Context, tagname string) error
- func (v *VSpherePlatform) DeleteVM(ctx context.Context, vmName string) error
- func (v *VSpherePlatform) DeleteVMAndTags(ctx context.Context, vmName string) error
- func (v *VSpherePlatform) DeleteVMs(ctx context.Context, vmGroupName, ownerID string) error
- func (v *VSpherePlatform) DetachPortFromServer(ctx context.Context, serverName string, subnetNames vmlayer.SubnetNames, ...) error
- func (v *VSpherePlatform) GatherCloudletInfo(ctx context.Context, info *edgeproto.CloudletInfo) error
- func (v *VSpherePlatform) GetAllVmIpsFromTags(ctx context.Context) (map[string][]string, error)
- func (v *VSpherePlatform) GetApiEndpointAddr(ctx context.Context) (string, error)
- func (v *VSpherePlatform) GetCloudletImageSuffix(ctx context.Context) string
- func (s *VSpherePlatform) GetCloudletInfraResourcesInfo(ctx context.Context) ([]edgeproto.InfraResource, error)
- func (v *VSpherePlatform) GetCloudletManifest(ctx context.Context, name string, cloudletImagePath string, ...) (string, error)
- func (s *VSpherePlatform) GetClusterAdditionalResourceMetric(ctx context.Context, cloudlet *edgeproto.Cloudlet, resMetric *edgeproto.Metric, ...) error
- func (s *VSpherePlatform) GetClusterAdditionalResources(ctx context.Context, cloudlet *edgeproto.Cloudlet, ...) map[string]edgeproto.InfraResource
- func (v *VSpherePlatform) GetConsoleUrl(ctx context.Context, serverName string) (string, error)
- func (v *VSpherePlatform) GetDataStore() string
- func (v *VSpherePlatform) GetDataStoreInfo(ctx context.Context) (*GovcDatastoreInfo, error)
- func (v *VSpherePlatform) GetDatacenterName(ctx context.Context) string
- func (v *VSpherePlatform) GetDistributedPortGroups(ctx context.Context, portgrpNameMatch string) (map[string]DistributedPortGroup, error)
- func (v *VSpherePlatform) GetDomainFromTag(ctx context.Context, tag string) (string, error)
- func (v *VSpherePlatform) GetExternalGateway(ctx context.Context, extNetName string) (string, error)
- func (v *VSpherePlatform) GetExternalIPCounts(ctx context.Context) (uint64, uint64, error)
- func (v *VSpherePlatform) GetExternalIPForServer(ctx context.Context, server string) (string, error)
- func (v *VSpherePlatform) GetExternalIpNetworkCidr(ctx context.Context) (string, error)
- func (v *VSpherePlatform) GetExternalIpRanges() ([]string, error)
- func (v *VSpherePlatform) GetExternalNetmask() string
- func (v *VSpherePlatform) GetExternalVSwitch() string
- func (o *VSpherePlatform) GetFeatures() *edgeproto.PlatformFeatures
- func (v *VSpherePlatform) GetFlavor(ctx context.Context, flavorName string) (*edgeproto.FlavorInfo, error)
- func (v *VSpherePlatform) GetFlavorList(ctx context.Context) ([]*edgeproto.FlavorInfo, error)
- func (v *VSpherePlatform) GetFreeExternalIP(ctx context.Context) (string, error)
- func (v *VSpherePlatform) GetGPUSetupStage(ctx context.Context) vmlayer.GPUSetupStage
- func (v *VSpherePlatform) GetGovcVm(ctx context.Context, vmname string) (*GovcVM, error)
- func (v *VSpherePlatform) GetHostCluster() string
- func (v *VSpherePlatform) GetHosts(ctx context.Context) (*GovcHosts, error)
- func (v *VSpherePlatform) GetInternalNetmask() string
- func (v *VSpherePlatform) GetInternalPortPolicy() vmlayer.InternalPortAttachPolicy
- func (v *VSpherePlatform) GetInternalVSwitch() string
- func (v *VSpherePlatform) GetIpsFromTagsForVM(ctx context.Context, vmName string, sd *vmlayer.ServerDetail) error
- func (v *VSpherePlatform) GetMetrics(ctx context.Context, vmMatch string, ...) (*MetricsResult, error)
- func (v *VSpherePlatform) GetNetworkList(ctx context.Context) ([]string, error)
- func (v *VSpherePlatform) GetNetworkListForVm(ctx context.Context, vmname string) ([]string, error)
- func (v *VSpherePlatform) GetPlatformResourceInfo(ctx context.Context) (*vmlayer.PlatformResources, error)
- func (v *VSpherePlatform) GetPortGroup(ctx context.Context, serverName, network string) (string, error)
- func (v *VSpherePlatform) GetRemoteDeployScript(ctx context.Context, vmgp *vmlayer.VMGroupOrchestrationParams) (string, error)
- func (v *VSpherePlatform) GetResourceID(ctx context.Context, resourceType vmlayer.ResourceType, resourceName string) (string, error)
- func (v *VSpherePlatform) GetResourcePools(ctx context.Context) (*GovcPools, error)
- func (v *VSpherePlatform) GetRouterDetail(ctx context.Context, routerName string) (*vmlayer.RouterDetail, error)
- func (v *VSpherePlatform) GetServerDetail(ctx context.Context, vmname string) (*vmlayer.ServerDetail, error)
- func (v *VSpherePlatform) GetServerGroupResources(ctx context.Context, name string) (*edgeproto.InfraResources, error)
- func (v *VSpherePlatform) GetSubnetTag(ctx context.Context, group, subnetName, cidr string, vlan uint32) string
- func (v *VSpherePlatform) GetSubnetTagCategory(ctx context.Context) string
- func (v *VSpherePlatform) GetTagCategories(ctx context.Context) ([]GovcTagCategory, error)
- func (v *VSpherePlatform) GetTagFieldMap(tag string) (map[string]string, error)
- func (v *VSpherePlatform) GetTagMatchingField(ctx context.Context, category, fieldName, fieldVal string) (*GovcTag, error)
- func (v *VSpherePlatform) GetTagsForCategory(ctx context.Context, category string, domainMatch vmlayer.VMDomain) ([]GovcTag, error)
- func (v *VSpherePlatform) GetTagsMatchingField(ctx context.Context, fieldName string, fieldValue string, category string) ([]GovcTag, error)
- func (v *VSpherePlatform) GetTemplateFolder() string
- func (v *VSpherePlatform) GetUsedExternalIPs(ctx context.Context) (map[string]string, error)
- func (v *VSpherePlatform) GetUsedSubnetCIDRs(ctx context.Context) (map[string]string, error)
- func (v *VSpherePlatform) GetVCenterAddress() (string, string, error)
- func (v *VSpherePlatform) GetVCenterConsolePassword() string
- func (v *VSpherePlatform) GetVCenterConsoleSessionCookie(ctx context.Context) (string, error)
- func (v *VSpherePlatform) GetVCenterConsoleUser() string
- func (v *VSpherePlatform) GetVCenterInsecure() string
- func (v *VSpherePlatform) GetVCenterPassword() string
- func (v *VSpherePlatform) GetVCenterUser() string
- func (v *VSpherePlatform) GetVMDomainTagCategory(ctx context.Context) string
- func (v *VSpherePlatform) GetVMStats(ctx context.Context, appInst *edgeproto.AppInst) (*vmlayer.VMMetrics, error)
- func (v *VSpherePlatform) GetVMVersion() string
- func (v *VSpherePlatform) GetVMs(ctx context.Context, vmNameMatch string, domainMatch vmlayer.VMDomain) (*GovcVMs, error)
- func (v *VSpherePlatform) GetValueForTagField(tag string, fieldName string) (string, error)
- func (v *VSpherePlatform) GetVmDomainTag(ctx context.Context, group, vmName, role, flavor string) string
- func (v *VSpherePlatform) GetVmIpTag(ctx context.Context, group, vmName, network, ipaddr string) string
- func (v *VSpherePlatform) GetVmIpTagCategory(ctx context.Context) string
- func (v *VSpherePlatform) GetVmNamesFromTags(ctx context.Context, tags []GovcTag) (map[string]string, error)
- func (v *VSpherePlatform) GetVsphereVars(ctx context.Context, accessApi platform.AccessApi) error
- func (v *VSpherePlatform) IdSanitize(name string) string
- func (v *VSpherePlatform) ImportImage(ctx context.Context, folder, imageFile string) error
- func (v *VSpherePlatform) InitApiAccessProperties(ctx context.Context, accessApi platform.AccessApi, vars map[string]string) error
- func (v *VSpherePlatform) InitData(ctx context.Context, caches *platform.Caches)
- func (v *VSpherePlatform) InitOperationContext(ctx context.Context, operationStage vmlayer.OperationInitStage) (context.Context, vmlayer.OperationInitResult, error)
- func (v *VSpherePlatform) InitProvider(ctx context.Context, caches *platform.Caches, stage vmlayer.ProviderInitStage, ...) error
- func (v *VSpherePlatform) InternalCloudletUpdatedCallback(ctx context.Context, old *edgeproto.CloudletInternal, ...)
- func (v *VSpherePlatform) IsPortGrpAttached(ctx context.Context, serverName, portGrpName string) (bool, error)
- func (v *VSpherePlatform) NameSanitize(name string) string
- func (v *VSpherePlatform) ParseSubnetTag(ctx context.Context, tag string) (*SubnetTagContents, error)
- func (v *VSpherePlatform) ParseVMDomainTag(ctx context.Context, tag string) (*VMDomainTagContents, error)
- func (v *VSpherePlatform) ParseVMIpTag(ctx context.Context, tag string) (*VMIpTagContents, error)
- func (v *VSpherePlatform) PrepareRootLB(ctx context.Context, client ssh.Client, rootLBName string, secGrpName string, ...) error
- func (v *VSpherePlatform) RemoveWhitelistSecurityRules(ctx context.Context, client ssh.Client, wlParams *infracommon.WhiteListParams) error
- func (v *VSpherePlatform) SetPowerState(ctx context.Context, serverName, serverAction string) error
- func (v *VSpherePlatform) SetVMProperties(vmProperties *vmlayer.VMProperties)
- func (v *VSpherePlatform) TimedGovcCommand(ctx context.Context, name string, a ...string) ([]byte, error)
- func (v *VSpherePlatform) UpdateVMs(ctx context.Context, vmgp *vmlayer.VMGroupOrchestrationParams, ...) error
- func (v *VSpherePlatform) ValidateAdditionalNetworks(ctx context.Context, additionalNets map[string]vmlayer.NetworkType) error
- func (s *VSpherePlatform) VerifyVMs(ctx context.Context, vms []edgeproto.VM) error
- func (v *VSpherePlatform) VmAppChangedCallback(ctx context.Context, appInst *edgeproto.AppInst, ...)
- func (v *VSpherePlatform) WhitelistSecurityRules(ctx context.Context, client ssh.Client, wlParams *infracommon.WhiteListParams) error
Constants ¶
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" )
const PortDoesNotExist = "Port does not exist"
const PortGrpMatchAny = "*"
const TagAlreadyExists = "ALREADY_EXISTS"
const TagFieldCidr = "cidr"
const TagFieldDomain = "domain"
const TagFieldFlavor = "flavor"
const TagFieldGroup = "group"
const TagFieldIp = "ip"
const TagFieldNetName = "netname"
const TagFieldRole = "role"
const TagFieldSubnetName = "subnetname"
const TagFieldVlan = "vlan"
const TagFieldVmName = "vmname"
const TagNotFound = "tag not found"
const VLAN_START uint32 = 1000
const VMMatchAny = "*"
Variables ¶
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", }, }
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 ¶
Types ¶
type DPGNetwork ¶
type DeployScriptParams ¶
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 GovcDeviceBacking ¶
type GovcDeviceBacking struct {
Port GovcDeviceBackingPort
}
type GovcDeviceBackingPort ¶
type GovcDeviceBackingPort struct {
PortgroupKey string
}
type GovcHost ¶
type GovcHost struct {
Hardware GovcHostHardware
}
type GovcHostCpuInfo ¶
type GovcHostHardware ¶
type GovcHostHardware struct { CpuInfo GovcHostCpuInfo MemorySize uint64 }
type GovcMetricSample ¶
type GovcMetricSample struct { SampleInfo []GovcMetricSampleInfo Value []GovcMetricSampleValue }
type GovcMetricSampleInfo ¶
type GovcMetricSampleValue ¶
type GovcMetricSamples ¶
type GovcMetricSamples struct {
Sample []GovcMetricSample
}
type GovcNetwork ¶
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 GovcResourceInfo ¶
type GovcRuntime ¶
type GovcRuntime struct {
PowerState string
}
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 GovcVMDeviceList ¶
type GovcVMDeviceList struct {
Devices []GovcVMDevice
}
type GovcVMFile ¶
type GovcVMGuest ¶
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 MetricsResult ¶
type SubnetTagContents ¶
type VMDomainTagContents ¶
type VMIpTagContents ¶
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 (*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 (v *VSpherePlatform) CreateTag(ctx context.Context, tag *vmlayer.TagOrchestrationParams) error
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 (v *VSpherePlatform) CreateVMs(ctx context.Context, vmgp *vmlayer.VMGroupOrchestrationParams, updateCallback edgeproto.CacheUpdateCallback) error
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 ¶
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 (*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 ¶
GetDomainFromTag get the domain from the tag which is always the last field
func (*VSpherePlatform) GetExternalGateway ¶
func (*VSpherePlatform) GetExternalIPCounts ¶
GetExternalIPCounts returns Total, Used
func (*VSpherePlatform) GetExternalIPForServer ¶
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) 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 ¶
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 (*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 (*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 (*VSpherePlatform) GetTagsForCategory ¶
func (*VSpherePlatform) GetTagsMatchingField ¶
func (*VSpherePlatform) GetTemplateFolder ¶
func (v *VSpherePlatform) GetTemplateFolder() string
func (*VSpherePlatform) GetUsedExternalIPs ¶
func (*VSpherePlatform) GetUsedSubnetCIDRs ¶
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 (*VSpherePlatform) GetVMVersion ¶
func (v *VSpherePlatform) GetVMVersion() string
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 (*VSpherePlatform) GetVsphereVars ¶
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 (*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 (*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 (*VSpherePlatform) UpdateVMs ¶
func (v *VSpherePlatform) UpdateVMs(ctx context.Context, vmgp *vmlayer.VMGroupOrchestrationParams, updateCallback edgeproto.CacheUpdateCallback) error
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) 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