virthandler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 70 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

View Source
var PasswordRelatedGuestAgentCommands = []string{
	"guest-set-user-password",
}
View Source
var RequiredGuestAgentCommands = []string{
	"guest-ping",
	"guest-get-time",
	"guest-info",
	"guest-shutdown",
	"guest-network-get-interfaces",
	"guest-get-fsinfo",
	"guest-get-host-name",
	"guest-get-users",
	"guest-get-timezone",
	"guest-get-osinfo",
}
View Source
var SSHRelatedGuestAgentCommands = []string{
	"guest-exec-status",
	"guest-exec",
	"guest-file-open",
	"guest-file-close",
	"guest-file-read",
	"guest-file-write",
}

Functions

func FindInterfaceIndexPath added in v1.0.0

func FindInterfaceIndexPath(res isolation.IsolationResult, podIfaceName string, networkName string, networks []v1.Network) (*safepath.Path, error)

FindInterfaceIndexPath return the ifindex path of the given interface name (e.g.: enp0f1p2 -> /sys/class/net/enp0f1p2/ifindex). If path not found it will try to find the path using ordinal interface name based on its position in the given networks slice (e.g.: net1 -> /sys/class/net/net1/ifindex).

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(vmi *v1.VirtualMachineInstance, volume *v1.Volume) (string, bool)

Types

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 VirtualMachineController added in v0.0.4

type VirtualMachineController struct {
	Queue workqueue.RateLimitingInterface
	// contains filtered or unexported fields
}

func NewController added in v0.0.4

func NewController(
	recorder record.EventRecorder,
	clientset kubecli.KubevirtClient,
	host string,
	migrationIpAddress string,
	virtShareDir string,
	virtPrivateDir string,
	kubeletPodsDir string,
	vmiSourceInformer cache.SharedIndexInformer,
	vmiTargetInformer cache.SharedIndexInformer,
	domainInformer cache.SharedInformer,
	watchdogTimeoutSeconds int,
	maxDevices int,
	clusterConfig *virtconfig.ClusterConfig,
	podIsolationDetector isolation.PodIsolationDetector,
	migrationProxy migrationproxy.ProxyManager,
	downwardMetricsManager downwardMetricsManager,
	capabilities *nodelabellerapi.Capabilities,
	hostCpuModel string,
) (*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.
api
* 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.

Jump to

Keyboard shortcuts

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