kubevirt / kubevirt

Kubernetes Virtualization API and runtime in order to define and manage virtual machines.
https://kubevirt.io
Apache License 2.0
5.45k stars 1.31k forks source link

Hotplug is misbehaving when the volume migration feature gate is enabled #12670

Closed alicefr closed 5 days ago

alicefr commented 2 weeks ago

What happened: When the volume migration feature gate is enabled, the volume hotplug action is misinterpreted as a replacement operation and hotplug doesn't work.

What you expected to happen: Hotplug the volume as when the feature gate is disabled

How to reproduce it (as minimally and precisely as possible): Enable the volume migration feature gate:

kubectl patch kubevirt kubevirt -n kubevirt --type=json -p='[{"op": "add", "path": "/spec/configuration/vmRolloutStrategy", "value": "LiveUpdate"}]'
kubectl patch kubevirt kubevirt -n kubevirt --type=merge -p='{"spec": {"workloadUpdateStrategy": { "workloadUpdateMethods" : []}}}'
kubectl patch kubevirt kubevirt -n kubevirt --type=json -p='[{"op": "add", "path": "/spec/workloadUpdateStrategy/workloadUpdateMethods/-", "value": "LiveMigrate"}]'
kubectl patch kubevirt kubevirt -n kubevirt --type=merge -p='{"spec": {"configuration": {"developerConfiguration": { "featureGates" : []}}}}'
kubectl patch kubevirt kubevirt -n kubevirt --type=json -p='[{"op": "add", "path": "/spec/configuration/developerConfiguration/featureGates/-", "value": "VMLiveUpdateFeatures"}]'
kubectl patch kubevirt kubevirt -n kubevirt --type=json -p='[{"op": "add", "path": "/spec/configuration/developerConfiguration/featureGates/-", "value": "VolumesUpdateStrategy"}]'
kubectl patch kubevirt kubevirt -n kubevirt --type=json -p='[{"op": "add", "path": "/spec/configuration/developerConfiguration/featureGates/-", "value": "VolumeMigration"}]'

Add a volume to a VM:

$ virtctl addvolume  --volume-name  hotplugdisk vm-dv

Check the VM:

  status:
    conditions:
[...]
    - lastProbeTime: null
      lastTransitionTime: "2024-08-26T11:14:23Z"
      message: the volumes replacement is effective only after restart
      status: "True"
      type: RestartRequired
alicefr commented 2 weeks ago

/cc @awels @mhenriks

alicefr commented 2 weeks ago

/assign