Documentation
¶
Index ¶
- Constants
- Variables
- type Adapter
- func (r *Adapter) Builder(ctx *plancontext.Context) (builder base.Builder, err error)
- func (r *Adapter) Client(ctx *plancontext.Context) (client base.Client, err error)
- func (r *Adapter) DestinationClient(ctx *plancontext.Context) (destinationClient base.DestinationClient, err error)
- func (r *Adapter) Ensurer(ctx *plancontext.Context) (ensure base.Ensurer, err error)
- func (r *Adapter) Validator(ctx *plancontext.Context) (validator base.Validator, err error)
- type Builder
- func (r *Builder) ConfigMap(_ ref.Ref, in *core.Secret, object *core.ConfigMap) (err error)
- func (r *Builder) ConfigMaps(vmRef ref.Ref) (list []core.ConfigMap, err error)
- func (r *Builder) ConversionPodConfig(_ ref.Ref) (*planbase.ConversionPodConfigResult, error)
- func (r *Builder) DataVolumes(vmRef ref.Ref, secret *core.Secret, configMap *core.ConfigMap, ...) (dvs []cdi.DataVolume, err error)
- func (r *Builder) GetPopulatorTaskName(pvc *core.PersistentVolumeClaim) (taskName string, err error)
- func (r *Builder) LunPersistentVolumeClaims(vmRef ref.Ref) (pvcs []core.PersistentVolumeClaim, err error)
- func (r *Builder) LunPersistentVolumes(vmRef ref.Ref) (pvs []core.PersistentVolume, err error)
- func (r *Builder) NetAppShiftPVCs(vmRef ref.Ref, labels map[string]string) ([]core.PersistentVolumeClaim, error)
- func (r *Builder) PodEnvironment(_ ref.Ref, _ *core.Secret) (env []core.EnvVar, err error)
- func (r *Builder) PopulatorTransferredBytes(persistentVolumeClaim *core.PersistentVolumeClaim) (transferredBytes int64, err error)
- func (r *Builder) PopulatorVolumes(vmRef ref.Ref, annotations map[string]string, secretName string) (pvcs []*core.PersistentVolumeClaim, err error)
- func (r *Builder) PreferenceName(vmRef ref.Ref, configMap *core.ConfigMap) (name string, err error)
- func (r *Builder) ResolveDataVolumeIdentifier(dv *cdi.DataVolume) string
- func (r *Builder) ResolvePersistentVolumeClaimIdentifier(pvc *core.PersistentVolumeClaim) string
- func (r *Builder) Secret(_ ref.Ref, in, secret *core.Secret) (err error)
- func (r *Builder) Secrets(vmRef ref.Ref) (list []core.Secret, err error)
- func (r *Builder) SetPopulatorDataSourceLabels(vmRef ref.Ref, pvcs []*core.PersistentVolumeClaim) (err error)
- func (r *Builder) SourceVMLabelsAndAnnotations(vmRef ref.Ref, tagMapping *api.TagMapping) (labels map[string]string, annotations map[string]string, ...)
- func (r *Builder) SupportsVolumePopulators() bool
- func (r *Builder) Tasks(vmRef ref.Ref) (tasks []*plan.Task, err error)
- func (r *Builder) TemplateLabels(vmRef ref.Ref) (labels map[string]string, err error)
- func (r *Builder) VirtualMachine(vmRef ref.Ref, vmSpec *cnv.VirtualMachineSpec, ...) (err error)
- type Client
- func (r *Client) CheckSnapshotReady(vmRef ref.Ref, precopy planapi.Precopy, hosts util.HostsFunc) (ready bool, snapshotId string, err error)
- func (r *Client) CheckSnapshotRemove(vmRef ref.Ref, precopy planapi.Precopy, hosts util.HostsFunc) (bool, error)
- func (r *Client) Close()
- func (r *Client) CreateSnapshot(vmRef ref.Ref, hostsFunc util.HostsFunc) (snapshotId string, creationTaskId string, err error)
- func (r *Client) DetachDisks(vmRef ref.Ref) (err error)
- func (r *Client) Finalize(vmStatuses []*planapi.VMStatus, migrationName string)
- func (r *Client) GetSnapshotDeltas(vmRef ref.Ref, snapshot string, hostsFunc util.HostsFunc) (s map[string]string, err error)
- func (r *Client) PowerOff(vmRef ref.Ref) (err error)
- func (r *Client) PowerOn(vmRef ref.Ref) (err error)
- func (r *Client) PowerState(vmRef ref.Ref) (state planapi.VMPowerState, err error)
- func (r *Client) PoweredOff(vmRef ref.Ref) (off bool, err error)
- func (r *Client) PreTransferActions(vmRef ref.Ref) (ready bool, err error)
- func (r *Client) RemoveSnapshot(vmRef ref.Ref, snapshot string, hostsFunc util.HostsFunc) (removeTaskId string, err error)
- func (r *Client) SetCheckpoints(vmRef ref.Ref, precopies []planapi.Precopy, datavolumes []cdi.DataVolume, ...) error
- type DestinationClient
- type Validator
- func (r *Validator) ChangeTrackingEnabled(vmRef ref.Ref) (bool, error)
- func (r *Validator) DirectStorage(vmRef ref.Ref) (bool, error)
- func (r *Validator) GuestToolsInstalled(vmRef ref.Ref) (ok bool, err error)
- func (r *Validator) HasSnapshot(vmRef ref.Ref) (ok bool, msg string, category string, err error)
- func (r *Validator) InvalidDiskSizes(vmRef ref.Ref) ([]string, error)
- func (r *Validator) MacConflicts(vmRef ref.Ref) ([]planbase.MacConflict, error)
- func (r *Validator) MaintenanceMode(vmRef ref.Ref) (ok bool, err error)
- func (r *Validator) MigrationType() bool
- func (r *Validator) NICNetworkRefs(vmRef ref.Ref) (refs []ref.Ref, err error)
- func (r *Validator) NetworksMapped(vmRef ref.Ref) (ok bool, err error)
- func (r *Validator) PVCNameTemplate(vmRef ref.Ref, pvcNameTemplate string) (ok bool, err error)
- func (r *Validator) PowerState(vmRef ref.Ref) (ok bool, err error)
- func (r *Validator) SharedDisks(vmRef ref.Ref, client client.Client) (ok bool, s string, s2 string, err error)
- func (r *Validator) StaticIPs(vmRef ref.Ref) (bool, error)
- func (r *Validator) StorageMapped(vmRef ref.Ref) (ok bool, err error)
- func (r *Validator) UdnStaticIPs(vmRef ref.Ref, client client.Client) (ok bool, err error)
- func (r *Validator) VMMigrationType(vmRef ref.Ref) (ok bool, err error)
- func (r *Validator) WarmMigration() (ok bool)
Constants ¶
const ( TemplateOSLabel = "os.template.kubevirt.io/%s" TemplateWorkloadLabel = "workload.template.kubevirt.io/%s" TemplateWorkloadServer = "server" TemplateWorkloadDesktop = "desktop" TemplateWorkloadHighPerformance = "highperformance" TemplateFlavorLabel = "flavor.template.kubevirt.io/%s" TemplateFlavorTiny = "tiny" TemplateFlavorSmall = "small" TemplateFlavorMedium = "medium" TemplateFlavorLarge = "large" )
Template labels
const ( ArchLinux = "arch" CentOS = "centos" Debian = "debian" Fedora = "fedora" FreeBSD = "freebsd" Gentoo = "gentoo" Mandrake = "mandrake" Mandriva = "mandriva" MES = "mes" MSDOS = "msdos" NetBSD = "netbsd" Netware = "netware" OpenBSD = "openbsd" OpenSolaris = "opensolaris" OpenSUSE = "opensuse" RHEL = "rhel" SLED = "sled" Ubuntu = "ubuntu" Windows = "windows" )
OS Distros
const ( DefaultWindows = "win10" DefaultLinux = "rhel8.1" UnknownOS = "unknown" )
Default Operating Systems
const ( SecureBootRequired = "required" SecureBootDisabled = "disabled" SecureBootOptional = "optional" )
Secure boot options
const ( BIOS = "bios" EFI = "uefi" )
Firmware types
const ( CpuPolicyDedicated = "dedicated" )
CPU Policies
const ( CpuThreadPolicyPrefer = "prefer" CpuThreadPolicyIsolate = "isolate" CpuThreadPolicyRequire = "require" )
CPU Thread policies
const ( ScsiBus = "scsi" VirtioBus = "virtio" SataBus = "sata" UmlBus = "uml" XenBus = "xen" IdeBus = "ide" UsbBus = "usb" LxcBus = "lxc" )
Bus types
const ( Tablet = "tablet" UsbTablet = "usbtablet" )
Input types
const ( VideoVga = "vga" VideoVirtio = "virtio" VideoCirrus = "cirrus" VideoVmVga = "vmvga" VideoXen = "xen" VideoQxl = "qxl" VideoGop = "gop" VideoNONE = "none" VideoBochs = "bochs" )
Video models
const ( // KVM/Xen/VMWare VifModelE1000 = "e1000" // KVM/VMWare VifModelE1000e = "e1000e" // KVM/Xen VifModelNe2kpci = "ne2k_pci" VifModelPcnet = "pcnet" VifModelRtl8139 = "rtl8139" // KVM VifModelVmxnet3 = "vmxnet3" VifModelVirtio = "virtio" // VMWare VifModelVirtualE1000 = "VirtualE1000" VifModelVirtualE1000e = "VirtualE1000e" VifModelVirtualPcnet32 = "VirtualPCNet32" VifModelVirtualVmxnet = "VirtualVmxnet" VifModelVirtualVmxnet3 = "VirtualVmxnet3" //Xen VifModelNetfront = "netfront" )
Vif models
const ( AMI = "ami" ARI = "ari" AKI = "aki" VHD = "vhd" VHDX = "vhdx" VMDK = "vmdk" RAW = "raw" QCOW2 = "qcow2" VDI = "vdi" PLOOP = "ploop" ISO = "iso" )
Disk Formats
const ( Architecture = "architecture" HypervisorType = "hypervisor_type" CpuPolicy = "hw_cpu_policy" CpuThreadPolicy = "hw_cpu_thread_policy" CpuCores = "hw_cpu_cores" CpuSockets = "hw_cpu_sockets" CpuThreads = "hw_cpu_threads" FirmwareType = "hw_firmware_type" CdromBus = "hw_cdrom_bus" PointerModel = "hw_pointer_model" VideoModel = "hw_video_model" DiskBus = "hw_disk_bus" VifModel = "hw_vif_model" OsType = "os_type" OsDistro = "os_distro" OsVersion = "os_version" OsSecureBoot = "os_secure_boot" HwVideoRam = "hw_video_ram" HwRngModel = "hw_rng_model" VifMultiQueueEnabled = "hw_vif_multiqueue_enabled" )
Image Properties
const ( FlavorSecureBoot = "os:secure_boot" FlavorCpuPolicy = "hw:cpu_policy" FlavorCpuThreadPolicy = "hw:cpu_thread_policy" FlavorEmulatorThreadPolicy = "hw:emulator_threads_policy" FlavorCpuCores = "hw:cpu_cores" FlavorCpuSockets = "hw:cpu_sockets" FlavorCpuThreads = "hw:cpu_threads" FlavorMaxCpuCores = "hw:max_cpu_cores" FlavorMaxCpuSockets = "hw:max_cpu_sockets" FlavorMaxCpuThreads = "hw:max_cpu_threads" FlavorVifMultiQueueEnabled = "hw:vif_multiqueue_enabled" FlavorHwRng = "hw_rng:allowed" FlavorHwVideoRam = "hw_video:ram_max_mb" )
Flavor ExtraSpecs
const ( Pod = "pod" Multus = "multus" Ignored = "ignored" )
Network types
const ( ImageStatusActive = libclient.ImageStatusActive ImageStatusImporting = libclient.ImageStatusImporting ImageStatusQueued = libclient.ImageStatusQueued ImageStatusSaving = libclient.ImageStatusSaving ImageStatusUploading = libclient.ImageStatusUploading SnapshotStatusAvailable = libclient.SnapshotStatusAvailable SnapshotStatusCreating = libclient.SnapshotStatusCreating SnapshotStatusDeleting = libclient.SnapshotStatusDeleting SnapshotStatusDeleted = libclient.SnapshotStatusDeleted VolumeStatusAvailable = libclient.VolumeStatusAvailable VolumeStatusInUse = libclient.VolumeStatusInUse VolumeStatusCreating = libclient.VolumeStatusCreating VolumeStatusDeleting = libclient.VolumeStatusDeleting VolumeStatusUploading = libclient.VolumeStatusUploading )
const (
HwRngModelVirtio = "virtio"
)
HW RNG models
const (
Linux = "linux"
)
OS types
Variables ¶
var DefaultProperties = map[string]string{ CpuPolicy: CpuPolicyShared, CpuThreadPolicy: CpuThreadPolicyPrefer, FirmwareType: BIOS, CdromBus: IdeBus, PointerModel: UsbTablet, VideoModel: VideoVirtio, DiskBus: VirtioBus, VifModel: VifModelVirtio, OsType: Linux, OsSecureBoot: SecureBootDisabled, HwRngModel: HwRngModelVirtio, }
Default properties
var NameOrIDRequiredError = errors.New("id or name is required")
var ResourceNotFoundError = errors.New("resource not found")
var UnexpectedVolumeStatusError = errors.New("unexpected volume status")
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct{}
Openstack adapter.
func (*Adapter) DestinationClient ¶
func (r *Adapter) DestinationClient(ctx *plancontext.Context) (destinationClient base.DestinationClient, err error)
Constucts a destination client.
type Builder ¶
type Builder struct {
*plancontext.Context
}
Openstack builder.
func (*Builder) ConfigMaps ¶
func (*Builder) ConversionPodConfig ¶
ConversionPodConfig returns provider-specific configuration for the virt-v2v conversion pod. OpenStack provider does not require any special configuration.
func (*Builder) DataVolumes ¶
func (*Builder) GetPopulatorTaskName ¶
func (r *Builder) GetPopulatorTaskName(pvc *core.PersistentVolumeClaim) (taskName string, err error)
func (*Builder) LunPersistentVolumeClaims ¶
func (r *Builder) LunPersistentVolumeClaims(vmRef ref.Ref) (pvcs []core.PersistentVolumeClaim, err error)
Build LUN PVCs.
func (*Builder) LunPersistentVolumes ¶
Build LUN PVs.
func (*Builder) NetAppShiftPVCs ¶
func (*Builder) PodEnvironment ¶
func (*Builder) PopulatorTransferredBytes ¶
func (r *Builder) PopulatorTransferredBytes(persistentVolumeClaim *core.PersistentVolumeClaim) (transferredBytes int64, err error)
func (*Builder) PopulatorVolumes ¶
func (*Builder) PreferenceName ¶
func (*Builder) ResolveDataVolumeIdentifier ¶
func (r *Builder) ResolveDataVolumeIdentifier(dv *cdi.DataVolume) string
Return a stable identifier for a DataVolume.
func (*Builder) ResolvePersistentVolumeClaimIdentifier ¶
func (r *Builder) ResolvePersistentVolumeClaimIdentifier(pvc *core.PersistentVolumeClaim) string
Return a stable identifier for a PersistentDataVolume
func (*Builder) SetPopulatorDataSourceLabels ¶
func (*Builder) SourceVMLabelsAndAnnotations ¶
func (*Builder) SupportsVolumePopulators ¶
func (*Builder) TemplateLabels ¶
Build tasks.
func (*Builder) VirtualMachine ¶
func (r *Builder) VirtualMachine(vmRef ref.Ref, vmSpec *cnv.VirtualMachineSpec, persistentVolumeClaims []*core.PersistentVolumeClaim, usesInstanceType bool, sortVolumesByLibvirt bool) (err error)
Create the destination Kubevirt VM.
type Client ¶
type Client struct {
libclient.Client
Context *plancontext.Context
}
func (*Client) CheckSnapshotReady ¶
func (r *Client) CheckSnapshotReady(vmRef ref.Ref, precopy planapi.Precopy, hosts util.HostsFunc) (ready bool, snapshotId string, err error)
Check if a snapshot is ready to transfer.
func (*Client) CheckSnapshotRemove ¶
func (r *Client) CheckSnapshotRemove(vmRef ref.Ref, precopy planapi.Precopy, hosts util.HostsFunc) (bool, error)
CheckSnapshotRemove implements base.Client
func (*Client) CreateSnapshot ¶
func (r *Client) CreateSnapshot(vmRef ref.Ref, hostsFunc util.HostsFunc) (snapshotId string, creationTaskId string, err error)
Create a snapshot of the source VM.
func (*Client) GetSnapshotDeltas ¶
func (r *Client) GetSnapshotDeltas(vmRef ref.Ref, snapshot string, hostsFunc util.HostsFunc) (s map[string]string, err error)
Get disk deltas for a VM snapshot. No-op for this provider.
func (*Client) PowerState ¶
Return the source VM's power state.
func (*Client) PoweredOff ¶
Return whether the source VM is powered off.
func (*Client) PreTransferActions ¶
type DestinationClient ¶
type DestinationClient struct {
*plancontext.Context
}
func (*DestinationClient) DeleteObject ¶
func (r *DestinationClient) DeleteObject(object client.Object, vm *plan.VMStatus, message, objType string) (err error)
Deletes an object from destination cluster associated with the VM.
func (*DestinationClient) DeletePopulatorDataSource ¶
func (r *DestinationClient) DeletePopulatorDataSource(vm *plan.VMStatus) error
Delete OpenstackVolumePopulator CustomResource list.
func (*DestinationClient) SetPopulatorCrOwnership ¶
func (r *DestinationClient) SetPopulatorCrOwnership() (err error)
Set the OpenstackVolumePopulator CustomResource Ownership.
type Validator ¶
type Validator struct {
*plancontext.Context
}
Validator
func (*Validator) ChangeTrackingEnabled ¶
NO-OP
func (*Validator) DirectStorage ¶
NO-OP
func (*Validator) GuestToolsInstalled ¶
NO-OP
func (*Validator) HasSnapshot ¶
HasSnapshot - OpenStack doesn't support warm migration, so no snapshot validation needed
func (*Validator) InvalidDiskSizes ¶
func (*Validator) MacConflicts ¶
func (*Validator) MaintenanceMode ¶
Validate that a VM's Host isn't in maintenance mode.
func (*Validator) MigrationType ¶
MigrationType indicates whether the plan's migration type is supported by this provider.
func (*Validator) NICNetworkRefs ¶
NICNetworkRefs returns one source-network ref per VM network attachment.
func (*Validator) NetworksMapped ¶
Validate that a VM's networks have been mapped.
func (*Validator) PVCNameTemplate ¶
NO-OP
func (*Validator) SharedDisks ¶
func (*Validator) StorageMapped ¶
func (*Validator) UdnStaticIPs ¶
NO-OP
func (*Validator) VMMigrationType ¶
func (*Validator) WarmMigration ¶
Validate whether warm migration is supported from this provider type.