virthandler

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 73 Imported by: 5

Documentation

Index

Constants

View Source
const (
	//VolumeReadyReason is the reason set when the volume is ready.
	VolumeReadyReason = "VolumeReady"
	//VolumeUnMountedFromPodReason is the reason set when the volume is unmounted from the virtlauncher pod
	VolumeUnMountedFromPodReason = "VolumeUnMountedFromPod"
	//VolumeMountedToPodReason is the reason set when the volume is mounted to the virtlauncher pod
	VolumeMountedToPodReason = "VolumeMountedToPod"
	//VolumeUnplugged is the reason set when the volume is completely unplugged from the VMI
	VolumeUnplugged = "VolumeUnplugged"
	//VMIDefined is the reason set when a VMI is defined
	VMIDefined = "VirtualMachineInstance defined."
	//VMIStarted is the reason set when a VMI is started
	VMIStarted = "VirtualMachineInstance started."
	//VMIShutdown is the reason set when a VMI is shutdown
	VMIShutdown = "The VirtualMachineInstance was shut down."
	//VMICrashed is the reason set when a VMI crashed
	VMICrashed = "The VirtualMachineInstance crashed."
	//VMIAbortingMigration is the reason set when migration is being aborted
	VMIAbortingMigration = "VirtualMachineInstance is aborting migration."
	//VMIMigrating in the reason set when the VMI is migrating
	VMIMigrating = "VirtualMachineInstance is migrating."
	//VMIMigrationTargetPrepared is the reason set when the migration target has been prepared
	VMIMigrationTargetPrepared = "VirtualMachineInstance Migration Target Prepared."
	//VMIStopping is the reason set when the VMI is stopping
	VMIStopping = "VirtualMachineInstance stopping"
	//VMIGracefulShutdown is the reason set when the VMI is gracefully shut down
	VMIGracefulShutdown = "Signaled Graceful Shutdown"
	//VMISignalDeletion is the reason set when the VMI has signal deletion
	VMISignalDeletion = "Signaled Deletion"
)

Variables

This section is empty.

Functions

func FindMigrationIP added in v0.49.0

func FindMigrationIP(migrationIp string) (string, error)

FindMigrationIP looks for dedicated migration network migration0. If found, sets migration IP to it

func IsoGuestVolumePath added in v0.36.4

func IsoGuestVolumePath(namespace, name string, volume *v1.Volume) string

Types

type BaseController added in v1.6.0

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

func NewBaseController added in v1.6.0

func NewBaseController(
	logger *log.FilteredLogger,
	host string,
	recorder record.EventRecorder,
	clientset kubecli.KubevirtClient,
	queue workqueue.TypedRateLimitingInterface[string],
	vmiInformer cache.SharedIndexInformer,
	domainInformer cache.SharedInformer,
	clusterConfig *virtconfig.ClusterConfig,
	podIsolationDetector isolation.PodIsolationDetector,
	launcherClients launcherclients.LauncherClientsManager,
	migrationProxy migrationproxy.ProxyManager,
	virtLauncherFSRunDirPattern string,
	netStat netstat,
) (*BaseController, error)

type FailRetryManager added in v0.59.0

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

FailRetryManager is the manger to handle asynchronous retry used by virt-handler. When a failure event happens, virt-handler will try to fix it. The result of the fix is reflected by whether we receive the failure signal again afterwards. If we did, we want to schedule the retry in an exponential backoff manner. This manager would remember the last try and return the wait time for next try. If we don't receive the failure signal again within the maxFailResponseTime, we consider the fix has worked and will reset the record.

func NewFailRetryManager added in v0.59.0

func NewFailRetryManager(name string, initialWait, maxWait, maxFailResponseTime time.Duration) *FailRetryManager

NewFailRetryManager creates a new FailRetryManager with the parameters explained above.

func (*FailRetryManager) Run added in v0.59.0

func (f *FailRetryManager) Run(stopCh chan struct{})

Run starts the manager.

func (*FailRetryManager) ShouldDelay added in v0.59.0

func (f *FailRetryManager) ShouldDelay(key string, isFailure func() bool) (bool, time.Duration)

ShouldDelay returns whether the retry on this failure should be delayed or not, and if true return the duration of the delay as well.

type MigrationSourceController added in v1.6.0

type MigrationSourceController struct {
	*BaseController
	// contains filtered or unexported fields
}

func NewMigrationSourceController added in v1.6.0

func NewMigrationSourceController(
	recorder record.EventRecorder,
	clientset kubecli.KubevirtClient,
	host string,
	launcherClients launcherclients.LauncherClientsManager,
	vmiInformer cache.SharedIndexInformer,
	domainInformer cache.SharedInformer,
	clusterConfig *virtconfig.ClusterConfig,
	podIsolationDetector isolation.PodIsolationDetector,
	migrationProxy migrationproxy.ProxyManager,
	virtLauncherFSRunDirPattern string,
	netStat netstat,
	passtRepairHandler passtRepairSourceHandler,
) (*MigrationSourceController, error)

func (*MigrationSourceController) Execute added in v1.6.0

func (c *MigrationSourceController) Execute() bool

func (*MigrationSourceController) Run added in v1.6.0

func (c *MigrationSourceController) Run(threadiness int, stopCh chan struct{})

type MigrationTargetController added in v1.6.0

type MigrationTargetController struct {
	*BaseController
	// contains filtered or unexported fields
}

func NewMigrationTargetController added in v1.6.0

func NewMigrationTargetController(
	recorder record.EventRecorder,
	clientset kubecli.KubevirtClient,
	host string,
	virtPrivateDir string,
	kubeletPodsDir string,
	migrationIpAddress string,
	launcherClients launcherclients.LauncherClientsManager,
	vmiInformer cache.SharedIndexInformer,
	domainInformer cache.SharedInformer,
	clusterConfig *virtconfig.ClusterConfig,
	podIsolationDetector isolation.PodIsolationDetector,
	migrationProxy migrationproxy.ProxyManager,
	virtLauncherFSRunDirPattern string,
	capabilities *libvirtxml.Caps,
	netConf netconf,
	netStat netstat,
	netBindingPluginMemoryCalculator netBindingPluginMemoryCalculator,
	passtRepairHandler passtRepairTargetHandler,
) (*MigrationTargetController, error)

func (*MigrationTargetController) Execute added in v1.6.0

func (c *MigrationTargetController) Execute() bool

func (*MigrationTargetController) Run added in v1.6.0

func (c *MigrationTargetController) Run(threadiness int, stopCh chan struct{})

type VirtualMachineController added in v0.0.4

type VirtualMachineController struct {
	*BaseController
	// contains filtered or unexported fields
}

func NewVirtualMachineController added in v1.6.0

func NewVirtualMachineController(
	recorder record.EventRecorder,
	clientset kubecli.KubevirtClient,
	host string,
	virtPrivateDir string,
	kubeletPodsDir string,
	launcherClients launcherclients.LauncherClientsManager,
	vmiInformer cache.SharedIndexInformer,
	vmiGlobalStore cache.Store,
	domainInformer cache.SharedInformer,
	maxDevices int,
	clusterConfig *virtconfig.ClusterConfig,
	podIsolationDetector isolation.PodIsolationDetector,
	migrationProxy migrationproxy.ProxyManager,
	downwardMetricsManager downwardMetricsManager,
	capabilities *libvirtxml.Caps,
	hostCpuModel string,
	netConf netconf,
	netStat netstat,
) (*VirtualMachineController, error)

func (*VirtualMachineController) Execute added in v0.0.4

func (c *VirtualMachineController) Execute() bool

func (*VirtualMachineController) Run added in v0.0.4

func (c *VirtualMachineController) Run(threadiness int, stopCh chan struct{})

Directories

Path Synopsis
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
Package cgroup is a generated GoMock package.
Package cgroup is a generated GoMock package.
Package cmdclient is a generated GoMock package.
Package cmdclient is a generated GoMock package.
Package container_disk is a generated GoMock package.
Package container_disk is a generated GoMock package.
Package device_manager is a generated GoMock package.
Package device_manager is a generated GoMock package.
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
Package isolation is a generated GoMock package.
Package isolation is a generated GoMock package.
Package multipath_monitor is a generated GoMock package.
Package multipath_monitor is a generated GoMock package.
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
Package selinux is a generated GoMock package.
Package selinux is a generated GoMock package.

Jump to

Keyboard shortcuts

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