vsphere

package
v0.0.0-...-38b8b32 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteVM

func DeleteVM(vm *object.VirtualMachine) error

DeleteVM deletes a VM

func GetVMIP

func GetVMIP(vm *object.VirtualMachine) (string, error)

GetVMIP returns the first IPv4 IP on the first NIC

Types

type GeneratedKey

type GeneratedKey struct {
	PrivateKey string
	PublicKey  string
}

GeneratedKey is the key pair generated for the run

type MgmtBootstrap

type MgmtBootstrap struct {
	provider.Spec                 `yaml:",inline" json:",inline" mapstructure:",squash"`
	vsphereConfig.ProviderVsphere `yaml:",inline" json:",inline" mapstructure:",squash"`
	Session                       *Session         `yaml:"-" json:"-" mapstructure:"-"`
	TrackedResources              TrackedResources `yaml:"-" json:"-" mapstructure:"-"`
	Prerequisites                 string           `yaml:"-" json:"-" mapstructure:"-"`
}

MgmtBootstrap spec for CAPV

func (*MgmtBootstrap) Client

func (v *MgmtBootstrap) Client() error

Client setups connection to remote vCenter

func (*MgmtBootstrap) Events

func (v *MgmtBootstrap) Events() progress.Events

Events returns the channel of progress messages

func (*MgmtBootstrap) Finalize

func (v *MgmtBootstrap) Finalize() error

Finalize handles saving deliverables and cleaning up the bootstrap VM

func (*MgmtBootstrap) Progress

func (v *MgmtBootstrap) Progress() error

Progress monitors the of the management cluster bootstrapping process

type MgmtBootstrapCAPV

type MgmtBootstrapCAPV struct {
	MgmtBootstrap      `yaml:",inline" json:",inline" mapstructure:",squash"`
	cluster.CAPIConfig `yaml:",inline" json:",inline" mapstructure:",squash"`
}

MgmtBootstrapCAPV is the spec for bootstrapping a CAPV management cluster

func NewMgmtBootstrapCAPV

func NewMgmtBootstrapCAPV(full *MgmtBootstrapCAPV) *MgmtBootstrapCAPV

NewMgmtBootstrapCAPV is a new rke provider

func (*MgmtBootstrapCAPV) Prepare

func (v *MgmtBootstrapCAPV) Prepare() error

Prepare bootstrap VM for capv deployment

func (*MgmtBootstrapCAPV) Provision

func (v *MgmtBootstrapCAPV) Provision() error

Provision calls the process to create the management cluster for CAPV

type MgmtBootstrapRKE

type MgmtBootstrapRKE struct {
	MgmtBootstrap `yaml:",inline" json:",inline" mapstructure:",squash"`
	BootstrapIP   string            `yaml:"BootstrapIP" json:"bootstrapIP"`
	Nodes         map[string]string `yaml:"Nodes" json:"nodes"`
	RKEConfigPath string            `yaml:"RKEConfigPath"`
	Hostname      string            `yaml:"Hostname" json:"hostname"`
	GeneratedKey  GeneratedKey      `yaml:"-" json:"-" mapstructure:"-"`
}

MgmtBootstrapRKE is the spec for bootstrapping a RKE management cluster

func NewMgmtBootstrapRKE

func NewMgmtBootstrapRKE(full *MgmtBootstrapRKE) *MgmtBootstrapRKE

NewMgmtBootstrapRKE is a new rke provider

func (*MgmtBootstrapRKE) Prepare

func (v *MgmtBootstrapRKE) Prepare() error

Prepare bootstrap VM for rke deployment

func (*MgmtBootstrapRKE) Provision

func (v *MgmtBootstrapRKE) Provision() error

Provision calls the process to create the management cluster for RKE

type Session

type Session struct {
	Conn         *govmomi.Client
	Datacenter   *object.Datacenter
	Datastore    *object.Datastore
	Folder       *object.Folder
	ResourcePool *object.ResourcePool
	Network      object.NetworkReference
}

Session holds govmomi connection details

func NewClient

func NewClient(server string, username string, password string) (*Session, error)

NewClient returns a new vsphere Session

func (*Session) CloneTemplate

func (s *Session) CloneTemplate(template *object.VirtualMachine, name string, bootScript string, publicKeys []string, osUser string) (*object.VirtualMachine, error)

CloneTemplate creates a VM from a template

func (*Session) CloneTemplates

func (s *Session) CloneTemplates(clonesSpec ...cloneSpec) (map[string]*object.VirtualMachine, error)

CloneTemplates clones multiple VMs asynchronously

func (*Session) CreateVMFolders

func (s *Session) CreateVMFolders(folderPath string) (map[string]*object.Folder, error)

CreateVMFolders creates all folders in a path like "one/two/three"

func (*Session) DeleteVMFolder

func (s *Session) DeleteVMFolder(folder *object.Folder) (*object.Task, error)

DeleteVMFolder removes a folder from vcenter

func (*Session) DeployOVATemplates

func (s *Session) DeployOVATemplates(templatePaths ...string) (map[string]*object.VirtualMachine, error)

DeployOVATemplates deploys multiple OVAs asynchronously

func (*Session) GetAllFolders

func (s *Session) GetAllFolders() ([]*object.Folder, error)

GetAllFolders returns all folder object in a datacenter

func (*Session) GetDatacenter

func (s *Session) GetDatacenter(name string) (*object.Datacenter, error)

GetDatacenter returns the govmomi object for a datacenter

func (*Session) GetDatastore

func (s *Session) GetDatastore(name string) (*object.Datastore, error)

GetDatastore returns the govmomi object for a datastore

func (*Session) GetFolder

func (s *Session) GetFolder(name string) (*object.Folder, error)

GetFolder returns a single folder object

func (*Session) GetNetwork

func (s *Session) GetNetwork(name string) (object.NetworkReference, error)

GetNetwork returns the govmomi object for a network

func (*Session) GetResourcePool

func (s *Session) GetResourcePool(name string) (*object.ResourcePool, error)

GetResourcePool returns the govmomi object for a resource pool

func (*Session) GetVM

func (s *Session) GetVM(name string) (*object.VirtualMachine, error)

GetVM returns the govmomi object for a virtual machine

type TrackedResources

type TrackedResources struct {
	Folders map[string]*object.Folder
	VMs     map[string]*object.VirtualMachine
}

TrackedResources are vmware objects created during the bootstrap process

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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