Both Genesis images built a DUID-UUID from the nil SMBIOS UUID. makedhcp refuses that UUID,
because nodeimport writes it to every PowerKVM node, and reserves the hardware address instead,
so the client sent an identifier no reservation held and the node took a pool address with no
boot file. genesis-duid and doxcat now keep the DUID-LL for it, which is what Kea reads the
hardware address out of.
getzonesfornet died on an IPv6 prefix that is not a multiple of 4, which took makedns and
makedhcp with it for a /62 or a /126 network. A reverse zone is delegated on a nibble, so the
prefix is rounded down and the enclosing zone is returned. Both copies of the routine are fixed.
The test suite needs socat and jq, and five bats files skipped without them, so the workflow
installs both. Template.pm drops the unused _is_el10, credentials.pm drops a repeated import,
and two comments that recorded bug history are cut to the fact the code cannot show.
Reverting any one fix fails named assertions: 1 of 8 and 1 of 3 bats cases for the two Genesis
images, and 4 of 30 in ddns_ipv6.t, which traps the abort so the file still reports.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
makedhcp reported a vpd.uuid that looks byte-swapped for duid=firmware and duid=canonical as
well as for a node with no duid attribute. Setting duid is the remedy the message names, so the
message could not be silenced except by a literal DUID. The check reads the version field, which
also reports a UUID that does not follow RFC 4122. It is now reported only for a node with no
duid attribute, and makedhcp.8 says so.
delnode removed only the lines of the family of the address it was given. A node whose address
changed from IPv4 to IPv6 kept its old A record, and makedhcp then wrote a DHCPv4 reservation
with a boot file for a node whose only address was IPv6. The family filter stays on the update
path, which is what keeps both records of a dual-stack node.
dhcp_dhcpv6_duid.t asserts that each duid value silences the report and that the default still
makes it. makehosts_dual_stack.t asserts a family change followed by a delete. Reverting either
fix fails exactly one assertion in each file.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
kea_subnet_id_numeric.t copied the dedupe-key expression into the test and asserted on the copy.
It never loaded xCAT::DHCP::Backend::Kea, so restoring the aliasing map in the module left the
test passing 4 of 4. It measured Perl, not the product.
The test now calls live_upsert_reservations through an injected control_agent_handler, as
dhcp_kea_renderer.t does, and asserts on the body that encode_config produces, which is what the
HTTP path sends. With the aliasing map restored, 3 of its 6 assertions fail and 3 pass.
xcattest also carries the value class for a [Table_*] line. It was [\w\.\-], so a value of
"2001:db8:176::" matched "2001" and the row was written with that value, and "/64" matched
nothing. The class is now the one [Object_*] already uses. A ';' is deliberately left out:
setup_env_by_configure_file builds a shell command from these values.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
makedhcp_dhcpv6_dual_stack_boot_server defined its network and went straight to
makedhcp <node>. A reservation only reaches a subnet that kea-dhcp6.conf already carries, so
makedhcp skipped the node with "Unable to find a Kea DHCPv6 subnet", exited 0, and the case
asserted an empty bootfile-url against the expected one. The run reported the case as failing
for the wrong reason, and an assertion on the exit status alone would have passed.
The case now runs makedhcp -n after makehosts, as makedhcp_dhcpv6_boot_intent does, and asserts
two things the earlier version could not tell apart: that the subnet is in the configuration, and
that the node has exactly one reservation. A skip now fails on the reservation count rather than
on the URL.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
makedhcp_dhcpv6_boot_intent declares a node with no tftpserver, so it measures only the
<xcatmaster> path. A dual-stack node keeps an IPv4 tftpserver, and that is the path on which
makedhcp exited 1 and dropped the boot URL.
makedhcp_dhcpv6_dual_stack_boot_server declares a grub2 node with an IPv6 address and an IPv4
tftpserver, then asserts that makedhcp exits 0, that Kea accepts the configuration, and that the
bootfile-url names the IPv6 address of the management node facing the node. Both values are
compared exactly, so a dropped option and a wrong authority each fail.
The test addresses move to the documentation ranges at the same time. The three networkutils
tests carried a link-local address read off a lab NIC, and dhcp_kea_plugin_intent.t carried two
addresses from the management network. They are fixtures that nothing dials, so this only keeps
the internal topology out of the upstream tree.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
kea_boot_server6_for_node resolved the tftpserver of the node as IPv6 and reported
an error when it got no answer. A dual-stack node keeps an IPv4 tftpserver, which
has no IPv6 address, so makedhcp exited non-zero for the whole command and the
DHCPv6 reservation lost its boot URL.
xCAT::DHCP::BootPolicy->dhcp6_boot_server now chooses the server: a configured
value that resolves, else the management node address that faces the node, which
is what <xcatmaster> already does. When neither resolves, the node gets a warning
and keeps its reservation, because the node still boots over IPv4.
xCAT-test/unit/dhcp6_boot_server.t asserts the choice. Removal of the fallback
fails 3 of its 12 assertions and leaves 9 passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The IO::Socket::INET6 and Socket6 recommendations were guarded with
%if !0%{?suse_version}, which is true on EL7. EL7 carries rpm 4.11, which predates the
Recommends tag and fails to parse the spec, so the xCAT-server build breaks there. The
guard also excluded every SUSE release, while the comment beside it names EL AppStream
and openEuler as where the packages are.
The guard now names those distributions directly, in the form this file already uses at
its openssl requirement: 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?openEuler}.
Measured with rpmspec -P on a minimal spec, host macros undefined. Old guard: emitted
on rhel 7 and rhel 8, absent on suse_version 1500. New guard: absent on rhel 7, emitted
on rhel 8, rhel 10, fedora 40 and openEuler 2403, absent on suse_version 1500.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node with an A line and an AAAA line in /etc/hosts under one name loses one of them.
Running makehosts for a node whose hosts.ip is IPv4 left only the IPv4 line. A second
line under the same name is the only way to give a node both records through
/etc/hosts and makedns.
_host_line_index_values records node names for any line whose first field looks like an
address, IPv6 included, and addnode overwrites the first match and blanks every other
one. Driving the plugin with 192.0.2.10 node01 and 2001:db8::10 node01 returned both
line indexes for the IPv4 address, so the IPv6 line was blanked.
A node name now matches only lines of the family being written. The reason the index
records node names at all, so a node that changes address does not leave a second
entry, is unchanged and is asserted per family. An unparsable first field counts as the
same family, so a legacy entry keeps the behaviour it had.
makehosts_dual_stack.t fails 6 of its 9 assertions without the family check; the three
that pass include an unknown node matching no line.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Every Control Agent update falls back to a full dhcpd restart, because Kea refuses
"subnet-id":"1" where it expects 1.
The cause is Perl aliasing, not a type declaration. The dedupe key in
_live_delete_reservations was built with map { lc($_) } over a list whose first element
is $reservation->{'subnet-id'}; map binds $_ to that hash element itself, and reading a
numeric scalar through a string function attaches a string form to it. JSON::XS then
serialises the value as a string.
Reproduced: a reservation whose subnet-id is 1 encodes as {"subnet-id":1}; after the
map it encodes as {"subnet-id":"1"}; with the element copied first it stays
{"subnet-id":1}.
The map now copies the element before reading it. The key it builds is unchanged, so
the deduplication behaves as before.
kea_subnet_id_numeric.t pins all three states, so the aliasing cannot return unseen.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Parsing the xcatd= argument was only half of it. doxcat re-joined XCATMASTER and
XCATPORT at twenty call sites, and /bin/getcert and /bin/getdestiny pass that string
to openssl s_client -connect, which rejects an unbracketed IPv6 address:
openssl s_client -connect 2001:db8:190::1:3001
s_client: -connect argument or target parameter malformed or ambiguous
openssl s_client -connect [2001:db8:190::1]:3001
depth=1 CN=xCAT CA
Measured on an IPv6-only node whose cmdline parsed correctly: /etc/xcat held
certkey.pem and privkey.pem but no cert.pem, and nodelist.status stayed empty.
doxcat now derives XCATDEST once, bracketing an address that holds a colon, and every
call site uses it. getcert already honoured XCATDEST as an environment variable.
dodiscovery falls back to the old form when doxcat did not export it.
The mutation keeps the variable and changes only its value: 4 of the 7 bats cases go
red, the IPv6 ones, and the 3 IPv4 and default-port cases pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node booted into the OpenEmbedded Genesis image gets a DHCPv6 pool address and no
bootfile-url, so it does not netboot over IPv6. The image sets ipv6.dhcp-duid=ll in
10-xcat-genesis.conf, so NetworkManager sends a DUID-LL, while
kea_node_reservations6 in xCAT-server/lib/xcat/plugins/dhcp.pm reserves by duid for
every node that has a vpd.uuid. Kea rejects a reservation that carries both a duid
and a hw-address, so the reservation holds the DUID-UUID alone and the DUID-LL
matches nothing.
NetworkManager cannot build that DUID itself: ipv6.dhcp-duid takes llt, ll,
stable-llt, stable-ll, stable-uuid, lease or a literal hexadecimal DUID, and every
UUID form it generates comes from the machine-id, not from SMBIOS. genesis-duid
therefore reads the SMBIOS UUID at boot and writes the literal DUID into
15-xcat-genesis-duid.conf, which NetworkManager reads after 10-xcat-genesis.conf and
so wins. xcat-genesis-duid.service runs it before NetworkManager starts, because
NetworkManager reads conf.d only at startup. The byte order is the one doxcat and
makedhcp use, so both Genesis generations now send the same identity.
A node with no SMBIOS UUID keeps the DUID-LL: makedhcp cannot build a DUID for it, so
its reservation holds a hw-address, which Kea reads out of a DUID-LL.
genesis_openembedded_duid.bats and genesis_openembedded_duid.t fail without these
files.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The OpenEmbedded Genesis image sets ipv6.dhcp-duid=ll, so NetworkManager sends a
DUID-LL. makedhcp builds a DUID-UUID from vpd.uuid, and kea_node_reservations6 puts
either a duid or a hw-address in a reservation, never both. A node that reported an
SMBIOS UUID therefore gets a DUID-only reservation that its DUID-LL cannot match: it
takes a pool address with no bootfile-url and does not netboot over IPv6. The legacy
image is correct here, because doxcat writes a DUID-UUID in firmware order.
genesis_openembedded_duid.bats asserts the image turns the SMBIOS UUID into the same
DUID that xCAT-test/bats/genesis_duid_uuid.bats pins for the legacy image, and that a
node with no SMBIOS UUID keeps the DUID-LL, which is what a hw-address reservation
needs. genesis_openembedded_duid.t covers the unit that writes it before
NetworkManager, and genesis_metadata.py covers the installed files.
All 15 assertions fail on this commit: there is no genesis-duid script and no unit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Before this work xCAT stored vpd.uuid with its first three fields swapped for
nodes from Genesis discovery and for KVM guests from mkvm, clonevm and rscan.
vpd.uuid now holds the UUID that the operating system reports, and no row is
migrated. makedhcp swaps such a row a second time, so the DUID it reserves the
address for is the canonical order of the real UUID, which no client sends. The
node then gets no lease and makedhcp reports nothing. Until now the problem was
only described in makedhcp.8.pod.
A row cannot be rewritten, because nothing tells which spelling it holds. So
makedhcp reports instead. The new dhcp6_uuid_looks_byte_swapped reads the RFC
4122 version field: a swap of the first three fields moves it from the first
nibble of the third field to the third nibble, and moves nothing else. A value
whose version is valid only in the swapped position is therefore a row to look
at. dhcp6_client_duid returns the message as a third value, and addnode6 and
kea_node_reservations6 report it once for the node. Neither changes the value or
the reservation.
What the check cannot know: a swap leaves a valid version in the first field
about half the time, so it misses those rows. It also cannot read the UUID that
the node holds, so a node with a non-conformant firmware UUID can be reported
for nothing.
dhcp_dhcpv6_duid.t adds node cn10 and a block that holds down the detection, the
double swap, and the remedy the message gives. Reading the swapped version from
nibble 15 instead of 14 fails exactly the four assertions that name the report,
and leaves green the five that hold the limits of the check and the four that
hold the DUID values.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
nodeimport writes '00000000-0000-0000-0000-000000000000' to vpd.uuid for every
PowerKVM node it creates (profilednodes.pm). That value is 32 valid hexadecimal
digits, so kea_duid_from_uuid builds a DUID from it and returns
00:04:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 for all of them. makedhcp
then keeps the reservation of the node it wrote last and reports nothing.
kea_duid_from_uuid now refuses the nil UUID, which it reads through the new
dhcp6_uuid_is_placeholder. A node whose vpd.uuid is the nil UUID is treated like
a node with no vpd.uuid: with Kea DHCP the reservation falls back to the MAC
address of the node, and with ISC DHCP addnode6 skips the node and names the
reason. addnode6 carries a third message for the nil UUID, because the existing
'vpd.uuid is not a UUID.' is false for a value of the right form.
The all-f UUID is left alone. Nothing in the tree writes it, and RFC 4122 names
only the nil UUID.
dhcp_dhcpv6_duid.t adds node cn09 and a block for two PowerKVM nodes. Dropping
the one new line from kea_duid_from_uuid fails 15 assertions, among them 'two
nodes with the nil vpd.uuid keep one reservation each', while the three
neighbours that hold the limits of the check stay green.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
vpd.uuid holds the UUID that the guest operating system reports, and makedhcp derives the
DHCPv6 DUID of a node from it. esx.pm uses two opposite conventions for the same column. The
clone callback stores config.uuid unchanged, while mkvm and rinv swap the first three fields.
One of the two is always wrong, so a VMware guest gets a dynamicrange address with no
bootfile-url and does not boot over IPv6, and rinv prints a UUID the guest does not report.
Neither convention is right on its own. VMware writes uuid.bios into the SMBIOS type 1
structure unencoded and only the version of the entry point changes. Measured on ESXi 7.0.3,
8.0.3 and 9.1.0: EFI firmware gives SMBIOS 2.7 at every hardware version, and BIOS firmware
gives 2.4 up to hardware version 11 and 2.7 from hardware version 12. A 2.7 guest reports the
first three fields swapped, and a 2.4 guest reports them unchanged.
xCAT::VMCommon::esx_guest_uuid takes the UUID, config.firmware and config.version and returns
the UUID on the other side. inv and clone_task_callback read both properties from the VM view.
build_cfgspec learns them from the firmware and virtualHW.version keys of vm.othersettings,
which xCAT::VMCommon::esx_vmx_settings now passes to vSphere as fields of the
VirtualMachineConfigSpec, because extraConfig does not apply them.
xCAT-test/unit/esx_vm_uuid.t pins every row of the measurement with literal UUID strings, and
the DUID that kea_duid_from_uuid then derives for a UEFI guest against the DUID that its
firmware sent. A mutation that drops the SMBIOS 2.4 branch fails the 6 assertions that name a
BIOS guest at hardware version 8 or 11 and leaves the other 56 passing. A mutation that stops
converting an EFI guest fails the 24 assertions that name one and leaves 38 passing.
No ESXi host exists in the lab, so the change is not validated end to end.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xCAT::NetworkUtils::xcatd_cmdline_address brackets an address that holds a colon, as
RFC 3986 does, and leaves an IPv4 address or a hostname unchanged. destiny.pm builds
the xcatd= argument through it, and doxcat reads the bracketed form with bash
parameter expansion, keeping the awk split for the unbracketed case so an existing
node parses exactly as before. The Genesis payload needs no extra command for this.
Two mutations, each failing only the side it names. Reverting doxcat to the plain awk
split fails 3 of the 5 bats cases, the three bracketed ones, and leaves the IPv4 and
the default-port cases passing and the unit test green. Removing the bracketing from
the routine fails 4 of the 8 unit assertions, the IPv6 ones, and leaves IPv4,
hostname, empty and undefined passing and the bats file green.
destiny.pm itself is not unit tested: it is an xcatd plugin, so no in-process test can
load it. The two call sites are one-line substitutions visible in the diff.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only node that boots Genesis never reaches xcatd. destiny.pm writes
xcatd=<master>:<port> unbracketed, and doxcat splits the value on the colon, so an
IPv6 master is read as the address 2001 and the port db8. Measured on a throwaway
el10 cluster: the console logged "XCATMASTER is 2001, XCATPORT is db8", the node
hung acquiring its credentials, and nodelist.status stayed empty.
xcatd_cmdline_address.t drives the writer and doxcat_xcatd_address.bats drives
doxcat's own parse loop, extracted by line range rather than re-implemented, so the
test reads the shipped code. The bats file is in bats because the parser is shell.
The graded evidence is the mutation pair recorded in the fix commit, not the red of
this commit alone: without the fix the routine does not exist, and a test that dies
on a missing subroutine only says it is missing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
genesis_duid_uuid.bats checks the DUID that the legacy doxcat sends, which the
vpd.uuid rework does not change. The revert that reworked vpd.uuid kept this file
deliberately, so dropping the reverted commits from this branch dropped it too.
Nothing else references the file, so its absence broke no test. It is restored here
so the branch loses no coverage relative to the pull requests it supersedes.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcatd asks gethostbyaddr for AF_INET6 and retries with AF_INET when the first
lookup answers nothing. Both calls pass $conn->peeraddr. On a dual-stack
listener that is the 16-byte ::ffff:a.b.c.d for an IPv4 peer, and AF_INET
needs 4 bytes, so the retry is unreachable code. The install monitor then
discards the node's status update and no node reaches the booted state.
xCAT::NetworkUtils::unmap_v4mapped_addr returns the 4 IPv4 bytes of a mapped
address and returns anything else unchanged, so a real IPv6 address keeps all
16 bytes. The install monitor and the SSL listener pass the peer address
through it before the AF_INET retry.
networkutils_unmap_v4mapped.t covers both directions. Removing the mapped
branch fails only the mapped assertion; returning substr for every 16-byte
address fails only the two IPv6 assertions.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcatd identifies a peer by reverse lookup. On a dual-stack listener an IPv4
peer arrives as the 16-byte ::ffff:a.b.c.d, so xcatd asks gethostbyaddr for
AF_INET6 and, when that answers nothing, retries with AF_INET. The retry
passes the same 16 bytes, and AF_INET needs 4, so the retry can never answer.
The peer then stays unidentified whenever the mapped AF_INET6 lookup fails.
Measured on three openEuler management nodes with the same /etc/hosts and the
same resolver: the mapped lookup answers on glibc 2.28 and 2.38 and does not
on glibc 2.34. There the install monitor logged 86 times "received a
connection request from unknown host ... The connection request will be
ignored", so no compute node reached the booted state and both flat
provisioning cases failed.
This test asks for the 4-byte form of a mapped address, and for all 16 bytes
of a real IPv6 address so the answer cannot be plain truncation. It fails
until xCAT::NetworkUtils carries unmap_v4mapped_addr.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Add the duid attribute to the mac table, node and group reference pages,
and describe in makedhcp(8) which DHCPv6 client identifier a reservation
matches and how the duid attribute selects it.
The vpd.uuid description and makedhcp(8) now say that vpd.uuid holds
the system UUID that the operating system reports, and what to do for
a node whose vpd.uuid Genesis discovery, mkvm or rscan stored with the
first three fields swapped.
(cherry picked from commit 5f19a715345853e9236fbc455b4f834ded2e0bd4)
(cherry picked from commit ef9b17d6e5)
mkvm, rinv and rscan -w run for a pc-q35-2.1 domain and expect the UUID
with its first three fields swapped. guest_uuid swaps the UUID of
pc-i440fx-utopic, and keeps the UUID of pc-q35-2.0, pc-q35-2.4,
pc-i440fx-xenial and the 2.11 machine types unchanged.
(cherry picked from commit dc887cacc6b4e1e4d25570fbe42ef23c102dd705)
(cherry picked from commit 8e8d9d428d)
pc-q35-2.1 and the Ubuntu pc-i440fx-utopic store the UUID bytes
unencoded behind an SMBIOS 2.8 entry point, as pc-i440fx-2.1 does, so
their guest reports the domain UUID with the first three fields
swapped. guest_uuid kept the UUID unchanged for them, so mkvm and
clonevm gave the guest a UUID that differed from vpd.uuid, and rinv and
rscan reported the domain UUID.
guest_uuid now swaps the UUID for both machine types. Only QEMU 2.1 to
2.6 provide pc-q35-2.1. pc-i440fx-utopic is the default machine type of
Ubuntu 14.10, and the QEMU of Ubuntu 16.04 keeps it with the 2.1
settings. The QEMU of Ubuntu 15.04 and 15.10 defines it with current
settings, so a guest there reports the UUID unchanged. pc-q35-2.0 uses
SMBIOS 2.4 tables and keeps the UUID unchanged.
(cherry picked from commit ba9dfbfed7ea24b0f5344c0c906ce10db4829996)
(cherry picked from commit fe83337ce0)
The stub hypervisor answers the domain capabilities with a default
machine type, as libvirt does for no machine type and for an alias.
With pc-i440fx-rhel7.1.0 as the default, mkvm swaps the UUID of a node
that names no machine type and of one that names pc, and rscan swaps
it for a domain that names none. Without the fix all three keep the
UUID unchanged.
(cherry picked from commit 19fea649c83da5e05b988af7b5e1d50eadeea489)
(cherry picked from commit 82e9d3f571)
The UUID conversion of mkvm, clonevm, rinv and rscan used the machine
type that the domain XML names. A domain that names none, or names an
alias such as pc, gets the default machine type of the hypervisor:
pc-i440fx-2.1 on QEMU 2.1 and pc-i440fx-rhel7.1.0 on the qemu-kvm of
RHEL 7.1. Its guest then reported a swapped UUID that the plugin did
not expect.
The plugin now asks libvirt for the machine type through the domain
capabilities of the hypervisor, as it already does for the video
model, and converts the UUID for that machine type. The domain XML
keeps the machine type it names. When libvirt cannot answer, the
plugin uses the machine type of the XML, as before.
(cherry picked from commit f3b47fcca98ca75c123615433df38d3642d2c5d4)
(cherry picked from commit 1e830adaa9)
A guest that an earlier rscan defined has duid=canonical. rscan -u and
rscan -w update its MAC address and keep mac.duid, and the DHCPv6
identifier selection for the node still gives the canonical DUID.
Before the fix both commands removed mac.duid and the selection fell
back to the firmware order.
The guest is defined before the first command, because this process
keeps the node list it reads first and the forked plugin inherits it.
(cherry picked from commit 36b997376d05cb0b74bec279766e2793e026f59b)
(cherry picked from commit 24a799abed)
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)
The plugin runs through process_request with a private SQLite database
and a stub libvirt connection. mkvm gives the domain XML vpd.uuid, and
a UUID that it generates, unchanged; rinv prints the domain UUID; and
rscan -w stores it in vpd.uuid. For a guest on machine type
pc-i440fx-2.1 or pc-i440fx-rhel7.1.0 they swap the first three fields
instead, and guest_uuid swaps only for those two machine types. Against
the old plugin the unchanged cases fail with the fields swapped, and
against a plugin that ignores the machine type the swapped cases fail
unswapped.
(cherry picked from commit 8db182e8c6fdf184ceeccc87ff5e5569070cc26a)
(cherry picked from commit dbf2ffb076)
mkvm and clonevm wrote the libvirt domain UUID with the first three
fields of vpd.uuid swapped, rscan swapped them back when it stored a
domain UUID in vpd.uuid, and rinv printed the swapped value. QEMU
stores the domain UUID as SMBIOS 2.6 specifies, so the guest reported
the swapped UUID, not vpd.uuid, and its UEFI firmware sent a DUID that
the reservation makedhcp derives from vpd.uuid did not match.
The plugin now converts through xCAT::KVMUtils::guest_uuid, which
keeps the UUID unchanged for every machine type except pc-i440fx-2.1
and its RHEL counterpart pc-i440fx-rhel7.1.0. Those machine types,
which QEMU before 9.1 and the qemu-kvm of EL8 still offer, store the
UUID bytes unencoded behind an SMBIOS 2.8 entry point, so their guest
reports the first three fields swapped and the swap stays. mkvm and
clonevm take the machine type of the domain they build, and rscan and
rinv the machine type of the domain they read.
A guest that mkvm defined before keeps its UUID, because mkvm reuses
the domain XML in kvm_nodedata. Its vpd.uuid keeps the swapped order
until it is corrected.
(cherry picked from commit 4d8007091c9a8ba2e246749a7278c0f5e04da374)
(cherry picked from commit 76f2008779)
dodiscovery runs in a private namespace with a fixed product_uuid and
stubbed hardware and transport commands. The test reads the UUID from
the discovery request that the script sends and expects product_uuid
unchanged. Before the fix the request held the UUID with its first
three fields swapped.
(cherry picked from commit 21762f21526e0ba71fb3b9a6d3ec314e59feb101)
(cherry picked from commit bff1e7ea93)
Genesis discovery swapped the first three fields of product_uuid before
it sent the UUID. When that was written, the kernel printed the SMBIOS
bytes in their stored order, and the swap gave the UUID that dmidecode
prints. Since Linux 3.8 product_uuid is that UUID already, so the swap
stores vpd.uuid in SMBIOS byte order. makedhcp then reverses it again,
and the DHCPv6 reservation does not match the DUID that UEFI firmware
sends.
Discovery now reports product_uuid as it is, as the OpenEmbedded
Genesis does. doxcat keeps the swap in the DUID that it writes for
dhclient, because the swap gives the DUID that the firmware sends.
Windows provisioning links the node file under both UUID orders and
does not change.
(cherry picked from commit 1a6cd4259ca8b71fc12aa03e61b88b60705d7889)
(cherry picked from commit dfdc48b96d)
The plugin builds the DHCPv6 reservations from a private xCAT database,
and kea-dhcp6 and dhcpd -6 serve them in a network namespace. DHCPv6
clients in a second namespace send the DUID that UEFI firmware sends,
the RFC 4122 order and a given DUID, and check the address and the
bootfile-url that each one gets.
Without mac.duid only the firmware order gets the reservation. With
duid=canonical the operating system gets the reserved address and the
firmware leases a pool address, so the two never hold the same address.
When mac.duid changes, Kea revokes the lease of the old DUID and dhcpd
gives the fixed address to the new DUID at once. An invalid value keeps
the existing reservation, and makedhcp -d removes the selected one only.
An IPv4-only node with the vpd.uuid of another node leaves the
reservation of that node alone.
The makedhcp autotest case checks duid=canonical and an invalid value
through chdef and makedhcp, and no longer says that RFC 6355 requires
the firmware order.
(cherry picked from commit 740d1b846c0c13342f9f1ec2e24f570354e885d4)
(cherry picked from commit f630ab6572)
The ISC host commands from makedhcp and the Kea reservations get the
same DUID for each value of mac.duid: firmware or no value, canonical, a
DUID in uppercase, an invalid value and a node without a usable
vpd.uuid. An invalid value is reported, and the node gets no DHCPv6
reservation in either backend.
A change of mac.duid replaces the reservation of the node and keeps its
address and bootfile-url. Query and delete match only the selected DUID,
so the other byte order of the same UUID stays with the node that holds
it. When a node is given the DUID of another node, both backends give
the reservation to the node that makedhcp updates, and makedhcp -d of
that node removes it, as they do for a MAC that two nodes share. An IPv6
node keeps its reservation when an IPv4-only node has the same vpd.uuid.
The DHCPv4 hosts and reservations, IPoIB included, do not change with
mac.duid, and IPv4-only nodes with an invalid DUID get no error from
either backend. Single-node requests in a cluster of a thousand nodes
read the rows of the requested nodes only.
(cherry picked from commit 9e5e5d90fe98891fda1e4e5ef8adec16a09a7f7f)
(cherry picked from commit ad53036f68)
makedhcp built every DHCPv6 reservation from vpd.uuid in the byte order
that EDK2 firmware sends, for ISC DHCP and Kea alike. A client that
encodes the UUID in RFC 4122 network byte order, as RFC 6355 refers to
it, sends a different DUID and never matches its reservation.
The new duid attribute (mac.duid) selects the identifier. firmware, the
default, keeps the EDK2 order: SMBIOS 2.6 and later store the first
three UUID fields little-endian, and EDK2 copies those bytes. canonical
uses vpd.uuid in RFC 4122 order. Any other value is the DUID itself.
makedhcp reports an invalid value as an error and does not change the
DHCPv6 reservation of that node.
Like a MAC address, a DUID identifies one client, and makedhcp treats
the database as authoritative for it as it does for MACs: the node that
makedhcp updates takes a reservation that another node held under the
same DUID, in both backends. A node without an IPv6 address needs no
DHCPv6 reservation, so an invalid duid there is a warning and does not
fail the request.
ISC DHCP, the Kea reservations and the Kea query and delete matches
take the DUID from one function, so the backends cannot disagree. A
reservation still matches one DUID. makedhcp does not reserve both
orders: Kea rejects two reservations of one address in a subnet, and
the second replaces the first in the xCAT update.
(cherry picked from commit d3360f32ce5f920d945cb6f902badf4a2a0a108b)
(cherry picked from commit 7a88c26b0d)
addnode6 printed its omshell commands to a file-scope handle, so no test
could read the DHCPv6 host that ISC DHCP is told to create. It now
returns the commands, and makedhcp prints them to the same omshell
session. The commands and their order do not change.
(cherry picked from commit 178de13a677ffe9326ed9cc697a063de39337e42)
(cherry picked from commit d7c8c41a07)
The DUID-UUID assertions called kea_duid_from_uuid directly, so they
pinned the helper and not the reservation that a client must match.
They now build the DHCPv6 reservations and the query and delete matches
for the same uuid values, and expect the same DUIDs.
The comment no longer says that RFC 6355 requires the firmware byte
order. RFC 6355 refers to RFC 4122, which encodes a UUID in network byte
order. The firmware order comes from EDK2, which copies the SMBIOS bytes.
(cherry picked from commit 1acf6b9e89791ceabb4e75f29b2d0aafa4886868)
(cherry picked from commit 8bfdb6c79d)
The OpenEmbedded discovery sends the product_uuid fixture and expects it
unchanged in the findme request.
(cherry picked from commit 092d78a224ee57af834a74ccfb63185f7120a2b7)
(cherry picked from commit 47fc5cf780)
Some aarch64 UEFI firmware ignores a boot file name without the .efi
suffix and requests grubaa64.efi instead. xcat-core/#7980 made
xCAT::DHCP::BootPolicy->grub2_node_loader the one place that name is
chosen, and the ISC and DHCPv4 paths of makedhcp call it.
kea_bootfile_url6_for_node in dhcp.pm builds the name itself, as
"grub2-$node", so the RFC 5970 bootfile-url of an aarch64 node never
carries the suffix and the node loads nothing. The routine also had no
node architecture to decide on: kea_build_node_reservations6 does not
read the nodetype table.
kea_build_node_reservations6 now reads nodetype.arch and noderes.tftpdir,
kea_node_reservations6 passes the nodetype entry on, and
kea_bootfile_url6_for_node asks grub2_node_loader for the name.
dhcp_grub2_node_loader.t, which holds the name down for the other two
paths, now asserts the DHCPv6 URL over its whole case table. Without this
change 2 of its 62 assertions fail: the two aarch64 cases where nodeset
has published the .efi link.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This branch is titled "provision a node over IPv6" and shipped one IPv6
xcattest case, makenetworks_ipv6_route_filter_unit, which is a unit-style check
that no bundle names. Nothing ran against a management node to show that the
DHCPv6 path works.
makedhcp_dhcpv6_boot_intent builds its own state on the management node -- an
IPv6 address on the provisioning NIC, a matching xCAT network, and a node that
answers only on IPv6 with a fixed vpd.uuid -- and asserts four things a UEFI
client depends on: makedhcp exits 0, kea-dhcp6 accepts the configuration it
wrote, the reservation's DUID is the uuid with its first three fields reversed
as the firmware sends them, and the bootfile-url is the RFC 5970 form with a
bracketed authority. It then asserts the IPv4 configuration carries no
reservation and no client class for that node.
Every value is read out of Kea's JSON with python3 and compared for EQUALITY. A
grep for bootfile-url passes on the key alone, and a check whose pattern appears
in its own command cannot fail.
The uuid is fixed rather than generated, because the expected DUID is derived
from it. The case pre-cleans before it builds: xcattest stops a case at its
first failed check, so the cleanup at the end does not run after a failure, and
without the pre-clean a failed run would leave an address, a network and a node
behind for the next run to measure.
It needs no compute node and no image, so it runs wherever a management node is
installed. ci/bundles/ipv6_dhcpv6.bundle and the el10-x86_64-ipv6 cell in
xcat-core-ci-cd dispatch it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node with an IPv6 reservation took a pool address with no bootfile-url and
stopped at PXE-E21. RFC 6355 carries the sixteen octets of the system UUID as
the firmware holds them, and SMBIOS 2.6 and later store time_low, time_mid and
time_hi_and_version little-endian, while vpd.uuid holds the canonical spelling
Linux reports in product_uuid. kea_duid_from_uuid copied that spelling verbatim,
so the DUID disagreed with the client in its first eight octets and Kea never
matched the reservation.
Measured on xcat76-cn, 2026-10-23, with vpd.uuid
c78c76bf-3286-46f3-b80d-8fe079dd6de7:
xCAT wrote 00:04:c7:8c:76:bf:32:86:46:f3:b8:0d:8f:e0:79:dd:6d:e7
the firmware sent 00:04:bf:76:8c:c7:86:32:f3:46:b8:0d:8f:e0:79:dd:6d:e7
The first three fields are now reversed. The ISC path had its own copy of the
same transformation and the same defect; it calls the sub instead, so the two
backends cannot disagree about what a client's DUID looks like. A uuid that is
not sixteen octets now has no DUID and the node is skipped with a warning,
rather than a malformed string reaching omshell.
Two assertions in dhcp_kea_plugin_intent.t held the canonical spelling and so
agreed with a DUID no firmware presents; they now hold the reversed form. Five
assertions fail without the reversal.
Also: makedhcp exited 1 on an IPv6-only node whose DHCPv6 reservation and
bootfile-url it had just written correctly. kea_node_client_classes_for_nodes
resolved next_server_for_node before the per-MAC loop that skips an IPv6-only
node, so the node still reached the IPv4 resolver, and with noderes.xcatmaster
naming a host that has only an AAAA record inet_aton fails and the sub reports
an unresolvable tftpserver with errorcode 1. 6f171a22b made the same call lazy
in kea_node_reservations and missed this second site. It is resolved on first
use now, and the new assertion is on the CALL rather than the exit code, because
the error is what the exit code is made of.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
site.master may carry a port. format_syslog_forward_target in
xCAT/postscripts/syslog bracketed any value containing a colon, so
MASTER=127.0.0.1:1515 rendered the rsyslog line as @[127.0.0.1:1515], which
rsyslog does not accept, and syslog_ng_udp_driver chose udp6 for an IPv4 peer.
format_syslog_server in the dracut_105 rsyslogd-start.sh carries its own copy of
the rule and had the same defect; it runs inside the initramfs and cannot source
the postscript, so the rule is held down twice on purpose.
An IPv4 address or a hostname with a port has exactly one colon and an IPv6
literal has at least two, so the test is now on two colons rather than one. A
value already starting with "[" is left alone whether or not a port follows it,
which the old pattern missed: it required a trailing "]" and so double-bracketed
[2001:db8::1]:514.
ipv6_syslog_forwarding.bats gains four cases. Without the fix, "a target with a
port is not mistaken for an IPv6 literal", "an already-bracketed target with a
port is left alone" and "the initrd launcher does not mistake a port for an IPv6
literal" all fail; the compressed-literal case passes either way and is there to
show the bracketing of ::1 did not regress.
Also: grub2_ipv6.t could not load grub2.pm once xcat-core/#7980 made it use
xCAT::DHCP::BootPolicy, which lives in perl-xCAT. The file died at compile time
and reported no plan at all, which in a prove summary reads as a count
discrepancy rather than a failure. It now puts perl-xCAT and the server perl
directory on @INC, as every other plugin test does.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An EL10 stateless compute node gets its lease, loads its iPXE script and
downloads the kernel and the initramfs, then dies four seconds into the
kernel:
dracut: FATAL: No handler for netroot type 'xcat'
dracut: Refusing to continue
reboot: Power down
xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot lost its
execute bit in 3928c0450. genimage copies the file with the mode it reads
from the share tree, and dracut's inst_script keeps that mode, so
/sbin/xcatroot reaches the initramfs mode 0644. dracut resolves the
handler with command -v, which skips a file that is not executable, so
netroot.sh finds no handler and gives up. An EL9 node reads dracut_047,
where the same file is mode 0755, so only EL10 is affected.
The fix restores mode 0755. netboot_xcatroot_executable.t fails without
it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
dracut dispatches the network root in 45net-lib/netroot.sh with
handler=$(command -v "${netroot%%:*}root"). command -v skips a file
without the execute bit, so an xcatroot shipped mode 0644 makes the node
print "No handler for netroot type 'xcat'" and power off in its
initramfs. genimage copies the file with the mode it reads from the share
tree, and dracut's inst_script keeps that mode, so the mode in the
repository is what reaches the node.
The new test asserts the execute bit on every xcatroot under
xCAT-server/share/xcat/netboot and xCAT-genesis-base. It fails on the
current tree, on
xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
addnode and delnode find an existing host entry through the host-entry index,
and that index indexed node names only for an IPv4 first field and keyed the
address on its literal spelling. So makehosts left two entries for one node:
changing node01 from 2001:db8::10 to 2001:db8::20 added the second address and
kept the first, and an expanded IPv6 entry stayed when the compressed spelling
of the same address was added or deleted. The node resolved to a stale address.
_host_entry_matches handled both cases and no code called it. It is removed,
because a second place that compares an address is how this file reached this
state.
xCAT::NetworkUtils gains canonical_ip_address, which answers the one spelling
every spelling of an address shares. It is built on _pack_ip_address, so it
prefers core Socket and falls back to the optional Socket6. The index keys on
that answer, and it indexes node names for any first field whose shape is an
address.
On a host with no parser for IPv6 the canonical form is undefined and the
index keys on the literal. An address change written the same way still leaves
one entry, through the node name. An equivalent spelling becomes a second
entry, which is the limit of what such a host can decide.
makehosts_ipv6.t now runs addnode and delnode and reads the host entries they
produced. Eight of its 21 assertions fail against the previous index,
including the address change and both spelling-equivalence cases.
makehosts_index.t stubbed xCAT::NetworkUtils as an empty package. It loads the
real module, because the index now reads the canonical address from it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Two gaps from the same branch.
ddns.pm:453 assigned "my @myips = _local_addresses_for_network(...)" and never
read the value, and _local_addresses_for_network had no other caller. The
routine and its three assertions in ddns_ipv6.t are removed: a test on a
routine nothing calls measures nothing and keeps dead code alive.
The commit that moved the shell tests to bats deleted el10_ipv6_runtime.t and
wrote no bats file for pre.rhels10, so its new create_listen_socket, its peer
allow list, its screendump rewrite and extract_url_host had no assertions.
ipv6_pre_rhels10.bats renders the install monitor pre.rhels10 embeds, fills
the two substitution tokens the way xCAT fills them, runs it and speaks its
protocol over each family. It also drives extract_url_host and the expression
that finds the install URL in the kernel command line, read from the script
rather than retyped.
Six reversions of the script were each measured: an AF_INET-only listener, a
missing peer check, the os.popen screendump, the colon split of the URL, a
grep that drops the bracket alternative, and a missing strip on the received
command. Every one fails at least one assertion.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Sixteen assertions on this branch matched a regular expression against the
source of the code they test. Such an assertion passes when the code is moved
somewhere it never runs, and fails when the file is reformatted and nothing
has changed: a perltidy respace of updatenode.pm:1606 turned
updatenode_ipv6_endpoint.t red with the behaviour unchanged.
updatenode_ipv6_endpoint.t now runs updatenoderunps and updatenodesoftware
and reads the xdsh command each one dispatched. It also covers the service
node name that has no usable endpoint, which the regular expressions could
not reach.
anaconda.pm built the debug syslog kernel arguments inline inside two large
subs. Move each to its own sub, _netboot_syslog_kcmdline_args and
_install_syslog_kcmdline_args, and render them in the test. An unusable
server name now gives no syslog arguments, where it gave "syslog.server="
with nothing after it.
pping is a program with no sub API, so the nmap and fping command building
moves to xCAT::DSHCore as nmap_ping_command and fping_ping_command, and pping
stays the caller that forks and execs the list.
credentials_ipv6_callback.t read allowcred.awk as text, and ran gawk from a
.t. The awk program is covered by xCAT-test/bats/ipv6_allowcred_awk.bats,
which starts it and speaks the credential protocol to it over both families.
Stubbing Socket6 and IO::Socket::INET6 in %INC also unskips the four
_open_callback_socket assertions, which skipped where the suite runs.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Every caller of Socket6 and IO::Socket::INET6 loads it with an eval and keeps
working on IPv4 when the load fails. NetworkUtils carries a second resolver
path on core Socket for exactly that case. xCAT-server.spec and
xCAT-server/debian/control named both modules as a hard dependency, which
states a dependency the code does not have and stops xCAT installing where
the modules are missing.
Declare both as Recommends in the spec and in debian/control. A package
manager installs a recommendation by default, so a management node still gets
them. Both are in EL AppStream and in openEuler 24.03 everything, measured
from its primary.xml.
The family cache block in networkutils_ipv6_helpers.t was guarded on Socket6
and skipped where the unit suite runs, which has no Socket6. The family cache
keys are the same on both resolver paths, so the guard now accepts either
resolver: six more assertions run, and one of them fails when the OnlyV4 and
OnlyV6 cache split is removed.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
makehosts reads the address test in four places. The branch widened all four
from isIpv4addr to isValidIp so an IPv6 hosts.ip reaches /etc/hosts, and only
addotherinterfaces had a test. Narrowing add_hosts_content, delotherinterfaces
or the no-noderange path back to isIpv4addr left the whole unit suite passing,
so three of the four changes measured nothing.
The no-noderange path had no sub to call: its loop sat inside process_request,
which opens /etc/hosts and takes a lock. Move that loop to
add_all_hosts_content, which takes the hosts table rows and answers the node
names, and leave the table read, donics and writeout in process_request. The
domain carry-over between rows is kept as it was.
makehosts_ipv6.t now drives each of the three remaining places with an IPv6
address and reads the host entries it produced. Each one fails on its own
assertion when its address test is narrowed back to isIpv4addr.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>