From 5f1fd109291b92255781a4e415ad009f57a4e3fb 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) --- 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 b86f4afe19..f01ff91f7d 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -3392,7 +3392,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; @@ -3402,7 +3402,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; @@ -3432,7 +3431,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;