ironcore-dev / libvirt-provider

Libvirt provider implementation of the IronCore compute interface
https://ironcore-dev.github.io/libvirt-provider/
Apache License 2.0
5 stars 5 forks source link

NetworkInterface Detachment Failure #152

Open so-sahu opened 8 months ago

so-sahu commented 8 months ago

Describe the bug The NetworkInterface detachment process is not functioning as expected. After attempting to detach a NetworkInterface, it is successfully removed from the store but remains present in the DomainXML.

To Reproduce

  1. Create a machine with nic.
  2. Detach the nic.
  3. Verify domain machine DomainXML. nic is not getting removed.

Expected behavior The NetworkInterface should be successfully unplugged from both the store and the DomainXML.

Screenshots

2024-02-05T06:44:55Z    ERROR   machine-reconciler  failed to reconcile machine {"machineID": "0c058844-7cb9-42a6-b988-d6573f870551", "error": "[network interfaces] attach / detach error(s): [[network interface primary] error detaching: internal error: unable to execute QEMU command 'device_del': Device ua-networkinterface-primary is already in the process of unplug]"}
github.com/ironcore-dev/libvirt-provider/pkg/controllers.(*MachineReconciler).processNextWorkItem
    /home/sosahu/my-workspace/libvirt-provider/UT/store/libvirt-provider/pkg/controllers/machine_controller.go:300
github.com/ironcore-dev/libvirt-provider/pkg/controllers.(*MachineReconciler).Start.func7
    /home/sosahu/my-workspace/libvirt-provider/UT/store/libvirt-provider/pkg/controllers/machine_controller.go:200
lukas016 commented 8 months ago

@Rohit-0505 we will have probably wrong logic for manage status of nics. We have similar issue for volume: https://github.com/ironcore-dev/libvirt-provider/pull/144

You can inspire by my PR