Documentation ¶
Index ¶
- Variables
- type CancelFunc
- type Manager
- type Scheduler
- func (s *Scheduler) CreateQEMU(ctx context.Context, config *api.VirtualMachineCreateOptions) (framework.SchedulerResult, error)
- func (s *Scheduler) IsRunning() bool
- func (s *Scheduler) Run()
- func (s *Scheduler) RunAsync()
- func (s *Scheduler) RunFilterPlugins(ctx context.Context, state *framework.CycleState, ...) ([]*api.Node, error)
- func (s *Scheduler) RunScorePlugins(ctx context.Context, state *framework.CycleState, ...) (framework.NodeScoreList, *framework.Status)
- func (s *Scheduler) RunVMIDPlugins(ctx context.Context, state *framework.CycleState, ...) (int, error)
- func (s *Scheduler) ScheduleOne(ctx context.Context)
- func (s *Scheduler) SelectNode(ctx context.Context, config api.VirtualMachineCreateOptions) (string, error)
- func (s *Scheduler) SelectVMID(ctx context.Context, config api.VirtualMachineCreateOptions) (int, error)
- func (s *Scheduler) Stop()
- func (s *Scheduler) WaitStatus(ctx context.Context, config *api.VirtualMachineCreateOptions) (framework.CycleState, error)
- func (s *Scheduler) WithCancel() (*Scheduler, CancelFunc)
- type SchedulerOption
- type SchedulerParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoNodesAvailable is used to describe the error that no nodes available to schedule qemus. ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule qemus") // ErrNoVMIDAvailable is used to describe the error that no vmid available to schedule qemus. ErrNoVMIDAvailable = fmt.Errorf("no vmid available to schedule qemus") )
Functions ¶
This section is empty.
Types ¶
type CancelFunc ¶
type CancelFunc func()
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
manager manages schedulers
func NewManager ¶
func NewManager(params SchedulerParams) (*Manager, error)
return manager with initialized scheduler-table
func (*Manager) GetOrCreateScheduler ¶
return new/existing scheduler
func (*Manager) NewScheduler ¶
func (m *Manager) NewScheduler(client *proxmox.Service, opts ...SchedulerOption) *Scheduler
return new scheduler. usually better to use GetOrCreateScheduler instead.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func (*Scheduler) CreateQEMU ¶
func (s *Scheduler) CreateQEMU(ctx context.Context, config *api.VirtualMachineCreateOptions) (framework.SchedulerResult, error)
create new qemu with given spec and context
func (*Scheduler) Run ¶
func (s *Scheduler) Run()
run scheduler and ensure only one process is running
func (*Scheduler) RunFilterPlugins ¶
func (*Scheduler) RunScorePlugins ¶
func (s *Scheduler) RunScorePlugins(ctx context.Context, state *framework.CycleState, config api.VirtualMachineCreateOptions, nodes []*api.Node) (framework.NodeScoreList, *framework.Status)
func (*Scheduler) RunVMIDPlugins ¶
func (*Scheduler) ScheduleOne ¶
retrieve one qemuSpec from queue and try to create new qemu according to the qemuSpec
func (*Scheduler) SelectNode ¶
func (*Scheduler) SelectVMID ¶
func (*Scheduler) WaitStatus ¶
func (s *Scheduler) WaitStatus(ctx context.Context, config *api.VirtualMachineCreateOptions) (framework.CycleState, error)
wait until CycleState is put into channel and then return it
func (*Scheduler) WithCancel ¶
func (s *Scheduler) WithCancel() (*Scheduler, CancelFunc)
type SchedulerOption ¶
type SchedulerOption func(s *Scheduler)
type SchedulerParams ¶
type SchedulerParams struct { Logger logr.Logger // file path for pluginConfig PluginConfigFile string // contains filtered or unexported fields }
func (*SchedulerParams) PluginConfigs ¶
func (p *SchedulerParams) PluginConfigs() plugins.PluginConfigs
Click to show internal directories.
Click to hide internal directories.