-
Notifications
You must be signed in to change notification settings - Fork 7
/
types.go
3062 lines (2656 loc) · 141 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Copyright 2017 Red Hat, Inc.
*
*/
package v1
/*
ATTENTION: Rerun code generators when comments on structs or fields are modified.
*/
import (
"encoding/json"
"fmt"
k8sv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
cdiv1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1"
)
const DefaultGracePeriodSeconds int64 = 30
// VirtualMachineInstance is *the* VirtualMachineInstance Definition. It represents a virtual machine in the runtime environment of kubernetes.
//
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +genclient
type VirtualMachineInstance struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// VirtualMachineInstance Spec contains the VirtualMachineInstance specification.
Spec VirtualMachineInstanceSpec `json:"spec" valid:"required"`
// Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users.
Status VirtualMachineInstanceStatus `json:"status,omitempty"`
}
func (v *VirtualMachineInstance) MarshalBinary() (data []byte, err error) {
return json.Marshal(*v)
}
func (v *VirtualMachineInstance) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, v)
}
// VirtualMachineInstanceList is a list of VirtualMachines
//
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VirtualMachineInstanceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []VirtualMachineInstance `json:"items"`
}
type EvictionStrategy string
type StartStrategy string
const (
StartStrategyPaused StartStrategy = "Paused"
)
// VirtualMachineInstanceSpec is a description of a VirtualMachineInstance.
type VirtualMachineInstanceSpec struct {
// If specified, indicates the pod's priority.
// If not specified, the pod priority will be default or zero if there is no
// default.
// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`
// Specification of the desired behavior of the VirtualMachineInstance on the host.
Domain DomainSpec `json:"domain"`
// NodeSelector is a selector which must be true for the vmi to fit on a node.
// Selector which must match a node's labels for the vmi to be scheduled on that node.
// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// If affinity is specifies, obey all the affinity rules
Affinity *k8sv1.Affinity `json:"affinity,omitempty"`
// If specified, the VMI will be dispatched by specified scheduler.
// If not specified, the VMI will be dispatched by default scheduler.
// +optional
SchedulerName string `json:"schedulerName,omitempty"`
// If toleration is specified, obey all the toleration rules.
Tolerations []k8sv1.Toleration `json:"tolerations,omitempty"`
// TopologySpreadConstraints describes how a group of VMIs will be spread across a given topology
// domains. K8s scheduler will schedule VMI pods in a way which abides by the constraints.
// +optional
// +patchMergeKey=topologyKey
// +patchStrategy=merge
// +listType=map
// +listMapKey=topologyKey
// +listMapKey=whenUnsatisfiable
TopologySpreadConstraints []k8sv1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty" patchStrategy:"merge" patchMergeKey:"topologyKey"`
// EvictionStrategy describes the strategy to follow when a node drain occurs.
// The possible options are:
// - "None": No action will be taken, according to the specified 'RunStrategy' the VirtualMachine will be restarted or shutdown.
// - "LiveMigrate": the VirtualMachineInstance will be migrated instead of being shutdown.
// - "LiveMigrateIfPossible": the same as "LiveMigrate" but only if the VirtualMachine is Live-Migratable, otherwise it will behave as "None".
// - "External": the VirtualMachineInstance will be protected by a PDB and `vmi.Status.EvacuationNodeName` will be set on eviction. This is mainly useful for cluster-api-provider-kubevirt (capk) which needs a way for VMI's to be blocked from eviction, yet signal capk that eviction has been called on the VMI so the capk controller can handle tearing the VMI down. Details can be found in the commit description https://github.com/kubevirt/kubevirt/commit/c1d77face705c8b126696bac9a3ee3825f27f1fa.
// +optional
EvictionStrategy *EvictionStrategy `json:"evictionStrategy,omitempty"`
// StartStrategy can be set to "Paused" if Virtual Machine should be started in paused state.
//
// +optional
StartStrategy *StartStrategy `json:"startStrategy,omitempty"`
// Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated.
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
// List of volumes that can be mounted by disks belonging to the vmi.
// +kubebuilder:validation:MaxItems:=256
Volumes []Volume `json:"volumes,omitempty"`
// Periodic probe of VirtualMachineInstance liveness.
// VirtualmachineInstances will be stopped if the probe fails.
// Cannot be updated.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
LivenessProbe *Probe `json:"livenessProbe,omitempty"`
// Periodic probe of VirtualMachineInstance service readiness.
// VirtualmachineInstances will be removed from service endpoints if the probe fails.
// Cannot be updated.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
// Specifies the hostname of the vmi
// If not specified, the hostname will be set to the name of the vmi, if dhcp or cloud-init is configured properly.
// +optional
Hostname string `json:"hostname,omitempty"`
// If specified, the fully qualified vmi hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>".
// If not specified, the vmi will not have a domainname at all. The DNS entry will resolve to the vmi,
// no matter if the vmi itself can pick up a hostname.
// +optional
Subdomain string `json:"subdomain,omitempty"`
// List of networks that can be attached to a vm's virtual interface.
// +kubebuilder:validation:MaxItems:=256
Networks []Network `json:"networks,omitempty"`
// Set DNS policy for the pod.
// Defaults to "ClusterFirst".
// Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
// DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
// To have DNS options set along with hostNetwork, you have to specify DNS policy
// explicitly to 'ClusterFirstWithHostNet'.
// +optional
DNSPolicy k8sv1.DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"`
// Specifies the DNS parameters of a pod.
// Parameters specified here will be merged to the generated DNS
// configuration based on DNSPolicy.
// +optional
DNSConfig *k8sv1.PodDNSConfig `json:"dnsConfig,omitempty" protobuf:"bytes,26,opt,name=dnsConfig"`
// Specifies a set of public keys to inject into the vm guest
// +listType=atomic
// +optional
// +kubebuilder:validation:MaxItems:=256
AccessCredentials []AccessCredential `json:"accessCredentials,omitempty"`
// Specifies the architecture of the vm guest you are attempting to run. Defaults to the compiled architecture of the KubeVirt components
Architecture string `json:"architecture,omitempty"`
}
func (vmiSpec *VirtualMachineInstanceSpec) UnmarshalJSON(data []byte) error {
type VMISpecAlias VirtualMachineInstanceSpec
var vmiSpecAlias VMISpecAlias
if err := json.Unmarshal(data, &vmiSpecAlias); err != nil {
return err
}
if vmiSpecAlias.DNSConfig != nil {
for i, ns := range vmiSpecAlias.DNSConfig.Nameservers {
if sanitizedIP, err := sanitizeIP(ns); err == nil {
vmiSpecAlias.DNSConfig.Nameservers[i] = sanitizedIP
}
}
}
*vmiSpec = VirtualMachineInstanceSpec(vmiSpecAlias)
return nil
}
// VirtualMachineInstancePhaseTransitionTimestamp gives a timestamp in relation to when a phase is set on a vmi
type VirtualMachineInstancePhaseTransitionTimestamp struct {
// Phase is the status of the VirtualMachineInstance in kubernetes world. It is not the VirtualMachineInstance status, but partially correlates to it.
Phase VirtualMachineInstancePhase `json:"phase,omitempty"`
// PhaseTransitionTimestamp is the timestamp of when the phase change occurred
PhaseTransitionTimestamp metav1.Time `json:"phaseTransitionTimestamp,omitempty"`
}
type TopologyHints struct {
TSCFrequency *int64 `json:"tscFrequency,omitempty"`
}
// VirtualMachineInstanceStatus represents information about the status of a VirtualMachineInstance. Status may trail the actual
// state of a system.
type VirtualMachineInstanceStatus struct {
// NodeName is the name where the VirtualMachineInstance is currently running.
NodeName string `json:"nodeName,omitempty"`
// A brief CamelCase message indicating details about why the VMI is in this state. e.g. 'NodeUnresponsive'
// +optional
Reason string `json:"reason,omitempty"`
// Conditions are specific points in VirtualMachineInstance's pod runtime.
Conditions []VirtualMachineInstanceCondition `json:"conditions,omitempty"`
// Phase is the status of the VirtualMachineInstance in kubernetes world. It is not the VirtualMachineInstance status, but partially correlates to it.
Phase VirtualMachineInstancePhase `json:"phase,omitempty"`
// PhaseTransitionTimestamp is the timestamp of when the last phase change occurred
// +listType=atomic
// +optional
PhaseTransitionTimestamps []VirtualMachineInstancePhaseTransitionTimestamp `json:"phaseTransitionTimestamps,omitempty"`
// Interfaces represent the details of available network interfaces.
Interfaces []VirtualMachineInstanceNetworkInterface `json:"interfaces,omitempty"`
// Guest OS Information
GuestOSInfo VirtualMachineInstanceGuestOSInfo `json:"guestOSInfo,omitempty"`
// Represents the status of a live migration
MigrationState *VirtualMachineInstanceMigrationState `json:"migrationState,omitempty"`
// Represents the method using which the vmi can be migrated: live migration or block migration
MigrationMethod VirtualMachineInstanceMigrationMethod `json:"migrationMethod,omitempty"`
// This represents the migration transport
MigrationTransport VirtualMachineInstanceMigrationTransport `json:"migrationTransport,omitempty"`
// The Quality of Service (QOS) classification assigned to the virtual machine instance based on resource requirements
// See PodQOSClass type for available QOS classes
// More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md
// +optional
QOSClass *k8sv1.PodQOSClass `json:"qosClass,omitempty"`
// LauncherContainerImageVersion indicates what container image is currently active for the vmi.
LauncherContainerImageVersion string `json:"launcherContainerImageVersion,omitempty"`
// EvacuationNodeName is used to track the eviction process of a VMI. It stores the name of the node that we want
// to evacuate. It is meant to be used by KubeVirt core components only and can't be set or modified by users.
// +optional
EvacuationNodeName string `json:"evacuationNodeName,omitempty"`
// ActivePods is a mapping of pod UID to node name.
// It is possible for multiple pods to be running for a single VMI during migration.
ActivePods map[types.UID]string `json:"activePods,omitempty"`
// VolumeStatus contains the statuses of all the volumes
// +optional
// +listType=atomic
VolumeStatus []VolumeStatus `json:"volumeStatus,omitempty"`
// KernelBootStatus contains info about the kernelBootContainer
// +optional
KernelBootStatus *KernelBootStatus `json:"kernelBootStatus,omitempty"`
// FSFreezeStatus is the state of the fs of the guest
// it can be either frozen or thawed
// +optional
FSFreezeStatus string `json:"fsFreezeStatus,omitempty"`
// +optional
TopologyHints *TopologyHints `json:"topologyHints,omitempty"`
//VirtualMachineRevisionName is used to get the vm revision of the vmi when doing
// an online vm snapshot
// +optional
VirtualMachineRevisionName string `json:"virtualMachineRevisionName,omitempty"`
// RuntimeUser is used to determine what user will be used in launcher
// +optional
RuntimeUser uint64 `json:"runtimeUser"`
// VSOCKCID is used to track the allocated VSOCK CID in the VM.
// +optional
VSOCKCID *uint32 `json:"VSOCKCID,omitempty"`
// SELinuxContext is the actual SELinux context of the virt-launcher pod
// +optional
SelinuxContext string `json:"selinuxContext,omitempty"`
// Machine shows the final resulting qemu machine type. This can be different
// than the machine type selected in the spec, due to qemus machine type alias mechanism.
// +optional
Machine *Machine `json:"machine,omitempty"`
// CurrentCPUTopology specifies the current CPU topology used by the VM workload.
// Current topology may differ from the desired topology in the spec while CPU hotplug
// takes place.
CurrentCPUTopology *CPUTopology `json:"currentCPUTopology,omitempty"`
// Memory shows various informations about the VirtualMachine memory.
// +optional
Memory *MemoryStatus `json:"memory,omitempty"`
// MigratedVolumes lists the source and destination volumes during the volume migration
// +listType=atomic
// +optional
MigratedVolumes []StorageMigratedVolumeInfo `json:"migratedVolumes,omitempty"`
}
// StorageMigratedVolumeInfo tracks the information about the source and destination volumes during the volume migration
type StorageMigratedVolumeInfo struct {
// VolumeName is the name of the volume that is being migrated
VolumeName string `json:"volumeName"`
// SourcePVCInfo contains the information about the source PVC
SourcePVCInfo *PersistentVolumeClaimInfo `json:"sourcePVCInfo,omitempty" valid:"required"`
// DestinationPVCInfo contains the information about the destination PVC
DestinationPVCInfo *PersistentVolumeClaimInfo `json:"destinationPVCInfo,omitempty" valid:"required"`
}
// PersistentVolumeClaimInfo contains the relavant information virt-handler needs cached about a PVC
type PersistentVolumeClaimInfo struct {
// ClaimName is the name of the PVC
ClaimName string `json:"claimName,omitempty"`
// AccessModes contains the desired access modes the volume should have.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
// +listType=atomic
// +optional
AccessModes []k8sv1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`
// VolumeMode defines what type of volume is required by the claim.
// Value of Filesystem is implied when not included in claim spec.
// +optional
VolumeMode *k8sv1.PersistentVolumeMode `json:"volumeMode,omitempty"`
// Capacity represents the capacity set on the corresponding PVC status
// +optional
Capacity k8sv1.ResourceList `json:"capacity,omitempty"`
// Requests represents the resources requested by the corresponding PVC spec
// +optional
Requests k8sv1.ResourceList `json:"requests,omitempty"`
// Preallocated indicates if the PVC's storage is preallocated or not
// +optional
Preallocated bool `json:"preallocated,omitempty"`
// Percentage of filesystem's size to be reserved when resizing the PVC
// +optional
FilesystemOverhead *Percent `json:"filesystemOverhead,omitempty"`
}
// Percent is a string that can only be a value between [0,1)
// +kubebuilder:validation:Pattern=`^(0(?:\.\d{1,3})?|1)$`
type Percent string
// VolumeStatus represents information about the status of volumes attached to the VirtualMachineInstance.
type VolumeStatus struct {
// Name is the name of the volume
Name string `json:"name"`
// Target is the target name used when adding the volume to the VM, eg: vda
Target string `json:"target"`
// Phase is the phase
Phase VolumePhase `json:"phase,omitempty"`
// Reason is a brief description of why we are in the current hotplug volume phase
Reason string `json:"reason,omitempty"`
// Message is a detailed message about the current hotplug volume phase
Message string `json:"message,omitempty"`
// PersistentVolumeClaimInfo is information about the PVC that handler requires during start flow
PersistentVolumeClaimInfo *PersistentVolumeClaimInfo `json:"persistentVolumeClaimInfo,omitempty"`
// If the volume is hotplug, this will contain the hotplug status.
HotplugVolume *HotplugVolumeStatus `json:"hotplugVolume,omitempty"`
// Represents the size of the volume
Size int64 `json:"size,omitempty"`
// If the volume is memorydump volume, this will contain the memorydump info.
MemoryDumpVolume *DomainMemoryDumpInfo `json:"memoryDumpVolume,omitempty"`
// ContainerDiskVolume shows info about the containerdisk, if the volume is a containerdisk
ContainerDiskVolume *ContainerDiskInfo `json:"containerDiskVolume,omitempty"`
}
// KernelInfo show info about the kernel image
type KernelInfo struct {
// Checksum is the checksum of the kernel image
Checksum uint32 `json:"checksum,omitempty"`
}
// InitrdInfo show info about the initrd file
type InitrdInfo struct {
// Checksum is the checksum of the initrd file
Checksum uint32 `json:"checksum,omitempty"`
}
// KernelBootStatus contains info about the kernelBootContainer
type KernelBootStatus struct {
// KernelInfo show info about the kernel image
KernelInfo *KernelInfo `json:"kernelInfo,omitempty"`
// InitrdInfo show info about the initrd file
InitrdInfo *InitrdInfo `json:"initrdInfo,omitempty"`
}
// DomainMemoryDumpInfo represents the memory dump information
type DomainMemoryDumpInfo struct {
// StartTimestamp is the time when the memory dump started
StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"`
// EndTimestamp is the time when the memory dump completed
EndTimestamp *metav1.Time `json:"endTimestamp,omitempty"`
// ClaimName is the name of the pvc the memory was dumped to
ClaimName string `json:"claimName,omitempty"`
// TargetFileName is the name of the memory dump output
TargetFileName string `json:"targetFileName,omitempty"`
}
// HotplugVolumeStatus represents the hotplug status of the volume
type HotplugVolumeStatus struct {
// AttachPodName is the name of the pod used to attach the volume to the node.
AttachPodName string `json:"attachPodName,omitempty"`
// AttachPodUID is the UID of the pod used to attach the volume to the node.
AttachPodUID types.UID `json:"attachPodUID,omitempty"`
}
// ContainerDiskInfo shows info about the containerdisk
type ContainerDiskInfo struct {
// Checksum is the checksum of the rootdisk or kernel artifacts inside the containerdisk
Checksum uint32 `json:"checksum,omitempty"`
}
// VolumePhase indicates the current phase of the hotplug process.
type VolumePhase string
const (
// VolumePending means the Volume is pending and cannot be attached to the node yet.
VolumePending VolumePhase = "Pending"
// VolumeBound means the Volume is bound and can be attach to the node.
VolumeBound VolumePhase = "Bound"
// HotplugVolumeAttachedToNode means the volume has been attached to the node.
HotplugVolumeAttachedToNode VolumePhase = "AttachedToNode"
// HotplugVolumeMounted means the volume has been attached to the node and is mounted to the virt-launcher pod.
HotplugVolumeMounted VolumePhase = "MountedToPod"
// VolumeReady means the volume is ready to be used by the VirtualMachineInstance.
VolumeReady VolumePhase = "Ready"
// HotplugVolumeDetaching means the volume is being detached from the node, and the attachment pod is being removed.
HotplugVolumeDetaching VolumePhase = "Detaching"
// HotplugVolumeUnMounted means the volume has been unmounted from the virt-launcer pod.
HotplugVolumeUnMounted VolumePhase = "UnMountedFromPod"
// MemoryDumpVolumeCompleted means that the requested memory dump was completed and the dump is ready in the volume
MemoryDumpVolumeCompleted VolumePhase = "MemoryDumpCompleted"
// MemoryDumpVolumeInProgress means that the volume for the memory dump was attached, and now the command is being triggered
MemoryDumpVolumeInProgress VolumePhase = "MemoryDumpInProgress"
// MemoryDumpVolumeInProgress means that the volume for the memory dump was attached, and now the command is being triggered
MemoryDumpVolumeFailed VolumePhase = "MemoryDumpFailed"
)
func (v *VirtualMachineInstance) IsScheduling() bool {
return v.Status.Phase == Scheduling
}
func (v *VirtualMachineInstance) IsScheduled() bool {
return v.Status.Phase == Scheduled
}
func (v *VirtualMachineInstance) IsRunning() bool {
return v.Status.Phase == Running
}
func (v *VirtualMachineInstance) IsMarkedForEviction() bool {
return v.Status.EvacuationNodeName != ""
}
func (v *VirtualMachineInstance) IsMigratable() bool {
for _, cond := range v.Status.Conditions {
if cond.Type == VirtualMachineInstanceIsMigratable && cond.Status == k8sv1.ConditionTrue {
return true
}
}
return false
}
func (v *VirtualMachineInstance) IsFinal() bool {
return v.Status.Phase == Failed || v.Status.Phase == Succeeded
}
func (v *VirtualMachineInstance) IsMarkedForDeletion() bool {
return v.ObjectMeta.DeletionTimestamp != nil
}
func (v *VirtualMachineInstance) IsUnknown() bool {
return v.Status.Phase == Unknown
}
func (v *VirtualMachineInstance) IsUnprocessed() bool {
return v.Status.Phase == Pending || v.Status.Phase == VmPhaseUnset
}
// Checks if CPU pinning has been requested
func (v *VirtualMachineInstance) IsCPUDedicated() bool {
return v.Spec.Domain.CPU != nil && v.Spec.Domain.CPU.DedicatedCPUPlacement
}
func (v *VirtualMachineInstance) IsBootloaderEFI() bool {
return v.Spec.Domain.Firmware != nil && v.Spec.Domain.Firmware.Bootloader != nil &&
v.Spec.Domain.Firmware.Bootloader.EFI != nil
}
// WantsToHaveQOSGuaranteed checks if cpu and memoyr limits and requests are identical on the VMI.
// This is the indicator that people want a VMI with QOS of guaranteed
func (v *VirtualMachineInstance) WantsToHaveQOSGuaranteed() bool {
resources := v.Spec.Domain.Resources
return !resources.Requests.Memory().IsZero() && resources.Requests.Memory().Cmp(*resources.Limits.Memory()) == 0 &&
!resources.Requests.Cpu().IsZero() && resources.Requests.Cpu().Cmp(*resources.Limits.Cpu()) == 0
}
// ShouldStartPaused returns true if VMI should be started in paused state
func (v *VirtualMachineInstance) ShouldStartPaused() bool {
return v.Spec.StartStrategy != nil && *v.Spec.StartStrategy == StartStrategyPaused
}
func (v *VirtualMachineInstance) IsRealtimeEnabled() bool {
return v.Spec.Domain.CPU != nil && v.Spec.Domain.CPU.Realtime != nil
}
// IsHighPerformanceVMI returns true if the VMI is considered as high performance.
// A VMI is considered as high performance if one of the following is true:
// - the vmi requests a dedicated cpu
// - the realtime flag is enabled
// - the vmi requests hugepages
func (v *VirtualMachineInstance) IsHighPerformanceVMI() bool {
if v.Spec.Domain.CPU != nil {
if v.Spec.Domain.CPU.DedicatedCPUPlacement || v.Spec.Domain.CPU.Realtime != nil {
return true
}
}
if v.Spec.Domain.Memory != nil && v.Spec.Domain.Memory.Hugepages != nil {
return true
}
return false
}
type VirtualMachineInstanceConditionType string
// These are valid conditions of VMIs.
const (
// Provisioning means, a VMI depends on DataVolumes which are in Pending/WaitForFirstConsumer status,
// and some actions are taken to provision the PVCs for the DataVolumes
VirtualMachineInstanceProvisioning VirtualMachineInstanceConditionType = "Provisioning"
// Ready means the VMI is able to service requests and should be added to the
// load balancing pools of all matching services.
VirtualMachineInstanceReady VirtualMachineInstanceConditionType = "Ready"
// If there happens any error while trying to synchronize the VirtualMachineInstance with the Domain,
// this is reported as false.
VirtualMachineInstanceSynchronized VirtualMachineInstanceConditionType = "Synchronized"
// If the VMI was paused by the user, this is reported as true.
VirtualMachineInstancePaused VirtualMachineInstanceConditionType = "Paused"
// Reflects whether the QEMU guest agent is connected through the channel
VirtualMachineInstanceAgentConnected VirtualMachineInstanceConditionType = "AgentConnected"
// Reflects whether the QEMU guest agent updated access credentials successfully
VirtualMachineInstanceAccessCredentialsSynchronized VirtualMachineInstanceConditionType = "AccessCredentialsSynchronized"
// Reflects whether the QEMU guest agent is connected through the channel
VirtualMachineInstanceUnsupportedAgent VirtualMachineInstanceConditionType = "AgentVersionNotSupported"
// Indicates whether the VMI is live migratable
VirtualMachineInstanceIsMigratable VirtualMachineInstanceConditionType = "LiveMigratable"
// Indicates that the VMI is in progress of Hot vCPU Plug/UnPlug
VirtualMachineInstanceVCPUChange VirtualMachineInstanceConditionType = "HotVCPUChange"
// Indicates that the VMI is hot(un)plugging memory
VirtualMachineInstanceMemoryChange VirtualMachineInstanceConditionType = "HotMemoryChange"
// Indicates that the VMI has an updates in its volume set
VirtualMachineInstanceVolumesChange VirtualMachineInstanceConditionType = "VolumesChange"
// Summarizes that all the DataVolumes attached to the VMI are Ready or not
VirtualMachineInstanceDataVolumesReady VirtualMachineInstanceConditionType = "DataVolumesReady"
)
// These are valid reasons for VMI conditions.
const (
// Reason means that VMI is not live migratioable because of it's disks collection
VirtualMachineInstanceReasonDisksNotMigratable = "DisksNotLiveMigratable"
// Reason means that VMI is not live migratioable because of it's network interfaces collection
VirtualMachineInstanceReasonInterfaceNotMigratable = "InterfaceNotLiveMigratable"
// Reason means that VMI is not live migratioable because it uses hotplug
VirtualMachineInstanceReasonHotplugNotMigratable = "HotplugNotLiveMigratable"
// Reason means that VMI is not live migratioable because of it's CPU mode
VirtualMachineInstanceReasonCPUModeNotMigratable = "CPUModeLiveMigratable"
// Reason means that VMI is not live migratable because it uses virtiofs
VirtualMachineInstanceReasonVirtIOFSNotMigratable = "VirtIOFSNotLiveMigratable"
// Reason means that VMI is not live migratable because it uses PCI host devices
VirtualMachineInstanceReasonHostDeviceNotMigratable = "HostDeviceNotLiveMigratable"
// Reason means that VMI is not live migratable because it uses Secure Encrypted Virtualization (SEV)
VirtualMachineInstanceReasonSEVNotMigratable = "SEVNotLiveMigratable"
// Reason means that VMI is not live migratable because it uses HyperV Reenlightenment while TSC Frequency is not available
VirtualMachineInstanceReasonNoTSCFrequencyMigratable = "NoTSCFrequencyNotLiveMigratable"
// Reason means that VMI is not live migratable because it uses HyperV Reenlightenment while TSC Frequency is not available
VirtualMachineInstanceReasonHypervPassthroughNotMigratable = "HypervPassthroughNotLiveMigratable"
// Reason means that VMI is not live migratable because it requested SCSI persitent reservation
VirtualMachineInstanceReasonPRNotMigratable = "PersistentReservationNotLiveMigratable"
// Reason means that not all of the VMI's DVs are ready
VirtualMachineInstanceReasonNotAllDVsReady = "NotAllDVsReady"
// Reason means that all of the VMI's DVs are bound and not running
VirtualMachineInstanceReasonAllDVsReady = "AllDVsReady"
)
const (
// PodTerminatingReason indicates on the Ready condition on the VMI if the underlying pod is terminating
PodTerminatingReason = "PodTerminating"
// PodNotExistsReason indicates on the Ready condition on the VMI if the underlying pod does not exist
PodNotExistsReason = "PodNotExists"
// PodConditionMissingReason indicates on the Ready condition on the VMI if the underlying pod does not report a Ready condition
PodConditionMissingReason = "PodConditionMissing"
// GuestNotRunningReason indicates on the Ready condition on the VMI if the underlying guest VM is not running
GuestNotRunningReason = "GuestNotRunning"
)
type VirtualMachineInstanceMigrationConditionType string
// These are valid conditions of VMIs.
const (
// VirtualMachineInstanceMigrationAbortRequested indicates that live migration abort has been requested
VirtualMachineInstanceMigrationAbortRequested VirtualMachineInstanceMigrationConditionType = "migrationAbortRequested"
VirtualMachineInstanceMigrationRejectedByResourceQuota VirtualMachineInstanceMigrationConditionType = "migrationRejectedByResourceQuota"
)
type VirtualMachineInstanceCondition struct {
Type VirtualMachineInstanceConditionType `json:"type"`
Status k8sv1.ConditionStatus `json:"status"`
// +nullable
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
// +nullable
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
}
type VirtualMachineInstanceMigrationCondition struct {
Type VirtualMachineInstanceMigrationConditionType `json:"type"`
Status k8sv1.ConditionStatus `json:"status"`
// +nullable
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
// +nullable
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
}
// The migration phase indicates that the job has completed
func (m *VirtualMachineInstanceMigration) IsFinal() bool {
return m.Status.Phase == MigrationFailed || m.Status.Phase == MigrationSucceeded
}
func (m *VirtualMachineInstanceMigration) IsRunning() bool {
switch m.Status.Phase {
case MigrationFailed, MigrationPending, MigrationPhaseUnset, MigrationSucceeded:
return false
}
return true
}
// The migration phase indicates that the target pod should have already been created
func (m *VirtualMachineInstanceMigration) TargetIsCreated() bool {
return m.Status.Phase != MigrationPhaseUnset &&
m.Status.Phase != MigrationPending
}
// The migration phase indicates that job has been handed off to the VMI controllers to complete.
func (m *VirtualMachineInstanceMigration) TargetIsHandedOff() bool {
return m.Status.Phase != MigrationPhaseUnset &&
m.Status.Phase != MigrationPending &&
m.Status.Phase != MigrationScheduling &&
m.Status.Phase != MigrationScheduled
}
type VirtualMachineInstanceNetworkInterface struct {
// IP address of a Virtual Machine interface. It is always the first item of
// IPs
IP string `json:"ipAddress,omitempty"`
// Hardware address of a Virtual Machine interface
MAC string `json:"mac,omitempty"`
// Name of the interface, corresponds to name of the network assigned to the interface
Name string `json:"name,omitempty"`
// List of all IP addresses of a Virtual Machine interface
IPs []string `json:"ipAddresses,omitempty"`
// The interface name inside the Virtual Machine
InterfaceName string `json:"interfaceName,omitempty"`
// Specifies the origin of the interface data collected. values: domain, guest-agent, multus-status.
InfoSource string `json:"infoSource,omitempty"`
// Specifies how many queues are allocated by MultiQueue
QueueCount int32 `json:"queueCount,omitempty"`
}
type VirtualMachineInstanceGuestOSInfo struct {
// Name of the Guest OS
Name string `json:"name,omitempty"`
// Guest OS Kernel Release
KernelRelease string `json:"kernelRelease,omitempty"`
// Guest OS Version
Version string `json:"version,omitempty"`
// Guest OS Pretty Name
PrettyName string `json:"prettyName,omitempty"`
// Version ID of the Guest OS
VersionID string `json:"versionId,omitempty"`
// Kernel version of the Guest OS
KernelVersion string `json:"kernelVersion,omitempty"`
// Machine type of the Guest OS
Machine string `json:"machine,omitempty"`
// Guest OS Id
ID string `json:"id,omitempty"`
}
// MigrationConfigSource indicates the source of migration configuration.
//
// +k8s:openapi-gen=true
type MigrationConfigSource string
// +k8s:openapi-gen=true
type VirtualMachineInstanceMigrationState struct {
// The time the migration action began
// +nullable
StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"`
// The time the migration action ended
// +nullable
EndTimestamp *metav1.Time `json:"endTimestamp,omitempty"`
// The timestamp at which the target node detects the domain is active
TargetNodeDomainReadyTimestamp *metav1.Time `json:"targetNodeDomainReadyTimestamp,omitempty"`
// The Target Node has seen the Domain Start Event
TargetNodeDomainDetected bool `json:"targetNodeDomainDetected,omitempty"`
// The address of the target node to use for the migration
TargetNodeAddress string `json:"targetNodeAddress,omitempty"`
// The list of ports opened for live migration on the destination node
TargetDirectMigrationNodePorts map[string]int `json:"targetDirectMigrationNodePorts,omitempty"`
// The target node that the VMI is moving to
TargetNode string `json:"targetNode,omitempty"`
// The target pod that the VMI is moving to
TargetPod string `json:"targetPod,omitempty"`
// The UID of the target attachment pod for hotplug volumes
TargetAttachmentPodUID types.UID `json:"targetAttachmentPodUID,omitempty"`
// The source node that the VMI originated on
SourceNode string `json:"sourceNode,omitempty"`
SourcePod string `json:"sourcePod,omitempty"`
// Indicates the migration completed
Completed bool `json:"completed,omitempty"`
// Indicates that the migration failed
Failed bool `json:"failed,omitempty"`
// Indicates that the migration has been requested to abort
AbortRequested bool `json:"abortRequested,omitempty"`
// Indicates the final status of the live migration abortion
AbortStatus MigrationAbortStatus `json:"abortStatus,omitempty"`
// Contains the reason why the migration failed
FailureReason string `json:"failureReason,omitempty"`
// The VirtualMachineInstanceMigration object associated with this migration
MigrationUID types.UID `json:"migrationUid,omitempty"`
// Lets us know if the vmi is currently running pre or post copy migration
Mode MigrationMode `json:"mode,omitempty"`
// Name of the migration policy. If string is empty, no policy is matched
MigrationPolicyName *string `json:"migrationPolicyName,omitempty"`
// Migration configurations to apply
MigrationConfiguration *MigrationConfiguration `json:"migrationConfiguration,omitempty"`
// If the VMI requires dedicated CPUs, this field will
// hold the dedicated CPU set on the target node
// +listType=atomic
TargetCPUSet []int `json:"targetCPUSet,omitempty"`
// If the VMI requires dedicated CPUs, this field will
// hold the numa topology on the target node
TargetNodeTopology string `json:"targetNodeTopology,omitempty"`
}
type MigrationAbortStatus string
const (
// MigrationAbortSucceeded means that the VirtualMachineInstance live migration has been aborted
MigrationAbortSucceeded MigrationAbortStatus = "Succeeded"
// MigrationAbortFailed means that the vmi live migration has failed to be abort
MigrationAbortFailed MigrationAbortStatus = "Failed"
// MigrationAbortInProgress mean that the vmi live migration is aborting
MigrationAbortInProgress MigrationAbortStatus = "Aborting"
)
type MigrationMode string
const (
// MigrationPreCopy means the VMI migrations that is currently running is in pre copy mode
MigrationPreCopy MigrationMode = "PreCopy"
// MigrationPostCopy means the VMI migrations that is currently running is in post copy mode
MigrationPostCopy MigrationMode = "PostCopy"
)
type VirtualMachineInstanceMigrationTransport string
const (
// MigrationTransportUnix means that the VMI will be migrated using the unix URI
MigrationTransportUnix VirtualMachineInstanceMigrationTransport = "Unix"
)
type VirtualMachineInstanceMigrationMethod string
const (
// BlockMigration means that all VirtualMachineInstance disks should be copied over to the destination host
BlockMigration VirtualMachineInstanceMigrationMethod = "BlockMigration"
// LiveMigration means that VirtualMachineInstance disks will not be copied over to the destination host
LiveMigration VirtualMachineInstanceMigrationMethod = "LiveMigration"
)
// VirtualMachineInstancePhase is a label for the condition of a VirtualMachineInstance at the current time.
type VirtualMachineInstancePhase string
// These are the valid statuses of pods.
const (
//When a VirtualMachineInstance Object is first initialized and no phase, or Pending is present.
VmPhaseUnset VirtualMachineInstancePhase = ""
// Pending means the VirtualMachineInstance has been accepted by the system.
Pending VirtualMachineInstancePhase = "Pending"
// A target Pod exists but is not yet scheduled and in running state.
Scheduling VirtualMachineInstancePhase = "Scheduling"
// A target pod was scheduled and the system saw that Pod in runnig state.
// Here is where the responsibility of virt-controller ends and virt-handler takes over.
Scheduled VirtualMachineInstancePhase = "Scheduled"
// Running means the pod has been bound to a node and the VirtualMachineInstance is started.
Running VirtualMachineInstancePhase = "Running"
// Succeeded means that the VirtualMachineInstance stopped voluntarily, e.g. reacted to SIGTERM or shutdown was invoked from
// inside the VirtualMachineInstance.
Succeeded VirtualMachineInstancePhase = "Succeeded"
// Failed means that the vmi crashed, disappeared unexpectedly or got deleted from the cluster before it was ever started.
Failed VirtualMachineInstancePhase = "Failed"
// Unknown means that for some reason the state of the VirtualMachineInstance could not be obtained, typically due
// to an error in communicating with the host of the VirtualMachineInstance.
Unknown VirtualMachineInstancePhase = "Unknown"
)
const (
// AppLabel and AppName labels marks resources that belong to KubeVirt. An optional value
// may indicate which specific KubeVirt component a resource belongs to.
AppLabel string = "kubevirt.io"
AppName string = "name"
// This annotation is used to match virtual machine instances represented as
// libvirt XML domains with their pods. Among other things, the annotation is
// used to detect virtual machines with dead pods. Used on Pod.
DomainAnnotation string = "kubevirt.io/domain"
// Represents the name of the migration job this target pod is associated with
MigrationJobNameAnnotation string = "kubevirt.io/migrationJobName"
ControllerAPILatestVersionObservedAnnotation string = "kubevirt.io/latest-observed-api-version"
ControllerAPIStorageVersionObservedAnnotation string = "kubevirt.io/storage-observed-api-version"
// Used by functional tests to force a VMI to fail the migration internally within launcher
FuncTestForceLauncherMigrationFailureAnnotation string = "kubevirt.io/func-test-force-launcher-migration-failure"
// Used by functional tests to prevent virt launcher from finishing the target pod preparation.
FuncTestBlockLauncherPrepareMigrationTargetAnnotation string = "kubevirt.io/func-test-block-migration-target-preparation"
// Used by functional tests set custom image on migration target pod
FuncTestMigrationTargetImageOverrideAnnotation string = "kubevirt.io/func-test-migration-target-image-override"
// Used by functional tests to simulate virt-launcher crash looping
FuncTestLauncherFailFastAnnotation string = "kubevirt.io/func-test-virt-launcher-fail-fast"
// Used by functional tests to ignore backoff applied to migrations
FuncTestForceIgnoreMigrationBackoffAnnotation string = "kubevirt.io/func-test-ignore-migration-backoff"
// Used by functional tests to simulate memory hotplug failing
FuncTestMemoryHotplugFailAnnotation string = "kubevirt.io/func-test-memory-hotplug-fail"
// This label is used to match virtual machine instance IDs with pods.
// Similar to kubevirt.io/domain. Used on Pod.
// Internal use only.
CreatedByLabel string = "kubevirt.io/created-by"
// This label is used to indicate that this pod is the target of a migration job.
MigrationJobLabel string = "kubevirt.io/migrationJobUID"
// This label indicates the migration name that a PDB is protecting.
MigrationNameLabel string = "kubevirt.io/migrationName"
// This label describes which cluster node runs the virtual machine
// instance. Needed because with CRDs we can't use field selectors. Used on
// VirtualMachineInstance.
NodeNameLabel string = "kubevirt.io/nodeName"
// This label describes which cluster node runs the target Pod for a Virtual
// Machine Instance migration job. Needed because with CRDs we can't use field
// selectors. Used on VirtualMachineInstance.
MigrationTargetNodeNameLabel string = "kubevirt.io/migrationTargetNodeName"
// This annotation indicates that a migration is the result of an
// automated evacuation
EvacuationMigrationAnnotation string = "kubevirt.io/evacuationMigration"
// This annotation indicates that a migration is the result of an
// automated workload update
WorkloadUpdateMigrationAnnotation string = "kubevirt.io/workloadUpdateMigration"
// This annotation indicates to abort any migration due to an automated
// workload update. It should only be used for testing purposes.
WorkloadUpdateMigrationAbortionAnnotation string = "kubevirt.io/testWorkloadUpdateMigrationAbortion"
// This label declares whether a particular node is available for
// scheduling virtual machine instances on it. Used on Node.
NodeSchedulable string = "kubevirt.io/schedulable"
// This annotation is regularly updated by virt-handler to help determine
// if a particular node is alive and hence should be available for new
// virtual machine instance scheduling. Used on Node.
VirtHandlerHeartbeat string = "kubevirt.io/heartbeat"
// This label indicates what launcher image a VMI is currently running with.
OutdatedLauncherImageLabel string = "kubevirt.io/outdatedLauncherImage"
// Namespace recommended by Kubernetes for commonly recognized labels
AppLabelPrefix = "app.kubernetes.io"
// This label is commonly used by 3rd party management tools to identify
// an application's name.
AppNameLabel = AppLabelPrefix + "/name"
// This label is commonly used by 3rd party management tools to identify
// an application's version.
AppVersionLabel = AppLabelPrefix + "/version"
// This label is commonly used by 3rd party management tools to identify
// a higher level application.
AppPartOfLabel = AppLabelPrefix + "/part-of"
// This label is commonly used by 3rd party management tools to identify
// the component this application is a part of.
AppComponentLabel = AppLabelPrefix + "/component"
// This label identifies each resource as part of KubeVirt
AppComponent = "kubevirt"
// This label will be set on all resources created by the operator
ManagedByLabel = AppLabelPrefix + "/managed-by"
ManagedByLabelOperatorValue = "virt-operator"
ManagedByLabelOperatorOldValue = "kubevirt-operator"
// This annotation represents the kubevirt version for an install strategy configmap.
InstallStrategyVersionAnnotation = "kubevirt.io/install-strategy-version"
// This annotation represents the kubevirt registry used for an install strategy configmap.
InstallStrategyRegistryAnnotation = "kubevirt.io/install-strategy-registry"
// This annotation represents the kubevirt deployment identifier used for an install strategy configmap.
InstallStrategyIdentifierAnnotation = "kubevirt.io/install-strategy-identifier"
// This annotation shows the enconding used for the manifests in the Install Strategy ConfigMap.
InstallStrategyConfigMapEncoding = "kubevirt.io/install-strategy-cm-encoding"
// This annotation is a hash of all customizations that live under spec.CustomizeComponents
KubeVirtCustomizeComponentAnnotationHash = "kubevirt.io/customizer-identifier"
// This annotation represents the kubevirt generation that was used to create a resource
KubeVirtGenerationAnnotation = "kubevirt.io/generation"
// This annotation represents that this object is for temporary use during updates
EphemeralBackupObject = "kubevirt.io/ephemeral-backup-object"
// This annotation represents that the annotated object is for temporary use during pod/volume provisioning
EphemeralProvisioningObject string = "kubevirt.io/ephemeral-provisioning"
// This label indicates the object is a part of the install strategy retrieval process.
InstallStrategyLabel = "kubevirt.io/install-strategy"
// Set by virt-operator to coordinate component deletion
VirtOperatorComponentFinalizer string = "kubevirt.io/virtOperatorFinalizer"
// Set by VMI controller to ensure VMIs are processed during deletion
VirtualMachineInstanceFinalizer string = "foregroundDeleteVirtualMachine"
// Set By VM controller on VMIs to ensure VMIs are processed by VM controller during deletion
VirtualMachineControllerFinalizer string = "kubevirt.io/virtualMachineControllerFinalize"
VirtualMachineInstanceMigrationFinalizer string = "kubevirt.io/migrationJobFinalize"
CPUManager string = "cpumanager"
// This annotation is used to inject ignition data
// Used on VirtualMachineInstance.
IgnitionAnnotation string = "kubevirt.io/ignitiondata"
PlacePCIDevicesOnRootComplex string = "kubevirt.io/placePCIDevicesOnRootComplex"
// This label represents supported cpu features on the node
CPUFeatureLabel = "cpu-feature.node.kubevirt.io/"
// This label represents supported cpu models on the node
CPUModelLabel = "cpu-model.node.kubevirt.io/"
SupportedHostModelMigrationCPU = "cpu-model-migration.node.kubevirt.io/"
CPUTimerLabel = "cpu-timer.node.kubevirt.io/"
// This label represents supported HyperV features on the node
HypervLabel = "hyperv.node.kubevirt.io/"
// This label represents vendor of cpu model on the node
CPUModelVendorLabel = "cpu-vendor.node.kubevirt.io/"
VirtIO = "virtio"
// This label represents the host model CPU name
HostModelCPULabel = "host-model-cpu.node.kubevirt.io/"
// This label represents the host model required features
HostModelRequiredFeaturesLabel = "host-model-required-features.node.kubevirt.io/"
NodeHostModelIsObsoleteLabel = "node-labeller.kubevirt.io/obsolete-host-model"
LabellerSkipNodeAnnotation = "node-labeller.kubevirt.io/skip-node"
VirtualMachineLabel = AppLabel + "/vm"
MemfdMemoryBackend string = "kubevirt.io/memfd"
MigrationSelectorLabel = "kubevirt.io/vmi-name"
// This annotation represents vmi running nonroot implementation
DeprecatedNonRootVMIAnnotation = "kubevirt.io/nonroot"
// This annotation is to keep virt launcher container alive when an VMI encounters a failure for debugging purpose
KeepLauncherAfterFailureAnnotation string = "kubevirt.io/keep-launcher-alive-after-failure"
// MigrationTransportUnixAnnotation means that the VMI will be migrated using the unix URI
MigrationTransportUnixAnnotation string = "kubevirt.io/migrationTransportUnix"
// MigrationUnschedulablePodTimeoutSecondsAnnotation represents a custom timeout period used for unschedulable target pods
// This exists for functional testing
MigrationUnschedulablePodTimeoutSecondsAnnotation string = "kubevirt.io/migrationUnschedulablePodTimeoutSeconds"
// MigrationPendingPodTimeoutSecondsAnnotation represents a custom timeout period used for target pods stuck in pending for any reason
// This exists for functional testing
MigrationPendingPodTimeoutSecondsAnnotation string = "kubevirt.io/migrationPendingPodTimeoutSeconds"
// CustomLibvirtLogFiltersAnnotation can be used to customized libvirt log filters. Example value could be
// "3:remote 4:event 3:util.json 3:util.object 3:util.dbus 3:util.netlink 3:node_device 3:rpc 3:access 1:*".
// For more info: https://libvirt.org/kbase/debuglogs.html
CustomLibvirtLogFiltersAnnotation string = "kubevirt.io/libvirt-log-filters"