esxi

package
v0.0.0-...-3235d85 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 61 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 (
	True  bool = true
	False bool = false
)
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", "summary", "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", "summary"}
View Source
var RESOURCEPOOL_PROPS = []string{"name", "parent", "host"}
View Source
var VIRTUAL_MACHINE_PROPS = []string{"name", "parent", "resourcePool", "snapshot", "config", "availableField", "datastore"}
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
	GetPreallocation() string
	GetWriteThrough() bool
	GetFileName() string
	GetDatastore() *types.ManagedObjectReference
}

type INetworkInfo

type INetworkInfo interface {
	Insert(SIPProc, netutils.IPV4Addr)
}

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
	GetType() string

	GetVlanId() int32
	GetVswitchName() string

	Summary() SNetworkSummary
	SummaryText() string

	GetHosts() []types.ManagedObjectReference

	GetDatacenter() (*SDatacenter, error)

	GetPath() []string
}

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
	CpuSockets           int
	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) GetICloudImages

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

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) 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) 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, 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
	Preallocation string
}

type SDiskInfo

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

type SDistributedVirtualPortgroup

type SDistributedVirtualPortgroup struct {
	SManagedObject
}

func (*SDistributedVirtualPortgroup) AddHostToDVS

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

func (*SDistributedVirtualPortgroup) FindPort

func (*SDistributedVirtualPortgroup) GetActivePorts

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

func (*SDistributedVirtualPortgroup) GetDVSUuid

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

func (*SDistributedVirtualPortgroup) GetHosts

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) GetVswitchName

func (net *SDistributedVirtualPortgroup) GetVswitchName() string

func (*SDistributedVirtualPortgroup) Summary

func (*SDistributedVirtualPortgroup) SummaryText

func (net *SDistributedVirtualPortgroup) SummaryText() string
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

	multicloud.SRegion
	multicloud.SRegionEipBase
	multicloud.SNoObjectStorageRegion
	multicloud.SRegionLbBase
	// 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) CreateISecurityGroup

func (*SESXiClient) CreateIVpc

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) GetCloudEnv

func (client *SESXiClient) GetCloudEnv() string

func (*SESXiClient) GetDatacenters

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

func (*SESXiClient) GetEcsMetrics

func (*SESXiClient) GetGeographicInfo

func (client *SESXiClient) GetGeographicInfo() cloudprovider.SGeographicInfo

func (*SESXiClient) GetGlobalId

func (client *SESXiClient) GetGlobalId() string

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) GetIProjects

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

func (*SESXiClient) GetISecurityGroupById

func (client *SESXiClient) GetISecurityGroupById(id string) (cloudprovider.ICloudSecurityGroup, 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) GetIVMs

func (cli *SESXiClient) GetIVMs() ([]cloudprovider.ICloudVM, error)

func (*SESXiClient) GetIVpcById

func (client *SESXiClient) GetIVpcById(id string) (cloudprovider.ICloudVpc, error)

func (*SESXiClient) GetIVpcs

func (cli *SESXiClient) GetIVpcs() ([]cloudprovider.ICloudVpc, error)

func (*SESXiClient) GetIZoneById

func (client *SESXiClient) GetIZoneById(id string) (cloudprovider.ICloudZone, error)

func (*SESXiClient) GetIZones

func (client *SESXiClient) GetIZones() ([]cloudprovider.ICloudZone, error)

func (*SESXiClient) GetId

func (client *SESXiClient) GetId() string

func (*SESXiClient) GetMetricTypes

func (self *SESXiClient) GetMetricTypes() ([]SEsxiMetricType, error)

func (*SESXiClient) GetMetrics

func (*SESXiClient) GetName

func (client *SESXiClient) GetName() string

func (*SESXiClient) GetNetworks

func (cli *SESXiClient) GetNetworks() ([]IVMNetwork, error)

func (*SESXiClient) GetProvider

func (cli *SESXiClient) GetProvider() string

func (*SESXiClient) GetStatus

func (client *SESXiClient) GetStatus() string

func (*SESXiClient) GetSubAccounts

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

func (*SESXiClient) GetSysTags

func (client *SESXiClient) GetSysTags() map[string]string

func (*SESXiClient) GetTags

func (client *SESXiClient) GetTags() (map[string]string, 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) IsEmulated

func (client *SESXiClient) IsEmulated() bool

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) Refresh

func (client *SESXiClient) Refresh() 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) SetTags

func (client *SESXiClient) SetTags(tags map[string]string, replace bool) 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 SEsxiMetricType

type SEsxiMetricType struct {
	Key     string
	KeyId   int32
	Summary string
	Group   string
	Unit    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 (host *SHost) CreateVM2(ctx context.Context, ds *SDatastore, params SCreateVMParam) (needDeploy bool, vm *SVirtualMachine, err error)

func (*SHost) DoCreateVM

func (host *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) GetAccessIp

func (host *SHost) GetAccessIp() string

func (*SHost) GetAccessMac

func (host *SHost) GetAccessMac() string

func (*SHost) GetCluster

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

func (*SHost) GetCpuCount

func (host *SHost) GetCpuCount() int

func (*SHost) GetCpuDesc

func (host *SHost) GetCpuDesc() string

func (*SHost) GetCpuMhz

func (host *SHost) GetCpuMhz() int

func (*SHost) GetDataStores

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

func (*SHost) GetEnabled

func (host *SHost) GetEnabled() bool

func (*SHost) GetGlobalId

func (host *SHost) GetGlobalId() string

func (*SHost) GetHostStatus

func (host *SHost) GetHostStatus() string

func (*SHost) GetHostSystem

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

func (*SHost) GetHostType

func (host *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 (host *SHost) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SHost) GetIStorages

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

func (*SHost) GetIVMById

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

func (*SHost) GetIVMs

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

func (*SHost) GetIVMs2

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

func (*SHost) GetIsMaintenance

func (host *SHost) GetIsMaintenance() bool

func (*SHost) GetManagementServerIp

func (host *SHost) GetManagementServerIp() string

func (*SHost) GetMemSizeMB

func (host *SHost) GetMemSizeMB() int

func (*SHost) GetName

func (host *SHost) GetName() string

func (*SHost) GetNetworks

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

func (*SHost) GetNodeCount

func (host *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 (host *SHost) GetSN() string

func (*SHost) GetSchedtags

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

func (*SHost) GetSiblingHosts

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

func (*SHost) GetStatus

func (host *SHost) GetStatus() string

func (*SHost) GetStorageInfo

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

func (*SHost) GetStorageSizeMB

func (host *SHost) GetStorageSizeMB() int64

func (*SHost) GetStorageType

func (host *SHost) GetStorageType() string

func (*SHost) GetSysInfo

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

func (*SHost) GetSysTags

func (host *SHost) GetSysTags() map[string]string

func (*SHost) GetTemplateVMById

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

func (*SHost) GetTemplateVMs

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

func (*SHost) GetVersion

func (host *SHost) GetVersion() string

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 (host *SHost) IsEmulated() bool

func (*SHost) IsManagedByVCenter

func (host *SHost) IsManagedByVCenter() bool

func (*SHost) Refresh

func (host *SHost) Refresh() error

func (*SHost) SearchTemplateVM

func (host *SHost) SearchTemplateVM(id string) (*SVirtualMachine, error)

func (*SHost) SyncResourcePool

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

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
}

func NewNetwork

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

func (*SNetwork) GetHosts

func (net *SNetwork) GetHosts() []types.ManagedObjectReference

func (*SNetwork) GetName

func (net *SNetwork) GetName() string

func (*SNetwork) GetType

func (net *SNetwork) GetType() string

func (*SNetwork) GetVlanId

func (net *SNetwork) GetVlanId() int32

func (*SNetwork) GetVswitchName

func (net *SNetwork) GetVswitchName() string

func (*SNetwork) Summary

func (net *SNetwork) Summary() SNetworkSummary

func (*SNetwork) SummaryText

func (net *SNetwork) SummaryText() string

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) Insert

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

type SNetworkInfoPro

type SNetworkInfoPro struct {
	SNetworkInfoBase

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

type SNetworkSummary

type SNetworkSummary struct {
	Name       string
	Accessible bool
	IpPoolName string
	IpPoolId   int32
}

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 SServerNic

type SServerNic struct {
	Name      string `json:"name"`
	Index     int    `json:"index"`
	Bridge    string `json:"bridge"`
	Domain    string `json:"domain"`
	Ip        string `json:"ip"`
	Vlan      int    `json:"vlan"`
	Driver    string `json:"driver"`
	Masklen   int    `json:"masklen"`
	Virtual   bool   `json:"virtual"`
	Manual    bool   `json:"manual"`
	WireId    string `json:"wire_id"`
	NetId     string `json:"net_id"`
	Mac       string `json:"mac"`
	BandWidth int    `json:"bw"`
	Mtu       int    `json:"mtu,omitempty"`
	Dns       string `json:"dns"`
	Ntp       string `json:"ntp"`
	Net       string `json:"net"`
	Interface string `json:"interface"`
	Gateway   string `json:"gateway"`
	Ifname    string `json:"ifname"`
	NicType   string `json:"nic_type,omitempty"`
	LinkUp    bool   `json:"link_up,omitempty"`
	TeamWith  string `json:"team_with,omitempty"`

	TeamingMaster *SServerNic   `json:"-"`
	TeamingSlaves []*SServerNic `json:"-"`
}

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) GetIStorageId

func (disk *SVirtualDisk) GetIStorageId() string

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) GetPreallocation

func (disk *SVirtualDisk) GetPreallocation() 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

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) AttachDisk

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

func (*SVirtualMachine) ChangeConfig

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

func (*SVirtualMachine) CheckFileInfo

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

func (*SVirtualMachine) ConvertPublicIpToEip

func (svm *SVirtualMachine) ConvertPublicIpToEip() error

func (*SVirtualMachine) CopyRootDisk

func (svm *SVirtualMachine) CopyRootDisk(ctx context.Context, imagePath string) (string, error)

func (*SVirtualMachine) CreateDisk

func (*SVirtualMachine) CreateInstanceSnapshot

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

func (*SVirtualMachine) DeleteVM

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

func (*SVirtualMachine) DeployVM

func (*SVirtualMachine) DetachDisk

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

func (*SVirtualMachine) DoCustomize

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

func (*SVirtualMachine) DoRebuildRoot

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

func (*SVirtualMachine) DoRename

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

func (*SVirtualMachine) ExportTemplate

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

func (*SVirtualMachine) FindController

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

func (*SVirtualMachine) FindDiskByDriver

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

func (*SVirtualMachine) FindMinDiffKey

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

func (*SVirtualMachine) GetBillingType

func (svm *SVirtualMachine) GetBillingType() string

func (*SVirtualMachine) GetBios

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

func (*SVirtualMachine) GetBootOrder

func (svm *SVirtualMachine) GetBootOrder() string

func (*SVirtualMachine) GetCpuSockets

func (svm *SVirtualMachine) GetCpuSockets() int

func (*SVirtualMachine) GetCreatedAt

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

func (*SVirtualMachine) GetDatastoreNames

func (vm *SVirtualMachine) GetDatastoreNames() []string

func (*SVirtualMachine) GetDatastores

func (vm *SVirtualMachine) GetDatastores() ([]*SDatastore, error)

func (*SVirtualMachine) GetError

func (svm *SVirtualMachine) GetError() error

func (*SVirtualMachine) GetExpiredAt

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

func (*SVirtualMachine) GetFullOsName

func (vm *SVirtualMachine) GetFullOsName() string

func (*SVirtualMachine) GetGlobalId

func (svm *SVirtualMachine) GetGlobalId() string

func (*SVirtualMachine) GetGuestFamily

func (svm *SVirtualMachine) GetGuestFamily() string

func (*SVirtualMachine) GetGuestFullName

func (svm *SVirtualMachine) GetGuestFullName() string

func (*SVirtualMachine) GetGuestId

func (svm *SVirtualMachine) GetGuestId() string

func (*SVirtualMachine) GetGuestState

func (svm *SVirtualMachine) GetGuestState() string

func (*SVirtualMachine) GetGuestToolsRunningStatus

func (svm *SVirtualMachine) GetGuestToolsRunningStatus() string

func (*SVirtualMachine) GetGuestToolsStatus

func (svm *SVirtualMachine) GetGuestToolsStatus() string

func (*SVirtualMachine) GetHostname

func (svm *SVirtualMachine) GetHostname() string

func (*SVirtualMachine) GetHypervisor

func (svm *SVirtualMachine) GetHypervisor() string

func (*SVirtualMachine) GetIDiskById

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

func (*SVirtualMachine) GetIDisks

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

func (*SVirtualMachine) GetIEIP

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

func (*SVirtualMachine) GetIHost

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

func (*SVirtualMachine) GetIHostId

func (svm *SVirtualMachine) GetIHostId() string

func (*SVirtualMachine) GetINics

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

func (*SVirtualMachine) GetInstanceSnapshot

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

func (*SVirtualMachine) GetInstanceSnapshots

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

func (*SVirtualMachine) GetInstanceType

func (svm *SVirtualMachine) GetInstanceType() string

func (*SVirtualMachine) GetIps

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

func (*SVirtualMachine) GetMachine

func (svm *SVirtualMachine) GetMachine() string

func (*SVirtualMachine) GetMoid

func (svm *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 (svm *SVirtualMachine) GetProjectId() string

func (*SVirtualMachine) GetRootImagePath

func (svm *SVirtualMachine) GetRootImagePath() (string, error)

func (*SVirtualMachine) GetSecurityGroupIds

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

func (*SVirtualMachine) GetSerialOutput

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

func (*SVirtualMachine) GetStatus

func (svm *SVirtualMachine) GetStatus() string

func (*SVirtualMachine) GetSysTags

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

func (*SVirtualMachine) GetTags

func (svm *SVirtualMachine) GetTags() (map[string]string, error)

func (*SVirtualMachine) GetToolsVersion

func (svm *SVirtualMachine) GetToolsVersion() string

func (*SVirtualMachine) GetVGADevice

func (svm *SVirtualMachine) GetVGADevice() string

func (*SVirtualMachine) GetVNCInfo

func (*SVirtualMachine) GetVcpuCount

func (svm *SVirtualMachine) GetVcpuCount() int

func (*SVirtualMachine) GetVdi

func (svm *SVirtualMachine) GetVdi() string

func (*SVirtualMachine) GetVersion

func (svm *SVirtualMachine) GetVersion() string

func (*SVirtualMachine) GetVga

func (svm *SVirtualMachine) GetVga() string

func (*SVirtualMachine) GetVmemSizeMB

func (svm *SVirtualMachine) GetVmemSizeMB() int

func (*SVirtualMachine) GetVmrcInfo

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

func (*SVirtualMachine) GetWebmksInfo

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

func (*SVirtualMachine) IsAutoRenew

func (svm *SVirtualMachine) IsAutoRenew() bool

func (*SVirtualMachine) IsEmulated

func (svm *SVirtualMachine) IsEmulated() bool

func (*SVirtualMachine) IsTemplate

func (svm *SVirtualMachine) IsTemplate() bool

func (*SVirtualMachine) LiveMigrateVM

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

func (*SVirtualMachine) MigrateVM

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

func (*SVirtualMachine) RebuildRoot

func (*SVirtualMachine) Refresh

func (svm *SVirtualMachine) Refresh() error

func (*SVirtualMachine) Renew

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

func (*SVirtualMachine) ResetToInstanceSnapshot

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

func (*SVirtualMachine) ResumeVM

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

func (*SVirtualMachine) SetAutoRenew

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

func (*SVirtualMachine) SetConfig

func (*SVirtualMachine) SetSecurityGroups

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

func (*SVirtualMachine) SetTags

func (svm *SVirtualMachine) SetTags(tags map[string]string, replace bool) error

func (*SVirtualMachine) StartVM

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

ideopotent start

func (*SVirtualMachine) StopVM

func (*SVirtualMachine) SuspendVM

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

func (*SVirtualMachine) UpdateUserData

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

func (*SVirtualMachine) UpdateVM

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) GetSubAddress

func (nic *SVirtualNIC) GetSubAddress() ([]string, error)

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) 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
}

func NewVirtualSwitch

func NewVirtualSwitch() *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