From a6a2596d7b66d41bbf63a9f4395bb30fb819994d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Sat, 24 Oct 2026 02:45:06 -0300 Subject: [PATCH] fix(kvm): keep the mac attributes of a guest that rscan updates rscan -u, and rscan -w for a guest that xCAT already knows, deleted the mac row of the guest and wrote back only its MAC address. That dropped mac.duid, so the next makedhcp reserved the default DUID in place of the identifier the node had selected, and its client lost the reserved address. rscan now updates the MAC address in the existing row and keeps the other mac attributes. The other tables it rewrites are unchanged. (cherry picked from commit b464b57499d74d525188c59a340c1bde8e3ffcf1) (cherry picked from commit b1ed21d010da7348851b68e5135a0b3891ecc5d2) (cherry picked from commit 5f1fd109291b92255781a4e415ad009f57a4e3fb) Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-server/lib/xcat/plugins/kvm.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index e0e70bff6e..6e9eb95d39 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -3400,7 +3400,7 @@ sub rscan { else { if ($hash_vm2host{$node} eq $hypervisor) { - #mark this node to delete in 'vm' 'mac' vpd' 'nodelist' 'nodetype' 'nodehm' tables + #mark this node to delete in 'vm' vpd' 'nodelist' 'nodetype' 'nodehm' tables; its mac row keeps duid $updatetable->{vm}->{'!*XCATNODESTODELETE*!'}->{$node} = $node; $updatetable->{vm}->{$node}->{host} = $hypervisor; @@ -3410,7 +3410,6 @@ sub rscan { $updatetable->{vm}->{$node}->{nics} = $vmnics; $updatetable->{vm}->{$node}->{nicmodel} = $vmnicnicmodel; $updatetable->{vm}->{$node}->{othersettings} = "nodefromrscan"; - $updatetable->{mac}->{'!*XCATNODESTODELETE*!'}->{$node} = $node; $updatetable->{mac}->{$node}->{mac} = $mac; $updatetable->{vpd}->{'!*XCATNODESTODELETE*!'}->{$node} = $node; $updatetable->{vpd}->{$node}->{uuid} = $uuid; @@ -3440,7 +3439,6 @@ sub rscan { $updatetable->{vm}->{$node}->{nics} = $vmnics; $updatetable->{vm}->{$node}->{nicmodel} = $vmnicnicmodel; $updatetable->{vm}->{$node}->{othersettings} = "nodefromrscan"; - $updatetable->{mac}->{'!*XCATNODESTODELETE*!'}->{$node} = $node; $updatetable->{mac}->{$node}->{mac} = $mac; $updatetable->{vpd}->{'!*XCATNODESTODELETE*!'}->{$node} = $node; $updatetable->{vpd}->{$node}->{uuid} = $uuid;