controllers

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepEqual

func DeepEqual(v1, v2 interface{}) bool

func QmpCancelMigration added in v0.11.0

func QmpCancelMigration(virtualmachine *vmv1.VirtualMachine) error

func QmpConnect

func QmpConnect(virtualmachine *vmv1.VirtualMachine) (*qmp.SocketMonitor, error)

func QmpConnectByIP

func QmpConnectByIP(ip string, port int32) (*qmp.SocketMonitor, error)

func QmpGetCpus

func QmpGetCpus(virtualmachine *vmv1.VirtualMachine) ([]QmpCpuSlot, []QmpCpuSlot, error)

func QmpGetCpusFromRunner

func QmpGetCpusFromRunner(ip string, port int32) ([]QmpCpuSlot, []QmpCpuSlot, error)

func QmpGetMemorySize

func QmpGetMemorySize(virtualmachine *vmv1.VirtualMachine) (*resource.Quantity, error)

func QmpPlugCpu

func QmpPlugCpu(virtualmachine *vmv1.VirtualMachine) error

func QmpPlugCpuToRunner

func QmpPlugCpuToRunner(ip string, port int32) error

func QmpPlugMemory

func QmpPlugMemory(virtualmachine *vmv1.VirtualMachine) error

func QmpPlugMemoryToRunner

func QmpPlugMemoryToRunner(ip string, port int32, size int64) error

func QmpQuit

func QmpQuit(ip string, port int32) error

func QmpStartMigration

func QmpStartMigration(virtualmachine *vmv1.VirtualMachine, virtualmachinemigration *vmv1.VirtualMachineMigration) error

func QmpSyncCpuToTarget added in v0.11.0

func QmpSyncCpuToTarget(vm *vmv1.VirtualMachine, migration *vmv1.VirtualMachineMigration) error

func QmpSyncMemoryToTarget added in v0.11.0

func QmpSyncMemoryToTarget(vm *vmv1.VirtualMachine, migration *vmv1.VirtualMachineMigration) error

func QmpUnplugCpu

func QmpUnplugCpu(virtualmachine *vmv1.VirtualMachine) error

func QmpUnplugMemory

func QmpUnplugMemory(virtualmachine *vmv1.VirtualMachine) error

Types

type MigrationInfo

type MigrationInfo struct {
	Status      string `json:"status"`
	TotalTimeMs int64  `json:"total-time"`
	SetupTimeMs int64  `json:"setup-time"`
	DowntimeMs  int64  `json:"downtime"`
	Ram         struct {
		Transferred    int64 `json:"transferred"`
		Remaining      int64 `json:"remaining"`
		Total          int64 `json:"total"`
		Duplicate      int64 `json:"duplicate"`
		Normal         int64 `json:"normal"`
		NormalBytes    int64 `json:"normal-bytes"`
		DirtySyncCount int64 `json:"dirty-sync-count"`
	} `json:"ram"`
	Compression struct {
		CompressedSize  int64   `json:"compressed-size"`
		CompressionRate float64 `json:"compression-rate"`
	} `json:"compression"`
}

func QmpGetMigrationInfo

func QmpGetMigrationInfo(virtualmachine *vmv1.VirtualMachine) (MigrationInfo, error)

type QmpCpuSlot

type QmpCpuSlot struct {
	Core int32  `json:"core"`
	QOM  string `json:"qom"`
	Type string `json:"type"`
}

type QmpCpus

type QmpCpus struct {
	Return []struct {
		Props struct {
			CoreId   int32 `json:"core-id"`
			ThreadId int32 `json:"thread-id"`
			SocketId int32 `json:"socket-id"`
		} `json:"props"`
		VcpusCount int32   `json:"vcpus-count"`
		QomPath    *string `json:"qom-path"`
		Type       string  `json:"type"`
	} `json:"return"`
}

type QmpMemoryDevice

type QmpMemoryDevice struct {
	Type string `json:"type"`
	Data struct {
		Memdev       string `json:"memdev"`
		Hotplugged   bool   `json:"hotplugged"`
		Addr         int64  `json:"addr"`
		Hotplugguble bool   `json:"hotpluggable"`
		Size         int64  `json:"size"`
		Slot         int64  `json:"slot"`
		Node         int64  `json:"node"`
		Id           string `json:"id"`
	} `json:"data"`
}

func QmpQueryMemoryDevices

func QmpQueryMemoryDevices(virtualmachine *vmv1.VirtualMachine) ([]QmpMemoryDevice, error)

func QmpQueryMemoryDevicesFromRunner

func QmpQueryMemoryDevicesFromRunner(ip string, port int32) ([]QmpMemoryDevice, error)

type QmpMemoryDevices

type QmpMemoryDevices struct {
	Return []QmpMemoryDevice `json:"return"`
}

type QmpMemorySize

type QmpMemorySize struct {
	Return struct {
		BaseMemory    int64 `json:"base-memory"`
		PluggedMemory int64 `json:"plugged-memory"`
	} `json:"return"`
}

type QmpMigrationInfo

type QmpMigrationInfo struct {
	Return MigrationInfo `json:"return"`
}

type VirtualMachineMigrationReconciler

type VirtualMachineMigrationReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

VirtualMachineMigrationReconciler reconciles a VirtualMachineMigration object

func (*VirtualMachineMigrationReconciler) Reconcile

It is essential for the controller's reconciliation loop to be idempotent. By following the Operator pattern you will create Controllers which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. Breaking this recommendation goes against the design principles of controller-runtime. and may lead to unforeseen consequences such as resources becoming stuck and requiring manual intervention. For further info: - About Operator Pattern: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ - About Controllers: https://kubernetes.io/docs/concepts/architecture/controller/ - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.0/pkg/reconcile

func (*VirtualMachineMigrationReconciler) SetupWithManager

func (r *VirtualMachineMigrationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager. Note that the Pods will be also watched in order to ensure its desirable state on the cluster

type VirtualMachineReconciler

type VirtualMachineReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

VirtualMachineReconciler reconciles a VirtualMachine object

func (*VirtualMachineReconciler) Reconcile

It is essential for the controller's reconciliation loop to be idempotent. By following the Operator pattern you will create Controllers which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. Breaking this recommendation goes against the design principles of controller-runtime. and may lead to unforeseen consequences such as resources becoming stuck and requiring manual intervention. For further info: - About Operator Pattern: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ - About Controllers: https://kubernetes.io/docs/concepts/architecture/controller/ - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.0/pkg/reconcile

func (*VirtualMachineReconciler) SetupWithManager

func (r *VirtualMachineReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager. Note that the Runner Pod will be also watched in order to ensure its desirable state on the cluster

Jump to

Keyboard shortcuts

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