placement

package
v1.4.3-dev Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostPlacementPolicy

type HostPlacementPolicy interface {
	// TODO(jzt): refactor to consider vm resource needs in the future
	// CheckHost checks whether or not the host a VM was created on is adequate for power-on.
	CheckHost(trace.Operation, *object.VirtualMachine) bool

	// RecommendHost recommends an ordered list of hosts on which a VM
	// may be placed prior to power-on. The list is ordered from more
	// ideal to less ideal based on weighted host metrics.
	RecommendHost(trace.Operation, []*object.HostSystem) ([]*object.HostSystem, error)
}

HostPlacementPolicy defines the interface for using metrics to decide the appropriate host for a VM based on host metrics and VM provisioned resources.

type RandomHostPolicy

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

RandomHostPolicy chooses a random host on which to power-on a VM.

func NewRandomHostPolicy

func NewRandomHostPolicy(op trace.Operation, cls *object.ComputeResource) (*RandomHostPolicy, error)

NewRandomHostPolicy returns a RandomHostPolicy instance.

func (*RandomHostPolicy) CheckHost

func (p *RandomHostPolicy) CheckHost(op trace.Operation, vm *object.VirtualMachine) bool

CheckHost always returns false in a RandomHostPolicy.

func (*RandomHostPolicy) RecommendHost

func (p *RandomHostPolicy) RecommendHost(op trace.Operation, hosts []*object.HostSystem) ([]*object.HostSystem, error)

RecommendHost recommends a random host on which to place a newly created VM. As this HostPlacementPolicy implementation does not rely on host metrics in its recommendation logic, hosts that are disconnected or in maintenance mode are not filtered from the returned list. Subsequent attempts to relocate to one of these hosts should result in the host being removed from the list and the resulting subset being used in a new call to RecommendHost.

type RankedHostPolicy

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

RankedHostPolicy uses data from a MetricsProvider to decide on which host to power-on a VM.

func NewRankedHostPolicy

NewRankedHostPolicy returns a RandomHostPolicy instance using the supplied MetricsProvider with the default weighting configuration.

func NewRankedHostPolicyWithConfig

NewRankedHostPolicyWithConfig returns a RandomHostPolicy instance using the supplied MetricsProvider and WeightConfiguration.

func (*RankedHostPolicy) CheckHost

func (r *RankedHostPolicy) CheckHost(op trace.Operation, vm *object.VirtualMachine) bool

CheckHost returns true if the host has adequate capacity to power on the VM, false otherwise.

func (*RankedHostPolicy) RecommendHost

func (r *RankedHostPolicy) RecommendHost(op trace.Operation, hosts []*object.HostSystem) ([]*object.HostSystem, error)

RecommendHost returns an ordered list of the supplied hosts, ranked by current performance metrics and weighting configuration. The front of the list is more ideal, the end of the list is less ideal, with regard to choosing the optimal host on which to power-on a VM.

type WeightConfiguration

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

WeightConfiguration holds weights for different host metrics. These weights are used to determine a host ranking.

Jump to

Keyboard shortcuts

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