management

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// deprecated snapshot name prefix
	UpgradePrefix = "upgrade for"
	// new snapshot name for upgrade and configure are using same process
	ConfigurePrefix = "reconfigure for"
)
View Source
const RulesetID string = "vSPC"

ruleset ID from /etc/vmware/firewall/service.xml

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

Action is the current action being performed

const (
	NoAction        Action = iota // 0
	CreateAction                  // 1
	ConfigureAction               // 2
	UpgradeAction                 // 3
	RollbackAction                // 4
	DeleteAction                  // 5
	InspectAction                 // 6
	ListAction                    // 7
	UpdateAction                  // 8
	DebugAction                   // 9
)

Action definitions

func (Action) String

func (a Action) String() string

stringer for action

type DeleteContainers

type DeleteContainers int
const (
	AllContainers DeleteContainers = iota
	PoweredOffContainers
)

type DeleteVolumeStores

type DeleteVolumeStores int
const (
	AllVolumeStores DeleteVolumeStores = iota
	NoVolumeStores
)

type Dispatcher

type Dispatcher struct {
	Action

	DockerPort string
	HostIP     string
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher(ctx context.Context, s *session.Session, action Action, force bool) *Dispatcher

NewDispatcher creates a dispatcher that can act upon VIC management operations. clientCert is an optional client certificate to allow interaction with the Docker API for verification force will ignore some errors

func (*Dispatcher) CheckAccessToVCAPI

func (d *Dispatcher) CheckAccessToVCAPI(vch *vm.VirtualMachine, target string) (int64, error)

func (*Dispatcher) CheckDockerAPI

func (d *Dispatcher) CheckDockerAPI(conf *config.VirtualContainerHostConfigSpec, clientCert *tls.Certificate) error

CheckDockerAPI checks if the appliance components are initialized by issuing `docker info` to the appliance

func (*Dispatcher) CheckServiceReady

func (d *Dispatcher) CheckServiceReady(ctx context.Context, conf *config.VirtualContainerHostConfigSpec, clientCert *tls.Certificate) error

CheckServiceReady checks if service is launched correctly, including ip address, service initialization, VC connection and Docker API Should expand this method for any more VCH service checking

func (*Dispatcher) CollectDiagnosticLogs

func (d *Dispatcher) CollectDiagnosticLogs()

func (*Dispatcher) Configure

func (d *Dispatcher) Configure(conf *config.VirtualContainerHostConfigSpec, settings *data.InstallerData) (err error)

Configure will try to reconfigure vch appliance. If failed will try to roll back to original status.

func (*Dispatcher) CreateVCH

func (d *Dispatcher) CreateVCH(conf *config.VirtualContainerHostConfigSpec, settings *data.InstallerData, receiver vchlog.Receiver) error

func (*Dispatcher) DebugVCH

func (d *Dispatcher) DebugVCH(vch *vm.VirtualMachine, conf *config.VirtualContainerHostConfigSpec, password, authorizedKey string) error

func (*Dispatcher) DeleteVCH

func (d *Dispatcher) DeleteVCH(conf *config.VirtualContainerHostConfigSpec, containers *DeleteContainers, volumeStores *DeleteVolumeStores) error

func (*Dispatcher) DeleteVCHInstances

func (d *Dispatcher) DeleteVCHInstances(conf *config.VirtualContainerHostConfigSpec, containers *DeleteContainers) error

DeleteVCHInstances will delete all containers in the target resource pool or folder. Additionally, it will detach disks of the target VCH

func (*Dispatcher) DisableFirewallRuleset

func (d *Dispatcher) DisableFirewallRuleset() error

DisableFirewallRuleset disables the ruleset on the target, denying VIC backchannel traffic

func (*Dispatcher) EnableFirewallRuleset

func (d *Dispatcher) EnableFirewallRuleset() error

EnableFirewallRuleset enables the ruleset on the target, allowing VIC backchannel traffic

func (*Dispatcher) FetchAndMigrateVCHConfig

func (d *Dispatcher) FetchAndMigrateVCHConfig(vm *vm.VirtualMachine) (*config.VirtualContainerHostConfigSpec, error)

FetchAndMigrateVCHConfig queries VCH guestinfo, and try to migrate older version data to latest if the data is old

func (*Dispatcher) GetDockerAPICommand

func (d *Dispatcher) GetDockerAPICommand(conf *config.VirtualContainerHostConfigSpec, key string, cert string, cacert string, certpath string) (cmd, env string)

GetDockerAPICommand generates values to display for usage of a deployed VCH

func (*Dispatcher) GetNoSecretVCHConfig

func (d *Dispatcher) GetNoSecretVCHConfig(vm *vm.VirtualMachine) (*config.VirtualContainerHostConfigSpec, error)

GetNoSecretVCHConfig queries vch configure from vm configuration, without decrypting secret information this method is used to accommodate old vch version without secret information

func (*Dispatcher) GetTLSFriendlyHostIP

func (d *Dispatcher) GetTLSFriendlyHostIP(clientIP net.IP, cert *x509.Certificate, CertificateAuthorities []byte) string

func (*Dispatcher) GetVCHConfig

GetVCHConfig queries VCH configuration and decrypts secret information

func (*Dispatcher) GuestInfoSecret

func (d *Dispatcher) GuestInfoSecret(vchName, vmPath string, ds *object.Datastore) (*extraconfig.SecretKey, error)

GuestInfoSecret downloads the VCH's .vmx file and returns the GuestInfoSecretKey value.

func (*Dispatcher) InitDiagnosticLogsFromConf

func (d *Dispatcher) InitDiagnosticLogsFromConf(conf *config.VirtualContainerHostConfigSpec)

Get the current log header LineEnd of the hostd/vpxd logs based on VCH configuration With this we avoid collecting log file data that existed prior to install.

func (*Dispatcher) InitDiagnosticLogsFromVCH

func (d *Dispatcher) InitDiagnosticLogsFromVCH(vch *vm.VirtualMachine)

Get the current log header LineEnd of the hostd/vpxd logs based on vch VM hardwares, cause VCH configuration might not be available at this time With this we avoid collecting log file data that existed prior to install.

func (*Dispatcher) InspectVCH

func (d *Dispatcher) InspectVCH(vch *vm.VirtualMachine, conf *config.VirtualContainerHostConfigSpec, certPath string) error

func (*Dispatcher) NewVCHFromComputePath

func (d *Dispatcher) NewVCHFromComputePath(computePath string, name string, v *validate.Validator) (*vm.VirtualMachine, error)

func (*Dispatcher) NewVCHFromID

func (d *Dispatcher) NewVCHFromID(id string) (*vm.VirtualMachine, error)

func (*Dispatcher) Rollback

func (*Dispatcher) SearchVCHs

func (d *Dispatcher) SearchVCHs(computePath string) ([]*vm.VirtualMachine, error)

SearchVCHs searches for VCHs in one of the following areas:

computePath: if a compute resource is provided then the search will be limited to the resource pools of the compute resources found at the path

datacenter: if no compute resource is provided then search across all compute resources in the sessions datacenter. This requires the user to specify the datacenter via the target flag

all datacenters: if the other options aren't available then search across every compute resource in each vSphere datacenter

func (*Dispatcher) ShowVCH

func (d *Dispatcher) ShowVCH(conf *config.VirtualContainerHostConfigSpec, key string, cert string, cacert string, envfile string, certpath string)

type State

type State int

func (State) String

func (s State) String() string

Jump to

Keyboard shortcuts

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