2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-23 02:42:17 +00:00

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 b1ed21d010)
This commit is contained in:
Vinícius Ferrão
2026-10-24 02:45:06 -03:00
committed by Daniel Hilst
parent 112f9fa19c
commit 5f1fd10929
+1 -3
View File
@@ -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;