esxi

package
v0.3.10-0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 67 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LINUX   = TOSType("Linux")
	WINDOWS = TOSType("Windows")
	MACOS   = TOSType("macOS")
	FREEBSD = TOSType("FreeBSD")
	SOLARIS = TOSType("Solaris")
	VMWARE  = TOSType("VMware")

	X86    = TOSArch("x86")
	X86_64 = TOSArch("x86_64")
)
View Source
const (
	MONTYPE_HOSTSYSTEM     = "HostSystem"
	MONTYPE_VIRTUALMACHINE = "VirtualMachine"
)
View Source
const (
	NET_TYPE_NETWORK     = "network"
	NET_TYPE_DVPORTGROUP = "dvportgroup"

	VLAN_MODE_NONE  = "none"
	VLAN_MODE_VLAN  = "vlan"
	VLAN_MODE_PVLAN = "pvlan"
	VLAN_MODE_TRUNK = "trunk"
)
View Source
const (
	CLOUD_PROVIDER_VMWARE = api.CLOUD_PROVIDER_VMWARE
)
View Source
const (
	IMAGE_CACHE_DIR_NAME = "image_cache"
)

Variables

View Source
var (
	SIMPLE_HOST_PROPS    = []string{"name", "config.network", "vm"}
	SIMPLE_VM_PROPS      = []string{"name", "guest.net", "config.template", "config.hardware.device"}
	SIMPLE_DVPG_PROPS    = []string{"key", "config.defaultPortConfig", "config.distributedVirtualSwitch"}
	SIMPLE_DVS_PROPS     = []string{"name", "config"}
	SIMPLE_NETWORK_PROPS = []string{"name"}
)
View Source
var DATACENTER_PROPS = []string{"name", "parent", "datastore", "network"}
View Source
var DATASTORE_PROPS = []string{"name", "parent", "info", "summary", "host", "vm"}
View Source
var DVPORTGROUP_PROPS = []string{"name", "parent", "host", "config", "key"}
View Source
var DVS_PROPS = []string{"name"}
View Source
var (
	ErrInvalidFormat = errors.Error("vmdk: invalid format (must be streamOptimized)")
)
View Source
var ErrTimeConsuming = errors.Error("time consuming")
View Source
var (
	GuestOsInfo = map[string]SOsInfo{}/* 134 elements not displayed */

)
View Source
var HOST_PROPS = []string{"name", "config.network", "vm"}
View Source
var HOST_SYSTEM_PROPS []string
View Source
var NETWORK_PROPS = []string{"name", "parent", "host"}
View Source
var RESOURCEPOOL_PROPS = []string{"name", "parent", "host"}
View Source
var VIRTUAL_MACHINE_PROPS = []string{"name", "parent", "resourcePool", "snapshot", "config"}
View Source
var VM_PROPS = []string{"name", "guest.net", "config.template", "summary.config.uuid", "summary.runtime.powerState"}

Functions

func FetchAnonymousFieldValue

func FetchAnonymousFieldValue(val interface{}, target interface{}) bool

func InitEsxiConfig

func InitEsxiConfig(opt EsxiOptions) error

func NewAHCIDev

func NewAHCIDev(key, ctlKey int32) types.BaseVirtualDevice

func NewCDROMDev

func NewCDROMDev(path string, key, ctlKey int32) types.BaseVirtualDevice

func NewDiskDev

func NewDiskDev(sizeMb int64, config SDiskConfig) *types.VirtualDisk

func NewIDEDev

func NewIDEDev(key, index int32) types.BaseVirtualDevice

func NewSCSIDev

func NewSCSIDev(key, ctlKey int32, driver string) types.BaseVirtualDevice

func NewSVGADev

func NewSVGADev(key, ctlKey int32) types.BaseVirtualDevice

func NewUSBController

func NewUSBController(key *int32) types.BaseVirtualDevice

func NewVNICDev

func NewVNICDev(host *SHost, mac, driver string, bridge string, vlanId int32, key, ctlKey, index int32) (types.BaseVirtualDevice, error)

func Properties

func Properties(c *vim25.Client, ctx context.Context, r types.ManagedObjectReference, ps []string, dst interface{}) error

Types

type ESXiClientConfig

type ESXiClientConfig struct {
	// contains filtered or unexported fields
}

func NewESXiClientConfig

func NewESXiClientConfig(host string, port int, account, password string) *ESXiClientConfig

func (*ESXiClientConfig) CloudproviderConfig

func (cfg *ESXiClientConfig) CloudproviderConfig(cpcfg cloudprovider.ProviderConfig) *ESXiClientConfig

func (*ESXiClientConfig) Debug

func (cfg *ESXiClientConfig) Debug(debug bool) *ESXiClientConfig

func (*ESXiClientConfig) Format

func (cfg *ESXiClientConfig) Format(format string) *ESXiClientConfig

func (*ESXiClientConfig) Managed

func (cfg *ESXiClientConfig) Managed(managed bool) *ESXiClientConfig

type EsxiOptions

type EsxiOptions struct {
	ReasonableCIDREsxi string `help:"Reasonable CIDR in esxi, such as '10.0.0.0/8'" defautl:""`
	TemplateNameRegex  string `help:"Regex of template name"`
}

type IDiskBackingInfo

type IDiskBackingInfo interface {
	GetParent() IDiskBackingInfo
	GetUuid() string
	GetDiskMode() string
	GetWriteThrough() bool
	GetFileName() string
	GetDatastore() *types.ManagedObjectReference
}

type INetworkInfo

type INetworkInfo interface {
	Insert(SIPProc, netutils.IPV4Addr)
	AppendVMs(name string, IpVlans []SIPVlan)
}

func NewNetworkInfo

func NewNetworkInfo(dvs bool, size int) INetworkInfo

type IPV4Range

type IPV4Range struct {
	// contains filtered or unexported fields
}

func (IPV4Range) Contains

func (i IPV4Range) Contains(ip string) bool

type IVMNetwork

type IVMNetwork interface {
	GetId() string
	GetName() string
	GetVlanId() int32
	GetNumPorts() int32
	GetActivePorts() []string
	GetType() string
	ContainHost(host *SHost) bool
	SetHostPortGroup(pg types.HostPortGroup)
}

type IVirtualSwitch

type IVirtualSwitch interface {
	FindNetworkByVlanID(vlanID int32) (IVMNetwork, error)
}

type ImportParams

type ImportParams struct {
	Path       string
	Logger     progress.Sinker
	Type       types.VirtualDiskType
	Force      bool
	Datacenter *object.Datacenter
	Pool       *object.ResourcePool
	Folder     *object.Folder
	Host       *object.HostSystem
}

ImportParams contains the set of optional params to the Import function. Note that "optional" may depend on environment, such as ESX or vCenter.

type SCdromInfo

type SCdromInfo struct {
	ImageId string
	Path    string
	Name    string
	Size    string
}

type SCluster

type SCluster struct {
	SManagedObject
}

func NewCluster

func NewCluster(manager *SESXiClient, cluster *mo.ClusterComputeResource, dc *SDatacenter) *SCluster

func (*SCluster) CreateResourcePool

func (cluster *SCluster) CreateResourcePool(name string) (*mo.ResourcePool, error)

func (*SCluster) ListResourcePools

func (cluster *SCluster) ListResourcePools() ([]mo.ResourcePool, error)

func (*SCluster) SyncResourcePool

func (cluster *SCluster) SyncResourcePool(name string) (*mo.ResourcePool, error)

type SCreateVMParam

type SCreateVMParam struct {
	Name                 string
	Uuid                 string
	OsName               string
	Cpu                  int
	Mem                  int
	Bios                 string
	Cdrom                SCdromInfo
	Disks                []SDiskInfo
	Nics                 []jsonutils.JSONObject
	ResourcePool         string
	InstanceSnapshotInfo SEsxiInstanceSnapshotInfo
}

type SDatacenter

type SDatacenter struct {
	SManagedObject

	Name string
	// contains filtered or unexported fields
}

func (*SDatacenter) FetchFakeTempateVMs

func (dc *SDatacenter) FetchFakeTempateVMs(regex string) ([]*SVirtualMachine, error)

func (*SDatacenter) FetchNoTemplateHostEntityReferens

func (dc *SDatacenter) FetchNoTemplateHostEntityReferens() ([]types.ManagedObjectReference, error)

func (*SDatacenter) FetchNoTemplateVMEntityReferens

func (dc *SDatacenter) FetchNoTemplateVMEntityReferens() ([]types.ManagedObjectReference, error)

func (*SDatacenter) FetchNoTemplateVMs

func (dc *SDatacenter) FetchNoTemplateVMs() ([]*SVirtualMachine, error)

func (*SDatacenter) FetchTemplateVMById

func (dc *SDatacenter) FetchTemplateVMById(id string) (*SVirtualMachine, error)

func (*SDatacenter) FetchTemplateVMs

func (dc *SDatacenter) FetchTemplateVMs() ([]*SVirtualMachine, error)

func (*SDatacenter) FetchVMById

func (dc *SDatacenter) FetchVMById(id string) (*SVirtualMachine, error)

func (*SDatacenter) FetchVMs

func (dc *SDatacenter) FetchVMs() ([]*SVirtualMachine, error)

func (*SDatacenter) GetCluster

func (dc *SDatacenter) GetCluster(cluster string) (*SCluster, error)

func (*SDatacenter) GetIHostByMoId

func (dc *SDatacenter) GetIHostByMoId(idstr string) (cloudprovider.ICloudHost, error)

func (*SDatacenter) GetIHosts

func (dc *SDatacenter) GetIHosts() ([]cloudprovider.ICloudHost, error)

func (*SDatacenter) GetIStorageByMoId

func (dc *SDatacenter) GetIStorageByMoId(idstr string) (cloudprovider.ICloudStorage, error)

func (*SDatacenter) GetIStorages

func (dc *SDatacenter) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SDatacenter) GetNetworks

func (dc *SDatacenter) GetNetworks() ([]IVMNetwork, error)

func (*SDatacenter) GetResourcePools

func (dc *SDatacenter) GetResourcePools() ([]cloudprovider.ICloudProject, error)

func (*SDatacenter) GetTemplateVMs

func (dc *SDatacenter) GetTemplateVMs() ([]*SVirtualMachine, error)

func (*SDatacenter) ListClusters

func (dc *SDatacenter) ListClusters() ([]*SCluster, error)

type SDatastore

type SDatastore struct {
	multicloud.SStorageBase
	SManagedObject
	// contains filtered or unexported fields
}

func NewDatastore

func NewDatastore(manager *SESXiClient, ds *mo.Datastore, dc *SDatacenter) *SDatastore

func (*SDatastore) CheckDirC

func (self *SDatastore) CheckDirC(remotePath string) error

CheckDirC will check that Dir 'remotePath' is exist, if not, create one.

func (*SDatastore) CheckFile

func (self *SDatastore) CheckFile(ctx context.Context, remotePath string) (*SDatastoreFileInfo, error)

func (*SDatastore) CheckVmdk

func (self *SDatastore) CheckVmdk(ctx context.Context, remotePath string) error

func (*SDatastore) CreateIDisk

func (*SDatastore) Delete

func (self *SDatastore) Delete(ctx context.Context, remotePath string) error

func (*SDatastore) Delete2

func (self *SDatastore) Delete2(ctx context.Context, remotePath string, isNamespace, force bool) error

Delete2 can delete file from this Datastore. isNamespace: remotePath is uuid of namespace on vsan datastore force: ignore nonexistent files and arguments

func (*SDatastore) DeleteVmdk

func (self *SDatastore) DeleteVmdk(ctx context.Context, remotePath string) error

func (*SDatastore) Download

func (self *SDatastore) Download(ctx context.Context, remotePath string, writer io.Writer) error

func (*SDatastore) FetchFakeTempateVMById

func (self *SDatastore) FetchFakeTempateVMById(id string, regex string) (*SVirtualMachine, error)

func (*SDatastore) FetchFakeTempateVMs

func (self *SDatastore) FetchFakeTempateVMs(regex string) ([]*SVirtualMachine, error)

func (*SDatastore) FetchNoTemplateVMs

func (self *SDatastore) FetchNoTemplateVMs() ([]*SVirtualMachine, error)

func (*SDatastore) FetchTemplateVMById

func (self *SDatastore) FetchTemplateVMById(id string) (*SVirtualMachine, error)

func (*SDatastore) FetchTemplateVMs

func (self *SDatastore) FetchTemplateVMs() ([]*SVirtualMachine, error)

func (*SDatastore) FileGetContent

func (self *SDatastore) FileGetContent(ctx context.Context, remotePath string) ([]byte, error)

func (*SDatastore) FilePutContent

func (self *SDatastore) FilePutContent(ctx context.Context, remotePath string, content string) error

func (*SDatastore) GetAttachedHosts

func (self *SDatastore) GetAttachedHosts() ([]cloudprovider.ICloudHost, error)

func (*SDatastore) GetCapacityMB

func (self *SDatastore) GetCapacityMB() int64

func (*SDatastore) GetCapacityUsedMB

func (self *SDatastore) GetCapacityUsedMB() int64

func (*SDatastore) GetEnabled

func (self *SDatastore) GetEnabled() bool

func (*SDatastore) GetFullPath

func (self *SDatastore) GetFullPath(remotePath string) string

func (*SDatastore) GetGlobalId

func (self *SDatastore) GetGlobalId() string

func (*SDatastore) GetIDiskById

func (self *SDatastore) GetIDiskById(idStr string) (cloudprovider.ICloudDisk, error)

func (*SDatastore) GetIDisks

func (self *SDatastore) GetIDisks() ([]cloudprovider.ICloudDisk, error)

func (*SDatastore) GetIStoragecache

func (self *SDatastore) GetIStoragecache() cloudprovider.ICloudStoragecache

func (*SDatastore) GetIZone

func (self *SDatastore) GetIZone() cloudprovider.ICloudZone

func (*SDatastore) GetMediumType

func (self *SDatastore) GetMediumType() string

func (*SDatastore) GetMountPoint

func (self *SDatastore) GetMountPoint() string

func (*SDatastore) GetName

func (self *SDatastore) GetName() string

func (*SDatastore) GetPathUrl

func (self *SDatastore) GetPathUrl(remotePath string) string

func (*SDatastore) GetRelName

func (self *SDatastore) GetRelName() string

func (*SDatastore) GetStatus

func (self *SDatastore) GetStatus() string

func (*SDatastore) GetStorageConf

func (self *SDatastore) GetStorageConf() jsonutils.JSONObject

func (*SDatastore) GetStorageType

func (self *SDatastore) GetStorageType() string

func (*SDatastore) GetUrl

func (self *SDatastore) GetUrl() string

func (*SDatastore) GetVmdkInfo

func (self *SDatastore) GetVmdkInfo(ctx context.Context, remotePath string) (*vmdkutils.SVMDKInfo, error)

func (*SDatastore) HasFile

func (self *SDatastore) HasFile(remotePath string) bool

func (*SDatastore) ImportISO

func (self *SDatastore) ImportISO(ctx context.Context, isoFile, remotePath string, host *SHost) error

func (*SDatastore) ImportVM

func (self *SDatastore) ImportVM(ctx context.Context, diskFile, name string, host *SHost) (*object.VirtualMachine, error)

ImportVM will import a vm by uploading a local vmdk

func (*SDatastore) ImportVMDK

func (self *SDatastore) ImportVMDK(ctx context.Context, diskFile, remotePath string, host *SHost) error

ImportVMDK will upload local vmdk 'diskFile' to the 'remotePath' of remote datastore

func (*SDatastore) IsEmulated

func (self *SDatastore) IsEmulated() bool

func (*SDatastore) IsSysDiskStore

func (self *SDatastore) IsSysDiskStore() bool

func (*SDatastore) ListDir

func (self *SDatastore) ListDir(ctx context.Context, remotePath string) ([]SDatastoreFileInfo, error)

func (*SDatastore) ListPath

func (self *SDatastore) ListPath(ctx context.Context, remotePath string) ([]types.HostDatastoreBrowserSearchResults, error)

func (*SDatastore) MakeDir

func (self *SDatastore) MakeDir(remotePath string) error

func (*SDatastore) MoveVmdk

func (self *SDatastore) MoveVmdk(ctx context.Context, srcPath string, dstPath string) error

func (*SDatastore) Refresh

func (self *SDatastore) Refresh() error

func (*SDatastore) RemoveDir

func (self *SDatastore) RemoveDir(ctx context.Context, remotePath string) error

func (*SDatastore) Upload

func (self *SDatastore) Upload(ctx context.Context, remotePath string, body io.Reader) error

type SDatastoreFileInfo

type SDatastoreFileInfo struct {
	Url      string
	Name     string
	Date     time.Time
	FileType string
	Size     uint64
}

type SDatastoreImageCache

type SDatastoreImageCache struct {
	multicloud.SResourceBase
	multicloud.STagBase
	// contains filtered or unexported fields
}

func (*SDatastoreImageCache) CreateIImage

func (self *SDatastoreImageCache) CreateIImage(snapshotId, imageName, osType, imageDesc string) (cloudprovider.ICloudImage, error)

func (*SDatastoreImageCache) DownloadImage

func (self *SDatastoreImageCache) DownloadImage(userCred mcclient.TokenCredential, imageId string, extId string, path string) (jsonutils.JSONObject, error)

func (*SDatastoreImageCache) GetGlobalId

func (self *SDatastoreImageCache) GetGlobalId() string

func (*SDatastoreImageCache) GetICloudImages

func (self *SDatastoreImageCache) GetICloudImages() ([]cloudprovider.ICloudImage, error)

func (*SDatastoreImageCache) GetICustomizedCloudImages

func (self *SDatastoreImageCache) GetICustomizedCloudImages() ([]cloudprovider.ICloudImage, error)

func (*SDatastoreImageCache) GetIImageById

func (self *SDatastoreImageCache) GetIImageById(extId string) (cloudprovider.ICloudImage, error)

func (*SDatastoreImageCache) GetIImageInImagecache

func (self *SDatastoreImageCache) GetIImageInImagecache() ([]cloudprovider.ICloudImage, error)

func (*SDatastoreImageCache) GetIImageInTemplateVMs

func (self *SDatastoreImageCache) GetIImageInTemplateVMs() ([]cloudprovider.ICloudImage, error)

func (*SDatastoreImageCache) GetIImageInTemplateVMsById

func (self *SDatastoreImageCache) GetIImageInTemplateVMsById(id string) (cloudprovider.ICloudImage, error)

func (*SDatastoreImageCache) GetId

func (self *SDatastoreImageCache) GetId() string

func (*SDatastoreImageCache) GetName

func (self *SDatastoreImageCache) GetName() string

func (*SDatastoreImageCache) GetPath

func (self *SDatastoreImageCache) GetPath() string

func (*SDatastoreImageCache) GetStatus

func (self *SDatastoreImageCache) GetStatus() string

func (*SDatastoreImageCache) IsEmulated

func (self *SDatastoreImageCache) IsEmulated() bool

func (*SDatastoreImageCache) Refresh

func (self *SDatastoreImageCache) Refresh() error

func (*SDatastoreImageCache) UploadImage

func (self *SDatastoreImageCache) UploadImage(ctx context.Context, userCred mcclient.TokenCredential, image *cloudprovider.SImageCreateOption, callback func(progress float32)) (string, error)

type SDiskConfig

type SDiskConfig struct {
	SizeMb        int64
	Uuid          string
	ControllerKey int32
	UnitNumber    int32
	Key           int32
	ImagePath     string
	IsRoot        bool
	Datastore     *SDatastore
}

type SDiskInfo

type SDiskInfo struct {
	ImagePath string
	Size      int64
	DiskId    string
	Driver    string
	ImageInfo SEsxiImageInfo
	StorageId string
}

type SDistributedVirtualPortgroup

type SDistributedVirtualPortgroup struct {
	SManagedObject
	HostPortGroup types.HostPortGroup
}

func (*SDistributedVirtualPortgroup) AddHostToDVS

func (net *SDistributedVirtualPortgroup) AddHostToDVS(host *SHost) (err error)

func (*SDistributedVirtualPortgroup) ContainHost

func (net *SDistributedVirtualPortgroup) ContainHost(host *SHost) bool

func (*SDistributedVirtualPortgroup) FindPort

func (*SDistributedVirtualPortgroup) GetActivePorts

func (net *SDistributedVirtualPortgroup) GetActivePorts() []string

func (*SDistributedVirtualPortgroup) GetDVSUuid

func (net *SDistributedVirtualPortgroup) GetDVSUuid() (string, error)

func (*SDistributedVirtualPortgroup) GetName

func (net *SDistributedVirtualPortgroup) GetName() string

func (*SDistributedVirtualPortgroup) GetNumPorts

func (net *SDistributedVirtualPortgroup) GetNumPorts() int32

func (*SDistributedVirtualPortgroup) GetType

func (net *SDistributedVirtualPortgroup) GetType() string

func (*SDistributedVirtualPortgroup) GetVlanId

func (net *SDistributedVirtualPortgroup) GetVlanId() int32

func (*SDistributedVirtualPortgroup) GetVlanMode

func (net *SDistributedVirtualPortgroup) GetVlanMode() string

func (*SDistributedVirtualPortgroup) SetHostPortGroup

func (net *SDistributedVirtualPortgroup) SetHostPortGroup(pg types.HostPortGroup)
func (net *SDistributedVirtualPortgroup) Uplink() bool

type SDistributedVirtualSwitch

type SDistributedVirtualSwitch struct {
	Host                     *SHost
	DistributedVirtualSwitch mo.DistributedVirtualSwitch
}

func (*SDistributedVirtualSwitch) FindNetworkByVlanID

func (vs *SDistributedVirtualSwitch) FindNetworkByVlanID(vlanID int32) (IVMNetwork, error)

type SESXiClient

type SESXiClient struct {
	*ESXiClientConfig

	cloudprovider.SFakeOnPremiseRegion
	multicloud.SRegion
	multicloud.SNoObjectStorageRegion
	// contains filtered or unexported fields
}

func NewESXiClient

func NewESXiClient(cfg *ESXiClientConfig) (*SESXiClient, error)

func NewESXiClient2

func NewESXiClient2(cfg *ESXiClientConfig) (*SESXiClient, error)

func NewESXiClientFromAccessInfo

func NewESXiClientFromAccessInfo(ctx context.Context, accessInfo *vcenter.SVCenterAccessInfo) (*SESXiClient, error)

func (*SESXiClient) About

func (cli *SESXiClient) About() jsonutils.JSONObject

func (*SESXiClient) AllHostIP

func (cli *SESXiClient) AllHostIP() (map[string]string, []mo.HostSystem, error)

func (*SESXiClient) CopyDisk

func (cli *SESXiClient) CopyDisk(ctx context.Context, src, dst string, isForce bool) error

func (*SESXiClient) DoExtendDiskOnline

func (cli *SESXiClient) DoExtendDiskOnline(_vm *SVirtualMachine, _disk *SVirtualDisk, newSizeMb int64) error

func (*SESXiClient) ExtendDisk

func (cli *SESXiClient) ExtendDisk(url string, newSizeMb int64) error

func (*SESXiClient) FindDatacenterByMoId

func (cli *SESXiClient) FindDatacenterByMoId(dcId string) (*SDatacenter, error)

func (*SESXiClient) FindHostByIp

func (cli *SESXiClient) FindHostByIp(hostIp string) (*SHost, error)

func (*SESXiClient) FindHostByMoId

func (cli *SESXiClient) FindHostByMoId(moId string) (cloudprovider.ICloudHost, error)

func (*SESXiClient) FindVMByPrivateID

func (cli *SESXiClient) FindVMByPrivateID(idstr string) (*SVirtualMachine, error)

func (*SESXiClient) GetAccountId

func (cli *SESXiClient) GetAccountId() string

func (*SESXiClient) GetCapabilities

func (cli *SESXiClient) GetCapabilities() []string

func (*SESXiClient) GetDatacenters

func (cli *SESXiClient) GetDatacenters() ([]*SDatacenter, error)

func (*SESXiClient) GetEcsMetrics

func (*SESXiClient) GetHostMetrics

func (*SESXiClient) GetI18n

func (cli *SESXiClient) GetI18n() cloudprovider.SModelI18nTable

func (*SESXiClient) GetIDiskById

func (self *SESXiClient) GetIDiskById(id string) (cloudprovider.ICloudDisk, error)

func (*SESXiClient) GetIHostById

func (cli *SESXiClient) GetIHostById(id string) (cloudprovider.ICloudHost, error)

func (*SESXiClient) GetIHosts

func (cli *SESXiClient) GetIHosts() ([]cloudprovider.ICloudHost, error)

func (*SESXiClient) GetILoadBalancerBackendGroups

func (cli *SESXiClient) GetILoadBalancerBackendGroups() ([]cloudprovider.ICloudLoadbalancerBackendGroup, error)

func (*SESXiClient) GetIProjects

func (cli *SESXiClient) GetIProjects() ([]cloudprovider.ICloudProject, error)

func (*SESXiClient) GetISkus

func (cli *SESXiClient) GetISkus() ([]cloudprovider.ICloudSku, error)

func (*SESXiClient) GetISnapshotById

func (cli *SESXiClient) GetISnapshotById(snapshotId string) (cloudprovider.ICloudSnapshot, error)

func (*SESXiClient) GetISnapshots

func (cli *SESXiClient) GetISnapshots() ([]cloudprovider.ICloudSnapshot, error)

func (*SESXiClient) GetIStorageById

func (cli *SESXiClient) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SESXiClient) GetIStoragecacheById

func (cli *SESXiClient) GetIStoragecacheById(idstr string) (cloudprovider.ICloudStoragecache, error)

func (*SESXiClient) GetIStoragecaches

func (cli *SESXiClient) GetIStoragecaches() ([]cloudprovider.ICloudStoragecache, error)

func (*SESXiClient) GetIStorages

func (cli *SESXiClient) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SESXiClient) GetIVMById

func (cli *SESXiClient) GetIVMById(id string) (cloudprovider.ICloudVM, error)

func (*SESXiClient) GetMetricTypes

func (self *SESXiClient) GetMetricTypes() (jsonutils.JSONObject, error)

func (*SESXiClient) GetMetrics

func (*SESXiClient) GetProvider

func (cli *SESXiClient) GetProvider() string

func (*SESXiClient) GetSubAccounts

func (cli *SESXiClient) GetSubAccounts() ([]cloudprovider.SSubAccount, error)

func (*SESXiClient) GetUUID

func (cli *SESXiClient) GetUUID() string

func (*SESXiClient) GetVersion

func (cli *SESXiClient) GetVersion() string

func (*SESXiClient) HostVmIPs

func (cli *SESXiClient) HostVmIPs(ctx context.Context) (SNetworkInfo, error)

func (*SESXiClient) HostVmIPsInCluster

func (cli *SESXiClient) HostVmIPsInCluster(ctx context.Context, cluster *SCluster) (SNetworkInfo, error)

func (*SESXiClient) HostVmIPsInDc

func (cli *SESXiClient) HostVmIPsInDc(ctx context.Context, dc *SDatacenter) (SNetworkInfo, error)

func (*SESXiClient) HostVmIPsPro

func (cli *SESXiClient) HostVmIPsPro(ctx context.Context) (SNetworkInfoPro, error)

func (*SESXiClient) IsHostIpExists

func (cli *SESXiClient) IsHostIpExists(hostIp string) (bool, error)

func (*SESXiClient) IsVCenter

func (cli *SESXiClient) IsVCenter() bool

func (*SESXiClient) IsValid

func (cli *SESXiClient) IsValid() bool

func (*SESXiClient) MoveDisk

func (cli *SESXiClient) MoveDisk(ctx context.Context, src, dst string, isForce bool) error

func (*SESXiClient) SearchTemplateVM

func (cli *SESXiClient) SearchTemplateVM(id string) (*SVirtualMachine, error)

func (*SESXiClient) SearchVM

func (cli *SESXiClient) SearchVM(id string) (*SVirtualMachine, error)

func (*SESXiClient) VMIP

func (cli *SESXiClient) VMIP(host mo.HostSystem) (map[string][]string, error)

func (*SESXiClient) VMIP2

func (cli *SESXiClient) VMIP2() ([]SVMIPInfo, error)

type SEsxiImageInfo

type SEsxiImageInfo struct {
	ImageType          string
	ImageExternalId    string
	StorageCacheHostIp string
}

type SEsxiInstanceSnapshotInfo

type SEsxiInstanceSnapshotInfo struct {
	InstanceSnapshotId string
	InstanceId         string
}

type SHost

type SHost struct {
	multicloud.SHostBase
	SManagedObject
	// contains filtered or unexported fields
}

func NewHost

func NewHost(manager *SESXiClient, host *mo.HostSystem, dc *SDatacenter) *SHost

func (*SHost) CloneVM

func (host *SHost) CloneVM(ctx context.Context, from *SVirtualMachine, snapshot *types.ManagedObjectReference, ds *SDatastore, params SCreateVMParam) (*SVirtualMachine, error)

If snapshot is not nil, params.Disks will be ignored

func (*SHost) CreateVM

func (*SHost) CreateVM2

func (self *SHost) CreateVM2(ctx context.Context, ds *SDatastore, params SCreateVMParam) (needDeploy bool, vm *SVirtualMachine, err error)

func (*SHost) DoCreateVM

func (self *SHost) DoCreateVM(ctx context.Context, ds *SDatastore, params SCreateVMParam) (needDeploy bool, vm *SVirtualMachine, err error)

func (*SHost) FileUrlPathToDsPath

func (host *SHost) FileUrlPathToDsPath(path string) (string, error)

func (*SHost) FindDataStoreById

func (host *SHost) FindDataStoreById(id string) (*SDatastore, error)

func (*SHost) FindNetworkByVlanID

func (host *SHost) FindNetworkByVlanID(vlanID int32) (IVMNetwork, error)

func (*SHost) GetAccessIp

func (self *SHost) GetAccessIp() string

func (*SHost) GetAccessMac

func (self *SHost) GetAccessMac() string

func (*SHost) GetCluster

func (host *SHost) GetCluster() (*SCluster, error)

func (*SHost) GetCpuCount

func (self *SHost) GetCpuCount() int

func (*SHost) GetCpuDesc

func (self *SHost) GetCpuDesc() string

func (*SHost) GetCpuMhz

func (self *SHost) GetCpuMhz() int

func (*SHost) GetDataStores

func (host *SHost) GetDataStores() ([]cloudprovider.ICloudStorage, error)

func (*SHost) GetEnabled

func (self *SHost) GetEnabled() bool

func (*SHost) GetGlobalId

func (self *SHost) GetGlobalId() string

func (*SHost) GetHostStatus

func (self *SHost) GetHostStatus() string

func (*SHost) GetHostType

func (self *SHost) GetHostType() string

func (*SHost) GetIHostNics

func (host *SHost) GetIHostNics() ([]cloudprovider.ICloudHostNetInterface, error)

func (*SHost) GetIHostNicsInternal

func (host *SHost) GetIHostNicsInternal(debug bool) ([]cloudprovider.ICloudHostNetInterface, error)

func (*SHost) GetIStorageById

func (self *SHost) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SHost) GetIStorages

func (self *SHost) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SHost) GetIVMById

func (self *SHost) GetIVMById(id string) (cloudprovider.ICloudVM, error)

func (*SHost) GetIVMs

func (self *SHost) GetIVMs() ([]cloudprovider.ICloudVM, error)

func (*SHost) GetIVMs2

func (self *SHost) GetIVMs2() ([]cloudprovider.ICloudVM, error)

func (*SHost) GetIWires

func (self *SHost) GetIWires() ([]cloudprovider.ICloudWire, error)

func (*SHost) GetIsMaintenance

func (self *SHost) GetIsMaintenance() bool

func (*SHost) GetManagementServerIp

func (host *SHost) GetManagementServerIp() string

func (*SHost) GetMemSizeMB

func (self *SHost) GetMemSizeMB() int

func (*SHost) GetName

func (self *SHost) GetName() string

func (*SHost) GetNetworks

func (host *SHost) GetNetworks() ([]IVMNetwork, error)

func (*SHost) GetNodeCount

func (self *SHost) GetNodeCount() int8

func (*SHost) GetResourcePool

func (host *SHost) GetResourcePool() (*object.ResourcePool, error)

func (*SHost) GetResourcePools

func (host *SHost) GetResourcePools() ([]mo.ResourcePool, error)

func (*SHost) GetSN

func (self *SHost) GetSN() string

func (*SHost) GetSchedtags

func (self *SHost) GetSchedtags() ([]string, error)

func (*SHost) GetSiblingHosts

func (host *SHost) GetSiblingHosts() ([]*SHost, error)

func (*SHost) GetStatus

func (self *SHost) GetStatus() string

func (*SHost) GetStorageInfo

func (self *SHost) GetStorageInfo() []SHostStorageInfo

func (*SHost) GetStorageSizeMB

func (self *SHost) GetStorageSizeMB() int

func (*SHost) GetStorageType

func (self *SHost) GetStorageType() string

func (*SHost) GetSysInfo

func (self *SHost) GetSysInfo() jsonutils.JSONObject

func (*SHost) GetTemplateVMById

func (self *SHost) GetTemplateVMById(id string) (*SVirtualMachine, error)

func (*SHost) GetTemplateVMs

func (self *SHost) GetTemplateVMs() ([]*SVirtualMachine, error)

func (*SHost) GetVersion

func (self *SHost) GetVersion() string

func (*SHost) GetoHostSystem

func (host *SHost) GetoHostSystem() *object.HostSystem

func (*SHost) IsActiveVlanID

func (host *SHost) IsActiveVlanID(vlanID int32) bool

IsActiveVlanID will detect if vlanID is active that means vlanID in (1, 4095).

func (*SHost) IsEmulated

func (self *SHost) IsEmulated() bool

func (*SHost) IsManagedByVCenter

func (host *SHost) IsManagedByVCenter() bool

func (*SHost) Refresh

func (self *SHost) Refresh() error

func (*SHost) SyncResourcePool

func (host *SHost) SyncResourcePool(name string) (*object.ResourcePool, error)

type SHostNicInfo

type SHostNicInfo struct {
	Dev     string
	Driver  string
	Mac     string
	Index   int8
	LinkUp  bool
	IpAddr  string
	IpAddr6 string
	Mtu     int32
	NicType string

	DVPortGroup string

	IpAddrPrefixLen  int8
	IpAddr6PrefixLen int8
}

func (*SHostNicInfo) GetBridge

func (nic *SHostNicInfo) GetBridge() string

func (*SHostNicInfo) GetDVPortGroup

func (nic *SHostNicInfo) GetDVPortGroup() string

func (*SHostNicInfo) GetDevice

func (nic *SHostNicInfo) GetDevice() string

func (*SHostNicInfo) GetDriver

func (nic *SHostNicInfo) GetDriver() string

func (*SHostNicInfo) GetIndex

func (nic *SHostNicInfo) GetIndex() int8

func (*SHostNicInfo) GetIpAddr

func (nic *SHostNicInfo) GetIpAddr() string

func (*SHostNicInfo) GetIpAddr6

func (nic *SHostNicInfo) GetIpAddr6() string

func (*SHostNicInfo) GetIpAddr6PrefixLen

func (nic *SHostNicInfo) GetIpAddr6PrefixLen() int8

func (*SHostNicInfo) GetIpAddrPrefixLen

func (nic *SHostNicInfo) GetIpAddrPrefixLen() int8

func (*SHostNicInfo) GetMac

func (nic *SHostNicInfo) GetMac() string

func (*SHostNicInfo) GetMtu

func (nic *SHostNicInfo) GetMtu() int32

func (*SHostNicInfo) GetNicType

func (nic *SHostNicInfo) GetNicType() string

func (*SHostNicInfo) IsLinkUp

func (nic *SHostNicInfo) IsLinkUp() tristate.TriState

type SHostStorageAdapterInfo

type SHostStorageAdapterInfo struct {
	Device    string
	Model     string
	Driver    string
	Pci       string
	Drivers   []*SHostStorageDriverInfo
	Enclosure int
}

type SHostStorageDriverInfo

type SHostStorageDriverInfo struct {
	CN       string
	Name     string
	Model    string
	Vendor   string
	Revision string
	Status   string
	SSD      bool
	Dev      string
	Size     int
	Slot     int
}

type SHostStorageEnclosureInfo

type SHostStorageEnclosureInfo struct {
	CN       string
	Name     string
	Model    string
	Vendor   string
	Revision string
	Status   string
}

type SHostStorageInfo

type SHostStorageInfo struct {
	Adapter int
	Driver  string
	Index   int
	Model   string
	Rotate  bool
	Status  string
	Size    int
}

type SIPPool

type SIPPool struct {
	// contains filtered or unexported fields
}

func NewIPPool

func NewIPPool(size ...int) SIPPool

func (*SIPPool) Get

func (p *SIPPool) Get(ip netutils.IPV4Addr) (SIPProc, bool)

func (*SIPPool) Has

func (p *SIPPool) Has(ip netutils.IPV4Addr) bool

func (*SIPPool) Insert

func (p *SIPPool) Insert(ip netutils.IPV4Addr, proc SIPProc)

func (*SIPPool) Len

func (p *SIPPool) Len() int

func (*SIPPool) Merge

func (p *SIPPool) Merge(op *SIPPool)

type SIPProc

type SIPProc struct {
	VSId   string
	VlanId int32
	IsHost bool
}

type SIPVlan

type SIPVlan struct {
	IP     netutils.IPV4Addr
	VlanId int32
}

type SImage

type SImage struct {
	multicloud.SImageBase
	multicloud.STagBase
	// contains filtered or unexported fields
}

func (*SImage) Delete

func (self *SImage) Delete(ctx context.Context) error

func (*SImage) GetBios

func (img *SImage) GetBios() cloudprovider.TBiosType

func (*SImage) GetCreatedAt

func (self *SImage) GetCreatedAt() time.Time

func (*SImage) GetFullOsName

func (img *SImage) GetFullOsName() string

func (*SImage) GetGlobalId

func (self *SImage) GetGlobalId() string

func (*SImage) GetIStoragecache

func (self *SImage) GetIStoragecache() cloudprovider.ICloudStoragecache

func (*SImage) GetId

func (self *SImage) GetId() string

func (*SImage) GetImageFormat

func (self *SImage) GetImageFormat() string

func (*SImage) GetImageStatus

func (self *SImage) GetImageStatus() string

func (*SImage) GetImageType

func (self *SImage) GetImageType() cloudprovider.TImageType

func (*SImage) GetMinOsDiskSizeGb

func (self *SImage) GetMinOsDiskSizeGb() int

func (*SImage) GetMinRamSizeMb

func (self *SImage) GetMinRamSizeMb() int

func (*SImage) GetName

func (self *SImage) GetName() string

func (*SImage) GetOsArch

func (img *SImage) GetOsArch() string

func (*SImage) GetOsDist

func (img *SImage) GetOsDist() string

func (*SImage) GetOsLang

func (img *SImage) GetOsLang() string

func (*SImage) GetOsType

func (img *SImage) GetOsType() cloudprovider.TOsType

func (*SImage) GetOsVersion

func (img *SImage) GetOsVersion() string

func (*SImage) GetSizeByte

func (self *SImage) GetSizeByte() int64

func (*SImage) GetStatus

func (self *SImage) GetStatus() string

func (*SImage) IsEmulated

func (self *SImage) IsEmulated() bool

func (*SImage) Refresh

func (self *SImage) Refresh() error

type SMacIps

type SMacIps struct {
	Mac string
	IPs []string
}

type SManagedObject

type SManagedObject struct {
	// contains filtered or unexported fields
}

func (*SManagedObject) GetDatacenter

func (self *SManagedObject) GetDatacenter() (*SDatacenter, error)

func (*SManagedObject) GetDatacenterPath

func (self *SManagedObject) GetDatacenterPath() []string

func (*SManagedObject) GetDatacenterPathString

func (self *SManagedObject) GetDatacenterPathString() string

func (*SManagedObject) GetId

func (self *SManagedObject) GetId() string

func (*SManagedObject) GetName

func (self *SManagedObject) GetName() string

func (*SManagedObject) GetPath

func (self *SManagedObject) GetPath() []string

func (*SManagedObject) GetType

func (self *SManagedObject) GetType() string

type SNetwork

type SNetwork struct {
	SManagedObject
	HostPortGroup types.HostPortGroup
}

func NewNetwork

func NewNetwork(manager *SESXiClient, net *mo.Network, dc *SDatacenter) *SNetwork

func (*SNetwork) ContainHost

func (net *SNetwork) ContainHost(host *SHost) bool

func (*SNetwork) GetActivePorts

func (net *SNetwork) GetActivePorts() []string

func (*SNetwork) GetName

func (net *SNetwork) GetName() string

func (*SNetwork) GetNumPorts

func (net *SNetwork) GetNumPorts() int32

func (*SNetwork) GetType

func (net *SNetwork) GetType() string

func (*SNetwork) GetVlanId

func (net *SNetwork) GetVlanId() int32

func (*SNetwork) GetVlanMode

func (net *SNetwork) GetVlanMode() string

func (*SNetwork) SetHostPortGroup

func (net *SNetwork) SetHostPortGroup(pg types.HostPortGroup)

type SNetworkInfo

type SNetworkInfo struct {
	SNetworkInfoBase

	HostIps map[string]netutils.IPV4Addr
	VlanIps map[int32][]netutils.IPV4Addr
}

func (*SNetworkInfo) Insert

func (s *SNetworkInfo) Insert(proc SIPProc, ip netutils.IPV4Addr)

type SNetworkInfoBase

type SNetworkInfoBase struct {
	VMs    []SSimpleVM
	IPPool SIPPool
}

func (*SNetworkInfoBase) AppendVMs

func (s *SNetworkInfoBase) AppendVMs(name string, IpVlans []SIPVlan)

func (*SNetworkInfoBase) Insert

func (s *SNetworkInfoBase) Insert(proc SIPProc, ip netutils.IPV4Addr)

type SNetworkInfoPro

type SNetworkInfoPro struct {
	SNetworkInfoBase

	HostIps map[string][]netutils.IPV4Addr
	VsMap   SVirtualSwitchMap
}

func (*SNetworkInfoPro) Insert

func (s *SNetworkInfoPro) Insert(proc SIPProc, ip netutils.IPV4Addr)

type SOsInfo

type SOsInfo struct {
	OsType         TOSType
	OsDistribution string
	OsVersion      string
	OsArch         TOSArch
}

type SResourcePool

type SResourcePool struct {
	multicloud.SProjectBase
	multicloud.STagBase
	SManagedObject
}

func NewResourcePool

func NewResourcePool(manager *SESXiClient, rp *mo.ResourcePool, dc *SDatacenter) *SResourcePool

func (*SResourcePool) GetGlobalId

func (pool *SResourcePool) GetGlobalId() string

func (*SResourcePool) GetName

func (pool *SResourcePool) GetName() string

func (*SResourcePool) GetStatus

func (pool *SResourcePool) GetStatus() string

type SSimpleHostDev

type SSimpleHostDev struct {
	Name string
	Id   string
	Mac  string
}

type SSimpleVM

type SSimpleVM struct {
	Name    string
	IPVlans []SIPVlan
}

type SSysInfo

type SSysInfo struct {
	Manufacture  string
	Model        string
	SerialNumber string
}

type SVMIPInfo

type SVMIPInfo struct {
	Moid       string
	PowerState string
	Name       string
	Uuid       string
	MacIps     []SMacIps
}

type SVMTemplate

type SVMTemplate struct {
	multicloud.SImageBase
	multicloud.STagBase
	// contains filtered or unexported fields
}

func NewVMTemplate

func NewVMTemplate(vm *SVirtualMachine, cache *SDatastoreImageCache) *SVMTemplate

func (*SVMTemplate) Delete

func (t *SVMTemplate) Delete(ctx context.Context) error

func (*SVMTemplate) GetBios

func (t *SVMTemplate) GetBios() cloudprovider.TBiosType

func (*SVMTemplate) GetCreatedAt

func (t *SVMTemplate) GetCreatedAt() time.Time

GetCreatedAt return vm's create time by getting the sys disk's create time

func (*SVMTemplate) GetFullOsName

func (t *SVMTemplate) GetFullOsName() string

func (*SVMTemplate) GetGlobalId

func (t *SVMTemplate) GetGlobalId() string

func (*SVMTemplate) GetIStoragecache

func (t *SVMTemplate) GetIStoragecache() cloudprovider.ICloudStoragecache

func (*SVMTemplate) GetId

func (t *SVMTemplate) GetId() string

func (*SVMTemplate) GetImageFormat

func (t *SVMTemplate) GetImageFormat() string

func (*SVMTemplate) GetImageStatus

func (t *SVMTemplate) GetImageStatus() string

func (*SVMTemplate) GetImageType

func (t *SVMTemplate) GetImageType() cloudprovider.TImageType

func (*SVMTemplate) GetMinOsDiskSizeGb

func (t *SVMTemplate) GetMinOsDiskSizeGb() int

func (*SVMTemplate) GetMinRamSizeMb

func (t *SVMTemplate) GetMinRamSizeMb() int

func (*SVMTemplate) GetName

func (t *SVMTemplate) GetName() string

func (*SVMTemplate) GetOsArch

func (t *SVMTemplate) GetOsArch() string

func (*SVMTemplate) GetOsDist

func (t *SVMTemplate) GetOsDist() string

func (*SVMTemplate) GetOsLang

func (t *SVMTemplate) GetOsLang() string

func (*SVMTemplate) GetOsType

func (t *SVMTemplate) GetOsType() cloudprovider.TOsType

func (*SVMTemplate) GetOsVersion

func (t *SVMTemplate) GetOsVersion() string

func (*SVMTemplate) GetSizeByte

func (t *SVMTemplate) GetSizeByte() int64

func (*SVMTemplate) GetStatus

func (t *SVMTemplate) GetStatus() string

func (*SVMTemplate) GetSubImages

func (t *SVMTemplate) GetSubImages() []cloudprovider.SSubImage

func (*SVMTemplate) IsEmulated

func (t *SVMTemplate) IsEmulated() bool

func (*SVMTemplate) Refresh

func (t *SVMTemplate) Refresh() error

type SVirtualCdrom

type SVirtualCdrom struct {
	SVirtualDevice
}

func NewVirtualCdrom

func NewVirtualCdrom(vm *SVirtualMachine, dev types.BaseVirtualDevice, index int) SVirtualCdrom

type SVirtualDevice

type SVirtualDevice struct {
	// contains filtered or unexported fields
}

func NewVirtualDevice

func NewVirtualDevice(vm *SVirtualMachine, dev types.BaseVirtualDevice, index int) SVirtualDevice

func (*SVirtualDevice) GetDriver

func (dev *SVirtualDevice) GetDriver() string

func (*SVirtualDevice) GetIndex

func (dev *SVirtualDevice) GetIndex() int

type SVirtualDisk

type SVirtualDisk struct {
	multicloud.SDisk
	multicloud.STagBase

	SVirtualDevice
	IsRoot bool
}

func NewVirtualDisk

func NewVirtualDisk(vm *SVirtualMachine, dev types.BaseVirtualDevice, index int) SVirtualDisk

func (*SVirtualDisk) CreateISnapshot

func (disk *SVirtualDisk) CreateISnapshot(ctx context.Context, name string, desc string) (cloudprovider.ICloudSnapshot, error)

func (*SVirtualDisk) Delete

func (disk *SVirtualDisk) Delete(ctx context.Context) error

func (*SVirtualDisk) GetAccessPath

func (disk *SVirtualDisk) GetAccessPath() string

func (*SVirtualDisk) GetBillingType

func (disk *SVirtualDisk) GetBillingType() string

func (*SVirtualDisk) GetCacheMode

func (disk *SVirtualDisk) GetCacheMode() string

func (*SVirtualDisk) GetCreatedAt

func (disk *SVirtualDisk) GetCreatedAt() time.Time

GetCreatedAt return create time by getting the Data of file stored at disk.GetAccessPath

func (*SVirtualDisk) GetDiskFormat

func (disk *SVirtualDisk) GetDiskFormat() string

func (*SVirtualDisk) GetDiskSizeMB

func (disk *SVirtualDisk) GetDiskSizeMB() int

func (*SVirtualDisk) GetDiskType

func (disk *SVirtualDisk) GetDiskType() string

func (*SVirtualDisk) GetDriver

func (disk *SVirtualDisk) GetDriver() string

func (*SVirtualDisk) GetExpiredAt

func (disk *SVirtualDisk) GetExpiredAt() time.Time

func (*SVirtualDisk) GetFilename

func (disk *SVirtualDisk) GetFilename() string

func (*SVirtualDisk) GetFsFormat

func (disk *SVirtualDisk) GetFsFormat() string

func (*SVirtualDisk) GetGlobalId

func (disk *SVirtualDisk) GetGlobalId() string

func (*SVirtualDisk) GetISnapshot

func (disk *SVirtualDisk) GetISnapshot(idStr string) (cloudprovider.ICloudSnapshot, error)

func (*SVirtualDisk) GetISnapshots

func (disk *SVirtualDisk) GetISnapshots() ([]cloudprovider.ICloudSnapshot, error)

func (*SVirtualDisk) GetIStorage

func (disk *SVirtualDisk) GetIStorage() (cloudprovider.ICloudStorage, error)

func (*SVirtualDisk) GetId

func (disk *SVirtualDisk) GetId() string

func (*SVirtualDisk) GetIsAutoDelete

func (disk *SVirtualDisk) GetIsAutoDelete() bool

func (*SVirtualDisk) GetIsNonPersistent

func (disk *SVirtualDisk) GetIsNonPersistent() bool

func (*SVirtualDisk) GetMountpoint

func (disk *SVirtualDisk) GetMountpoint() string

func (*SVirtualDisk) GetName

func (disk *SVirtualDisk) GetName() string

func (*SVirtualDisk) GetProjectId

func (disk *SVirtualDisk) GetProjectId() string

func (*SVirtualDisk) GetStatus

func (disk *SVirtualDisk) GetStatus() string

func (*SVirtualDisk) GetTemplateId

func (disk *SVirtualDisk) GetTemplateId() string

func (*SVirtualDisk) IsEmulated

func (disk *SVirtualDisk) IsEmulated() bool

func (*SVirtualDisk) MatchId

func (disk *SVirtualDisk) MatchId(id string) bool

func (*SVirtualDisk) Rebuild

func (disk *SVirtualDisk) Rebuild(ctx context.Context) error

func (*SVirtualDisk) Refresh

func (disk *SVirtualDisk) Refresh() error

func (*SVirtualDisk) Reset

func (disk *SVirtualDisk) Reset(ctx context.Context, snapshotId string) (string, error)

func (*SVirtualDisk) Resize

func (disk *SVirtualDisk) Resize(ctx context.Context, newSizeMb int64) error

func (*SVirtualDisk) ResizePartition

func (disk *SVirtualDisk) ResizePartition(ctx context.Context, accessInfo vcenter.SVCenterAccessInfo) error

type SVirtualMachine

type SVirtualMachine struct {
	multicloud.SInstanceBase
	multicloud.STagBase
	SManagedObject
	// contains filtered or unexported fields
}

func NewVirtualMachine

func NewVirtualMachine(manager *SESXiClient, vm *mo.VirtualMachine, dc *SDatacenter) *SVirtualMachine

func (*SVirtualMachine) AssignSecurityGroup

func (self *SVirtualMachine) AssignSecurityGroup(secgroupId string) error

func (*SVirtualMachine) AttachDisk

func (self *SVirtualMachine) AttachDisk(ctx context.Context, diskId string) error

func (*SVirtualMachine) ChangeConfig

func (self *SVirtualMachine) ChangeConfig(ctx context.Context, config *cloudprovider.SManagedVMChangeConfig) error

func (*SVirtualMachine) CheckFileInfo

func (self *SVirtualMachine) CheckFileInfo(ctx context.Context) error

func (*SVirtualMachine) ConvertPublicIpToEip

func (self *SVirtualMachine) ConvertPublicIpToEip() error

func (*SVirtualMachine) CreateDisk

func (*SVirtualMachine) CreateInstanceSnapshot

func (self *SVirtualMachine) CreateInstanceSnapshot(ctx context.Context, name string, desc string) (cloudprovider.ICloudInstanceSnapshot, error)

func (*SVirtualMachine) DeleteVM

func (self *SVirtualMachine) DeleteVM(ctx context.Context) error

func (*SVirtualMachine) DeployVM

func (self *SVirtualMachine) DeployVM(ctx context.Context, name string, username string, password string, publicKey string, deleteKeypair bool, description string) error

func (*SVirtualMachine) DetachDisk

func (self *SVirtualMachine) DetachDisk(ctx context.Context, diskId string) error

func (*SVirtualMachine) DoCustomize

func (self *SVirtualMachine) DoCustomize(ctx context.Context, params jsonutils.JSONObject) error

func (*SVirtualMachine) DoRebuildRoot

func (self *SVirtualMachine) DoRebuildRoot(ctx context.Context, imagePath string, uuid string) error

func (*SVirtualMachine) DoRename

func (self *SVirtualMachine) DoRename(ctx context.Context, name string) error

func (*SVirtualMachine) ExportTemplate

func (self *SVirtualMachine) ExportTemplate(ctx context.Context, idx int, diskPath string) error

func (*SVirtualMachine) FindController

func (self *SVirtualMachine) FindController(ctx context.Context, driver string) ([]SVirtualDevice, error)

func (*SVirtualMachine) FindDiskByDriver

func (self *SVirtualMachine) FindDiskByDriver(drivers ...string) []SVirtualDisk

func (*SVirtualMachine) FindMinDiffKey

func (self *SVirtualMachine) FindMinDiffKey(limit int32) int32

func (*SVirtualMachine) GetBillingType

func (self *SVirtualMachine) GetBillingType() string

func (*SVirtualMachine) GetBios

func (vm *SVirtualMachine) GetBios() cloudprovider.TBiosType

func (*SVirtualMachine) GetBootOrder

func (self *SVirtualMachine) GetBootOrder() string

func (*SVirtualMachine) GetCreatedAt

func (self *SVirtualMachine) GetCreatedAt() time.Time

func (*SVirtualMachine) GetError

func (self *SVirtualMachine) GetError() error

func (*SVirtualMachine) GetExpiredAt

func (self *SVirtualMachine) GetExpiredAt() time.Time

func (*SVirtualMachine) GetFullOsName

func (vm *SVirtualMachine) GetFullOsName() string

func (*SVirtualMachine) GetGlobalId

func (self *SVirtualMachine) GetGlobalId() string

func (*SVirtualMachine) GetGuestFamily

func (self *SVirtualMachine) GetGuestFamily() string

func (*SVirtualMachine) GetGuestFullName

func (self *SVirtualMachine) GetGuestFullName() string

func (*SVirtualMachine) GetGuestId

func (self *SVirtualMachine) GetGuestId() string

func (*SVirtualMachine) GetGuestState

func (self *SVirtualMachine) GetGuestState() string

func (*SVirtualMachine) GetGuestToolsRunningStatus

func (self *SVirtualMachine) GetGuestToolsRunningStatus() string

func (*SVirtualMachine) GetGuestToolsStatus

func (self *SVirtualMachine) GetGuestToolsStatus() string

func (*SVirtualMachine) GetHostname

func (self *SVirtualMachine) GetHostname() string

func (*SVirtualMachine) GetHypervisor

func (self *SVirtualMachine) GetHypervisor() string

func (*SVirtualMachine) GetIDiskById

func (self *SVirtualMachine) GetIDiskById(idStr string) (cloudprovider.ICloudDisk, error)

func (*SVirtualMachine) GetIDisks

func (self *SVirtualMachine) GetIDisks() ([]cloudprovider.ICloudDisk, error)

func (*SVirtualMachine) GetIEIP

func (self *SVirtualMachine) GetIEIP() (cloudprovider.ICloudEIP, error)

func (*SVirtualMachine) GetIHost

func (self *SVirtualMachine) GetIHost() cloudprovider.ICloudHost

func (*SVirtualMachine) GetIHostId

func (self *SVirtualMachine) GetIHostId() string

func (*SVirtualMachine) GetINics

func (self *SVirtualMachine) GetINics() ([]cloudprovider.ICloudNic, error)

func (*SVirtualMachine) GetInstanceSnapshot

func (self *SVirtualMachine) GetInstanceSnapshot(idStr string) (cloudprovider.ICloudInstanceSnapshot, error)

func (*SVirtualMachine) GetInstanceSnapshots

func (self *SVirtualMachine) GetInstanceSnapshots() ([]cloudprovider.ICloudInstanceSnapshot, error)

func (*SVirtualMachine) GetInstanceType

func (self *SVirtualMachine) GetInstanceType() string

func (*SVirtualMachine) GetIps

func (self *SVirtualMachine) GetIps() []string

func (*SVirtualMachine) GetMachine

func (self *SVirtualMachine) GetMachine() string

func (*SVirtualMachine) GetMoid

func (self *SVirtualMachine) GetMoid() string

func (*SVirtualMachine) GetOsArch

func (vm *SVirtualMachine) GetOsArch() string

func (*SVirtualMachine) GetOsDist

func (vm *SVirtualMachine) GetOsDist() string

func (*SVirtualMachine) GetOsLang

func (vm *SVirtualMachine) GetOsLang() string

func (*SVirtualMachine) GetOsType

func (vm *SVirtualMachine) GetOsType() cloudprovider.TOsType

func (*SVirtualMachine) GetOsVersion

func (vm *SVirtualMachine) GetOsVersion() string

func (*SVirtualMachine) GetProjectId

func (self *SVirtualMachine) GetProjectId() string

func (*SVirtualMachine) GetSecurityGroupIds

func (self *SVirtualMachine) GetSecurityGroupIds() ([]string, error)

func (*SVirtualMachine) GetSerialOutput

func (self *SVirtualMachine) GetSerialOutput(port int) (string, error)

func (*SVirtualMachine) GetStatus

func (self *SVirtualMachine) GetStatus() string

func (*SVirtualMachine) GetSysTags

func (self *SVirtualMachine) GetSysTags() map[string]string

func (*SVirtualMachine) GetToolsVersion

func (self *SVirtualMachine) GetToolsVersion() string

func (*SVirtualMachine) GetVGADevice

func (self *SVirtualMachine) GetVGADevice() string

func (*SVirtualMachine) GetVNCInfo

func (*SVirtualMachine) GetVcpuCount

func (self *SVirtualMachine) GetVcpuCount() int

func (*SVirtualMachine) GetVdi

func (self *SVirtualMachine) GetVdi() string

func (*SVirtualMachine) GetVersion

func (self *SVirtualMachine) GetVersion() string

func (*SVirtualMachine) GetVga

func (self *SVirtualMachine) GetVga() string

func (*SVirtualMachine) GetVmemSizeMB

func (self *SVirtualMachine) GetVmemSizeMB() int

func (*SVirtualMachine) GetVmrcInfo

func (self *SVirtualMachine) GetVmrcInfo() (*cloudprovider.ServerVncOutput, error)

func (*SVirtualMachine) GetWebmksInfo

func (self *SVirtualMachine) GetWebmksInfo() (*cloudprovider.ServerVncOutput, error)

func (*SVirtualMachine) IsAutoRenew

func (self *SVirtualMachine) IsAutoRenew() bool

func (*SVirtualMachine) IsEmulated

func (self *SVirtualMachine) IsEmulated() bool

func (*SVirtualMachine) IsTemplate

func (self *SVirtualMachine) IsTemplate() bool

func (*SVirtualMachine) LiveMigrateVM

func (self *SVirtualMachine) LiveMigrateVM(hostId string) error

func (*SVirtualMachine) MigrateVM

func (self *SVirtualMachine) MigrateVM(hostId string) error

func (*SVirtualMachine) RebuildRoot

func (*SVirtualMachine) Refresh

func (self *SVirtualMachine) Refresh() error

func (*SVirtualMachine) Renew

func (self *SVirtualMachine) Renew(bc billing.SBillingCycle) error

func (*SVirtualMachine) ResetToInstanceSnapshot

func (self *SVirtualMachine) ResetToInstanceSnapshot(ctx context.Context, idStr string) error

func (*SVirtualMachine) ResumeVM

func (self *SVirtualMachine) ResumeVM(ctx context.Context) error

func (*SVirtualMachine) SetAutoRenew

func (self *SVirtualMachine) SetAutoRenew(bc billing.SBillingCycle) error

func (*SVirtualMachine) SetSecurityGroups

func (self *SVirtualMachine) SetSecurityGroups(secgroupIds []string) error

func (*SVirtualMachine) StartVM

func (self *SVirtualMachine) StartVM(ctx context.Context) error

ideopotent start

func (*SVirtualMachine) StopVM

func (*SVirtualMachine) SuspendVM

func (self *SVirtualMachine) SuspendVM(ctx context.Context) error

func (*SVirtualMachine) UpdateUserData

func (self *SVirtualMachine) UpdateUserData(userData string) error

func (*SVirtualMachine) UpdateVM

func (self *SVirtualMachine) UpdateVM(ctx context.Context, name string) error

type SVirtualMachineSnapshot

type SVirtualMachineSnapshot struct {
	multicloud.SResourceBase
	multicloud.STagBase
	// contains filtered or unexported fields
}

func (*SVirtualMachineSnapshot) Delete

func (s *SVirtualMachineSnapshot) Delete() error

func (*SVirtualMachineSnapshot) GetDescription

func (s *SVirtualMachineSnapshot) GetDescription() string

func (*SVirtualMachineSnapshot) GetGlobalId

func (s *SVirtualMachineSnapshot) GetGlobalId() string

func (*SVirtualMachineSnapshot) GetId

func (s *SVirtualMachineSnapshot) GetId() string

func (*SVirtualMachineSnapshot) GetName

func (s *SVirtualMachineSnapshot) GetName() string

func (*SVirtualMachineSnapshot) GetProjectId

func (s *SVirtualMachineSnapshot) GetProjectId() string

func (*SVirtualMachineSnapshot) GetStatus

func (s *SVirtualMachineSnapshot) GetStatus() string

func (*SVirtualMachineSnapshot) IsEmulated

func (s *SVirtualMachineSnapshot) IsEmulated() bool

func (*SVirtualMachineSnapshot) Refresh

func (s *SVirtualMachineSnapshot) Refresh() error

type SVirtualNIC

type SVirtualNIC struct {
	SVirtualDevice

	cloudprovider.DummyICloudNic
}

func NewVirtualNIC

func NewVirtualNIC(vm *SVirtualMachine, dev types.BaseVirtualDevice, index int) SVirtualNIC

func (*SVirtualNIC) GetDriver

func (nic *SVirtualNIC) GetDriver() string

func (*SVirtualNIC) GetINetworkId

func (nic *SVirtualNIC) GetINetworkId() string

func (*SVirtualNIC) GetIP

func (nic *SVirtualNIC) GetIP() string

func (*SVirtualNIC) GetId

func (nic *SVirtualNIC) GetId() string

func (*SVirtualNIC) GetMAC

func (nic *SVirtualNIC) GetMAC() string

func (*SVirtualNIC) InClassicNetwork

func (nic *SVirtualNIC) InClassicNetwork() bool

type SVirtualSwitch

type SVirtualSwitch struct {
	Host              *SHost
	HostVirtualSwitch types.HostVirtualSwitch
}

func (*SVirtualSwitch) FindNetworkByVlanID

func (vs *SVirtualSwitch) FindNetworkByVlanID(vlanID int32) (IVMNetwork, error)

type SVirtualSwitchMap

type SVirtualSwitchMap struct {
	// contains filtered or unexported fields
}

func NewVirtualSwitchMap

func NewVirtualSwitchMap(length ...int) SVirtualSwitchMap

func (*SVirtualSwitchMap) AddVlanIp

func (vsm *SVirtualSwitchMap) AddVlanIp(id string, vlanId int32, ip netutils.IPV4Addr) bool

func (*SVirtualSwitchMap) Insert

func (vsm *SVirtualSwitchMap) Insert(id string, vs SVirtualSwitchSpec)

func (*SVirtualSwitchMap) List

func (vsm *SVirtualSwitchMap) List() []SVirtualSwitchSpec

func (*SVirtualSwitchMap) Merge

func (vms *SVirtualSwitchMap) Merge(ovsm *SVirtualSwitchMap)

type SVirtualSwitchSpec

type SVirtualSwitchSpec struct {
	Name        string
	Id          string
	Distributed bool
	Hosts       []SSimpleHostDev
	HostIps     map[string][]netutils.IPV4Addr
	Vlans       map[int32][]netutils.IPV4Addr
}

func NewVirtualSwitch

func NewVirtualSwitch() *SVirtualSwitchSpec

func (*SVirtualSwitchSpec) Merge

func (vs *SVirtualSwitchSpec) Merge(vsc *SVirtualSwitchSpec)

type SVirtualVGA

type SVirtualVGA struct {
	SVirtualDevice
}

func NewVirtualVGA

func NewVirtualVGA(vm *SVirtualMachine, dev types.BaseVirtualDevice, index int) SVirtualVGA

func (*SVirtualVGA) GetEnable3D

func (vga *SVirtualVGA) GetEnable3D() bool

func (*SVirtualVGA) GetRamSizeMB

func (vga *SVirtualVGA) GetRamSizeMB() int

func (*SVirtualVGA) String

func (vga *SVirtualVGA) String() string

type TOSArch

type TOSArch string

type TOSType

type TOSType string

type VMFetcher

type VMFetcher interface {
	FetchNoTemplateVMs() ([]*SVirtualMachine, error)
	FetchTemplateVMs() ([]*SVirtualMachine, error)
	FetchFakeTempateVMs(string) ([]*SVirtualMachine, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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