Skip to content
Draft
Changes from 4 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
eceffde
Changed VolumeMode to PersistentVolumeBlock
Deblazz Apr 16, 2026
718016e
Change PVC access mode to ReadWriteMany
abellonioandrea Apr 28, 2026
7842825
Merge branch 'master' into feature_vdd-fs-to-block
abellonioandrea Apr 28, 2026
021b249
Added networking annotation for allowing live migration
abellonioandrea Apr 28, 2026
db96023
revert last commit
abellonioandrea Apr 28, 2026
1e71c69
Merge branch 'master' into feature_vdd-fs-to-block
abellonioandrea May 19, 2026
fb85af8
TEST: implement clone from pvc in operator
Deblazz May 19, 2026
276ab5c
fix lint and test commented (only for now)
abellonioandrea May 19, 2026
2e813bf
Fixed indent
Deblazz May 19, 2026
25b5822
test passing to pmp
abellonioandrea Jun 1, 2026
7e93308
Merge branch 'master' into feature_vdd-fs-to-block
abellonioandrea Jun 1, 2026
3bb64bf
Add Block volume support to pmp
AleTopp Jun 2, 2026
cf8025c
Fix ptr deref
AleTopp Jun 2, 2026
af4ca3c
Merge branch 'master' into feature_vdd-fs-to-block
QcFe Jun 3, 2026
0ef94d2
revert pmp migration
abellonioandrea Jun 4, 2026
44fe47e
fix go linting
abellonioandrea Jun 4, 2026
03d2c0f
removed tests for pmp implementation
abellonioandrea Jun 4, 2026
db015ad
adding rolebinding for cdi clone
abellonioandrea Jun 4, 2026
ea60550
namespace change
abellonioandrea Jun 4, 2026
a5e4f36
moving rolebinding to user namespace
abellonioandrea Jun 16, 2026
e3ed4d6
Merge branch 'master' into feature_vdd-fs-to-block
abellonioandrea Jun 16, 2026
226bf4b
fix namespace value
abellonioandrea Jun 16, 2026
c063fd6
fix namespace value
abellonioandrea Jun 16, 2026
a9f4de6
Created DataVolume object before VM creation
Deblazz Jun 16, 2026
5119264
Hardcoded datavolumeonce again
Deblazz Jun 16, 2026
047fabf
Merge branch 'master' into feature_vdd-fs-to-block
Deblazz Jun 16, 2026
4f521ce
fixed syntax error
Deblazz Jun 17, 2026
40722b6
Merge branch 'feature_vdd-fs-to-block' of https://github.com/Deblazz/…
Deblazz Jun 17, 2026
530152e
Fixed linting issue
Deblazz Jun 17, 2026
4606bbf
Fixed linting issue again
Deblazz Jun 17, 2026
6bb9c0b
Added test
Deblazz Jun 17, 2026
abb046f
Updated destination datavolume to block instead of fs
Deblazz Jun 20, 2026
8c3d178
Merge branch 'master' into feature_vdd-fs-to-block
Deblazz Jun 20, 2026
b9615a2
Removed every ref to DataVolumeTemplate
Deblazz Jun 26, 2026
fdab548
Merge branch 'feature_vdd-fs-to-block' of https://github.com/Deblazz/…
Deblazz Jun 26, 2026
8ae112f
Updated comments
Deblazz Jun 26, 2026
db42191
Added new environment LocalVM, restored CloudVMs
Deblazz Jun 27, 2026
bc09fe4
updated manifests
Deblazz Jun 27, 2026
8487ec1
Added localvm in various places
Deblazz Jun 27, 2026
d6fa4bb
updated manifests
Deblazz Jun 27, 2026
028bd21
Restored current release rolebindings
Deblazz Jun 27, 2026
58e5314
Updated frontend to list LocalVM
Deblazz Jun 27, 2026
00a6c07
Added custom pvc support for LocalVMs
Deblazz Jun 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions operators/pkg/forge/virtualmachines.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const (

// terminationGracePeriod -> the amount of seconds before a terminating VM is forcefully deleted.
terminationGracePeriod = 60

// PodBridgeNetworkLiveMigrationAnnotation enables live migration for VMs using the pod bridge network.
PodBridgeNetworkLiveMigrationAnnotation = "kubevirt.io/allow-pod-bridge-network-live-migration"
podBridgeNetworkLiveMigrationValue = "true"
)

var (
Expand All @@ -54,8 +58,13 @@ var (
func VirtualMachineSpec(instance *clv1alpha2.Instance, template *clv1alpha2.Template, environment *clv1alpha2.Environment) virtv1.VirtualMachineSpec {
return virtv1.VirtualMachineSpec{
Template: &virtv1.VirtualMachineInstanceTemplateSpec{
ObjectMeta: metav1.ObjectMeta{Labels: EnvironmentSelectorLabels(instance, environment)},
Spec: VirtualMachineInstanceSpec(instance, template, environment),
ObjectMeta: metav1.ObjectMeta{
Labels: EnvironmentSelectorLabels(instance, environment),
Annotations: map[string]string{
PodBridgeNetworkLiveMigrationAnnotation: podBridgeNetworkLiveMigrationValue,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're theoretically not using bridge mode, is this really needed?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, the live migration is not working
To be precise in the virtual machine I am getting this error:
cannot migrate VMI which does not use masquerade, bridge with kubevirt.io/allow-pod-bridge-network-live-migration VM annotation or a migratable plugin to connect to the pod network

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok but we're supposed to be using masquerade actually...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I didn't know, so it is only a problem related to the fact we are running vms manually in KubeVirt without the crownlabs infrastructure

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will revert the changes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please check just in case? I added self-edit on your tenant ns.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm that on a virtual machine in my tenant namespace I see the same error as before for the live migration enable

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that actually VMS are not in Masquerade but are in Bridge mode.

Interfaces: []virtv1.Interface{*virtv1.DefaultBridgeNetworkInterface()},

DefaultBridgeNetworkInterface must be changed to DefaultMasqueradeNetworkInterface.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this explains several things. I'd say it's better to discuss this tonight at the weekly in order to understand together if there could be further implications by switching this...

},
},
Spec: VirtualMachineInstanceSpec(instance, template, environment),
},
DataVolumeTemplates: []virtv1.DataVolumeTemplateSpec{
DataVolumeTemplate(NamespacedNameWithSuffix(instance, environment.Name).Name, environment),
Expand Down Expand Up @@ -247,7 +256,9 @@ func DataVolumeTemplate(name string, environment *clv1alpha2.Environment) virtv1
Spec: cdiv1beta1.DataVolumeSpec{
Source: DataVolumeSourceForge(environment),
PVC: &corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
VolumeMode: ptr.To(corev1.PersistentVolumeBlock),
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteMany},
StorageClassName: VMDataVolumeStorageClassName(environment),
Resources: corev1.VolumeResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: environment.Resources.Disk,
Expand All @@ -257,3 +268,11 @@ func DataVolumeTemplate(name string, environment *clv1alpha2.Environment) virtv1
},
}
}

// VMDataVolumeStorageClassName forges the storage class name to be used for the DataVolume associated with a given environment.
func VMDataVolumeStorageClassName(environment *clv1alpha2.Environment) *string {
if environment.StorageClassName != "" {
return ptr.To(environment.StorageClassName)
}
return nil
}
Loading