scheduler

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVICE_TYPE    = apis.SERVICE_TYPE_SCHEDULER
	SERVICE_VERSION = ""
)

Variables

This section is empty.

Functions

func NodesFreeCpuEnough

func NodesFreeCpuEnough(nodeCount, vcpuCount int, cpuNumaFree []*SFreeNumaCpuMem) bool

func NodesFreeMemSizeEnough

func NodesFreeMemSizeEnough(nodeCount, memSize int, cpuNumaFree []*SFreeNumaCpuMem) bool

Types

type CandidateDisk

type CandidateDisk struct {
	Index      int      `json:"index"`
	StorageIds []string `json:"storage_ids"`
}

type CandidateDiskV2

type CandidateDiskV2 struct {
	Index    int                 `json:"index"`
	Storages []*CandidateStorage `json:"storages"`
}

type CandidateNet

type CandidateNet struct {
	Index      int      `json:"index"`
	NetworkIds []string `json:"network_ids"`
}

type CandidateResource

type CandidateResource struct {
	SessionId  string           `json:"session_id"`
	HostId     string           `json:"host_id"`
	Name       string           `json:"name"`
	CpuNumaPin []SCpuNumaPin    `json:"cpu_numa_pin"`
	Disks      []*CandidateDisk `json:"disks"`
	Nets       []*CandidateNet  `json:"nets"`

	// used by backup schedule
	BackupCandidate *CandidateResource `json:"backup_candidate"`

	// Error means no candidate found, include reasons
	Error string `json:"error"`
}

type CandidateStorage

type CandidateStorage struct {
	Id           string
	Name         string
	FreeCapacity int64
}

type ForGuest

type ForGuest struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type GroupRelation

type GroupRelation struct {
	GroupId  string `json:"group_id"`
	Strategy string `json:"strategy"`
	Scope    string `json:"scope"`
}

type SCpuNumaPin

type SCpuNumaPin struct {
	CpuPin    []int
	NodeId    int
	MemSizeMB *int
}

type SCpuPin

type SCpuPin struct {
	Vcpu int
	Pcpu int
}

type SFreeNumaCpuMem

type SFreeNumaCpuMem struct {
	FreeCpuCount       int
	MemSize            int
	EnableNumaAllocate bool

	CpuCount int
	NodeId   int
}

type ScheduleBaseConfig

type ScheduleBaseConfig struct {
	BestEffort      bool     `json:"best_effort"`
	SuggestionLimit int64    `json:"suggestion_limit"`
	SuggestionAll   bool     `json:"suggestion_all"`
	IgnoreFilters   []string `json:"ignore_filters"`
	SessionId       string   `json:"session_id"`

	// usedby test api
	RecordLog bool `json:"record_to_history"`
	Details   bool `json:"details"`
}

type ScheduleInput

type ScheduleInput struct {
	apis.Meta

	ScheduleBaseConfig

	ServerConfig

	// HostId used by migrate
	HostId          string `json:"host_id"`
	LiveMigrate     bool   `json:"live_migrate"`
	SkipCpuCheck    *bool  `json:"skip_cpu_check"`
	CpuDesc         string `json:"cpu_desc"`
	CpuMicrocode    string `json:"cpu_microcode"`
	CpuMode         string `json:"cpu_mode"`
	OsArch          string `json:"os_arch"`
	ResetCpuNumaPin bool   `json:"reset_cpu_numa_pin"`

	// For Migrate
	CpuNumaPin []SCpuNumaPin `json:"cpu_numa_pin"`

	HostMemPageSizeKB int    `json:"host_mem_page_size"`
	SkipKernelCheck   *bool  `json:"skip_kernel_check"`
	TargetHostKernel  string `json:"target_host_kernel"`

	// In the migrate and create backup cases
	// we don't need reallocate network
	ReuseNetwork bool `json:"reuse_network"`

	// Change config
	ChangeConfig bool
	// guest who change config has isolated device
	HasIsolatedDevice bool

	PendingUsages []jsonutils.JSONObject
}

ScheduleInput used by scheduler sync-schedule/test/forecast api

func (ScheduleInput) ToConditionInput

func (input ScheduleInput) ToConditionInput() *jsonutils.JSONDict

type ScheduleOutput

type ScheduleOutput struct {
	apis.Meta

	Candidates []*CandidateResource `json:"candidates"`
}

type ServerConfig

type ServerConfig struct {
	*compute.ServerConfigs

	Memory      int    `json:"vmem_size"`
	Ncpu        int    `json:"vcpu_count"`
	Name        string `json:"name"`
	GuestStatus string `json:"guest_status"`
	Cdrom       string `json:"cdrom"`

	// owner project id
	Project string `json:"project_id"`
	// owner domain id
	Domain string `json:"domain_id"`

	// Deprecated
	Metadata       map[string]string `json:"__meta__"`
	ForGuests      []*ForGuest       `json:"for_guests"`
	GroupRelations []*GroupRelation  `json:"group_releations"`
	Groups         interface{}       `json:"groups"`
	Id             string            `json:"id"`

	InstanceSnapshotId string `json:"instance_snapshot_id"`
	InstanceBackupId   string `json:"instance_backup_id"`
}

type SortedFreeNumaCpuMam

type SortedFreeNumaCpuMam []*SFreeNumaCpuMem

func (SortedFreeNumaCpuMam) Len

func (pq SortedFreeNumaCpuMam) Len() int

func (SortedFreeNumaCpuMam) Less

func (pq SortedFreeNumaCpuMam) Less(i, j int) bool

func (SortedFreeNumaCpuMam) Swap

func (pq SortedFreeNumaCpuMam) Swap(i, j int)

Jump to

Keyboard shortcuts

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