openSUSE ships DB_File in perl-core-DB_File. The spec asks for perl-DB_File on
every platform below EL10, so zypper refuses the transaction with "nothing
provides 'perl-DB_File' needed by the to be installed xCAT-server" and the
management node cannot install xCAT.
The test reads the Requires of xCAT-server with rpmspec for openSUSE, EL9 and
EL10. On openSUSE it expects the perl(DB_File) capability and no perl-DB_File
package name. The EL assertions hold the existing behaviour down: EL9 keeps the
hard package requirement, EL10 keeps none.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xCAT-buildkit, xCAT-client, xCAT-test and xCAT-vlan failed in %build with
"pod2man: command not found", and buildrpms.pl then refused to index a partial
repository, so there is no openSUSE core repo to install from at all.
An openSUSE build root installs only perl-base, which does not ship pod2man, and
xpod2man runs it. The four specs guarded "BuildRequires: perl-Pod-Html" with
"%if !0%{?suse_version}" and declared nothing in its place, so openSUSE had no
requirement that brings the tool in. They now require the full perl package there.
This is not an IPv6 defect. xCAT-vlan and xCAT-buildkit carry no change on this
branch and fail the same way, so the gap predates it; it is fixed here because it
stands between the branch and any openSUSE test.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Nothing asserted that the specs whose %build runs xpod2man declare something that
ships pod2man on openSUSE. The test reads the BuildRequires of each one for
openSUSE and for EL, so the EL side is held unchanged beside it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
subiquity_boot_params now asks whether the node has an IPv4 address, and this
test's xCAT::NetworkUtils stub had no node_is_ipv6_only, so the extracted routine
died at the call and the file reported no plan rather than a failed assertion.
The stub answers that the node has an IPv4 address, which is what every case here
describes. The refusal itself is covered in debian_subiquity_boot_params.t.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
With a boot configuration written, an IPv6-only node reached the live installer and
could only PXE-loop. casper configures the interface with klibc ipconfig and mounts
the root with klibc nfsmount, and neither knows IPv6: measured on noble, the
ipconfig in the casper initrd carries no IPv6 string at all, and nfsmount answers
"need a path" for both "[2001:db8::1]:/export" and "2001:db8::1:/export".
subiquity_boot_params now refuses a node with no IPv4 address and says why. The
caller already reports the message and skips the node. A node with an IPv4 address
is unaffected.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The test never asked what subiquity_boot_params does for a node with no IPv4
address. The new cases assert that such a node is refused, that the message names
the node and the component without IPv6 support, and that a node which has an IPv4
address is unaffected.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
nodeset refused the node and named the wrong reason:
Error: The <node> can not be resolved
Error: Failed to generate grub2 configurations for some node(s)
The node resolves: it has an IPv6 address and no IPv4 one. setstate resolved the
!myipfn! placeholder with my_ip_facing, which resolves its argument with inet_aton
and so reports any IPv6-only node unresolvable.
The lookup now follows the address family of the node, as the tftpserver lookup in
the same file already does. A node with an IPv4 address keeps the lookup it had.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
grub2_ipv6.t drove setstate with a command line that has no placeholder, so the
lookup that resolves it was never exercised. The new cases assert the placeholder
becomes the IPv6 facing address and that the IPv4-only lookup, which reports the
node unresolvable, is not used. The IPv4 case beside it holds that path unchanged.
An earlier version of the assertion counted IPv6 facing calls, which the tftpserver
lookup in the same run already makes, so it passed with the defect in place.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
vm.othersettings firmware: accepted only efi, which leaves Secure Boot to libvirt
firmware autoselection. Autoselection picks a descriptor by host policy, so on a
host whose best match enrolls keys the guest refuses an unsigned boot loader:
NBP file downloaded successfully.
BdsDxe: failed to load Boot0004 "UEFI PXEv6" : Access Denied
That decides whether a node can network boot over IPv6. A DHCPv6 bootfile-url is
written for a grub2 node alone, and the grub2 image under /tftpboot/boot/grub2 is
built with grub2-mkimage and is not signed, so a node with Secure Boot enforced
cannot start it and falls through to the next boot entry.
firmware: now also takes efi-secureboot and efi-insecure, and build_xmldesc adds
the <firmware> element that states the request. enrolled-keys follows secure-boot
because libvirt refuses a guest whose keys are enrolled while Secure Boot is off.
XML::Simple writes the firmware attribute of <os> and the element has the same
name, so the element is added to the rendered XML rather than to the hash.
firmware:efi keeps its behaviour and adds no element.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The setting accepted one value, efi, and nothing covered what a guest then asks of
Secure Boot. The test holds down which values the setting accepts, what each one
asks, and the guest XML each one produces, including that a guest which does not
ask for EFI gains no firmware element.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
post.xcat and post.xcat.ng exported XCATSERVER as "$MASTER_IP:3001".
getcredentials.awk and updateflag.awk split that value on a colon to separate the
address from the port, and an IPv6 address is full of colons, so the node could not
reach xcatd. remoteshell installed no root key and the node stopped at
installstatus postbooting.
Measured on openEuler 24.03: the node installed, booted, answered ping6 on its
reserved address, and refused xdsh with "Permission denied (publickey)" while its
status stayed postbooting.
Both scripts now build the endpoint with format_host_port, as post.xcat.rhels10
already did.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
post.xcat.rhels10 builds XCATSERVER with format_host_port and the other two copies
wrote "$MASTER_IP:3001". The test drives each script's own format_host_port and
asserts that no copy interpolates the address unbracketed.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
post.xcat and post.xcat.ng built their download URLs as
"http://$MASTER_IP:${HTTPPORT}...". An IPv6 management node address already
contains colons, so the result is not a URL, curl and wget refuse it, the script
reports installstatus failed and halts with sleep infinity. The install itself has
already succeeded at that point, so the node sits in %post and xCAT records
status=failed, which reads as an install failure.
Measured on openEuler 24.03: the node took its reserved address, installed all 565
packages over IPv6, then stopped in "Running post-installation scripts".
Both scripts now carry the format_uri_host helper that post.xcat.rhels10 already
had, and build their URLs from MASTER_HTTP_HOST. The helper is a third copy because
a node has no shared shell library at the point these scripts run.
This reaches openEuler, EL 8, EL 9 and CentOS 8 through post.xcat.ng, and the
Ubuntu and SUSE post scripts through post.xcat. EL 10 was already correct.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
post.xcat.rhels10 brackets the management node address before it goes in a URL and
the other two copies did not, and nothing held the three to each other.
The test drives each script's own format_uri_host with one table, and asserts that
no download URL in them interpolates MASTER_IP unbracketed.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
makedhcp wrote no boot file into a DHCPv6 reservation, so the firmware took the
reserved address and had nothing to load. EDK2 reported "PXE-E21: Remote boot
cancelled" and tried the next boot entry, which reads as a DHCP failure although
the address was granted. Measured on openEuler 24.03: dhcpd6.conf carried no
bootfile reference where the DHCPv4 configuration carried fifteen.
addnode6 now emits option dhcp6.bootfile-url, which is RFC 5970 option 59, from
the same helpers the Kea backend uses. Those two helpers read noderes and
BootPolicy, not Kea, so they lose their kea_ prefix.
Two further defects kept the same node from booting. The DHCPv6 daemon was never
started: ISC runs it as a second service, the flag that recorded the need was
assigned and never read, restart_dhcpd restarted only the DHCPv4 service, and the
service map had no ISC DHCPv6 name. And makedhcp failed with "The file
/etc/sysconfig/dhcpd6 doesn't exist" although no EL or openEuler dhcp package
ships that file and dhcpd6 does not need it: with the file deleted the daemon
still binds the provisioning NIC, because ISC dhcpd listens only on the
interfaces its subnet declarations name.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The DHCPv6 half of makedhcp had no test for the boot file, the DHCPv6 service or
the sysconfig file, so a node could be given its reserved address with nothing to
load and the suite stayed green.
The test drives the ISC path of makedhcp and asserts that every DHCPv6 host it
creates carries a bootfile-url naming the grub2 loader, that a node with
netboot=xnba gets none, that the DHCPv6 daemon is restarted, and that a missing
/etc/sysconfig/dhcpd6 is not reported as an error.
The harness now names the operating system instead of reading the host it runs
on. Both sysconfig branches depend on it, so without this the test exercised
whichever branch the build host happened to take, and the error assertion passed
with the defect in place. It also stubs restartservice, which the harness
previously let through to the services of the build host.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The IPv6 provisioning support has no page in the admin guide, so two
requirements that a cluster cannot work without are only visible in the code.
Only netboot=grub2, grub2-http and grub2-tftp get a bootfile-url in a DHCPv6
reservation, and the grub2 image under /tftpboot/boot/grub2 is not signed, so
firmware that enforces Secure Boot downloads it and refuses to start it.
The page states both requirements, how xCAT predicts the DHCPv6 client
identifier from vpd.uuid, what the configdhcpv6duid postscript does, and the
static address that nodeset puts on the kernel command line.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
sles.pm matched ipv6 nowhere in 2801 lines and the SUSE templates wrote
"<bootproto>dhcp</bootproto>" directly, so an IPv6-only SUSE node had no way to configure its
installer: DHCP cannot serve it, and SUSE has no static handoff on the kernel command line.
_autoyast_network6 builds the networking section of such a node, with a static interface, the
address of the node and a prefix length, which is what AutoYaST takes for IPv6 instead of a
netmask, and a default route carrying the IPv6 gateway.
The #YAST2NET6# directive chooses between that and the DHCP block the templates carried. An IPv4
node gets that block unchanged, which is why the existing #YAST2NET# was not used: its DHCP arm
renders something else, and leap15.6 is a gating cell. compute.leap15.tmpl and compute.sle15.tmpl
take the directive.
autoyast_ipv6_network.t covers the section. Emitting a netmask instead of a prefix length fails 2
of its 11 assertions. The IPv4 output of the directive was compared with the text it replaced and
is identical.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
root=nfs:, XCAT=, xcatd= and imgurl=http:// all separate the server from what follows with a
colon, so an IPv6 address in any of them cannot be told from the path or the port. Eight sites
built those values by interpolation, and a diskless, statelite or cloned node of any family took
a command line its initrd could not parse.
build_statelite_nfsroot_parameter brackets the server, which covers the NFS root of all three
netboot plugins at once. debian.pm and sles.pm now build the XCAT endpoint and the image URL
through xcatd_cmdline_address and format_host_port, as anaconda.pm already did for the install
path, and the mksysclone endpoint of anaconda.pm and sles.pm goes the same way.
destiny.pm had a third xcatd= site. The earlier change covered the two genesis branches and left
the legacy nbk branch interpolating the address.
nfs_root_options.t asserts the bracketed form, the IPv4 form and the mount options after a
bracketed address. Removing the brackets fails 2 of its 80 assertions and leaves the IPv4 and the
name cases passing.
zvm.pm carries the same pattern and is left alone: z/VM has no IPv6 netboot path to test it on.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
makedhcp builds a DUID-UUID from vpd.uuid and the reservation carries one identifier, but no
network manager derives that identifier in the byte order the firmware sends. NetworkManager has
no option for the SMBIOS UUID at all, and systemd-networkd's DUIDType=uuid uses the decoded
product UUID, which is the other order. So a node whose installed OS speaks DHCPv6 matched no
reservation and took a pool address.
configdhcpv6duid writes the identifier for whichever renderer the node has: the whole DUID for
NetworkManager, and the type by name with the sixteen bytes alone for systemd-networkd, which
composes the two. It is in the default postscript list for Linux, after remoteshell. AIX has
neither renderer and keeps its list.
A diskless or statelite node needs nothing: its address comes from the kernel command line and
configeth writes dhcp6: false, so its image sends no DHCPv6 request.
postscript_dhcpv6_duid.bats pins both forms to the literal the two Genesis images already use,
so the four copies of the byte swap cannot drift apart, and asserts the node fails loudly when
it has no renderer. postscript_dhcpv6_duid_registered.t holds the registration down: dropping it
fails 3 of its 7 assertions.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
mknetboot excluded a statelite node from the static IPv6 address with no reason recorded, and
mksysclone had no IPv6 code at all. Both reach the same dracut networking as a diskless node, so
both asked DHCPv6 with the identifier their initrd generates. A reservation matches one
identifier, so the node took a pool address and no boot URL.
Statelite now takes the same path as diskless, and mksysclone renders the address beside the
Genesis kernel it boots.
anaconda_ipv6_statelite_sysclone.t drives both commands against a SQLite fixture. Restoring the
statelite guard fails one of its six assertions and removing the mksysclone block fails another,
while the diskless assertion survives both, so the gate did not move for diskless.
debian.pm records why the Ubuntu live filesystem is mounted over IPv4. The comment blamed casper,
which passes nfsroot= through untouched; klibc nfsmount is what cannot read an IPv6 server.
Measured on noble: "[2001:db8::1]:/export" and "2001:db8::1:/export" both answer "need a path",
while "192.0.2.1:/export" is accepted.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The static IPv6 boot path was gated on is_el10_os, which tests the basename against
rh|centos|alma|rocky|ol and the major version against 10 exactly. openEuler reaches the same
kickstart and dracut code through #KICKSTARTNET#, but the predicate answered 0 for it, so an
openEuler node fell to "dhcp --device=X --noipv4 --ipv6=dhcp". Its installer then sent the DUID
that NetworkManager generates, which matches no reservation, and the node took a pool address.
The same equality left a later EL release on the DHCPv6 path for no reason.
SvrUtils::uses_static_ipv6_boot names the capability instead of a version: openEuler of any
release, and EL from 10 upwards. The three gates in Template.pm and anaconda.pm read it, and the
variable that carried the answer is no longer called el10_ipv6_only. is_el10_os keeps its own
tests and its one remaining meaning.
anaconda_ipv6_rendering.t asserts the predicate per family. Removing the openEuler arm fails 2
of its 38 assertions and leaves 36 passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
configeth guarded the route with "[ a ] -a [ b ]", which is not a shell operator. bash reported
"[: too many arguments" and took the else path on every run, so /etc/sysconfig/network/routes
never received the IPv6 default route of a SUSE node and nothing said so.
The duplicate check behind that guard spelled the character class "[:space:]", which is a
bracket expression matching one of those six characters. It found no route already present, so
fixing the guard alone would have appended the route on every run of the postscript.
The two tests are now a valid shell condition and a correct class, and the logic moved into
add_suse_ipv6_default_route so it can be read without an installed node.
ipv6_configeth_suse_route.bats covers both faults separately. Restoring the operator fails 4 of
its 7 cases, one of which asserts that bash reports nothing on stderr; restoring the class fails
only the case that runs the postscript three times and expects one route.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
getzonesfornet in dhcp.pm rounded the prefix itself and passed the rounded value beside a
network that still carried its own. getIPv6PrefixLength prefers the embedded prefix, so the
rounded value was ignored and no reverse zone was written at all: dhcpd updated no PTR record
for a /62 or /126 network and reported nothing. The ddns.pm copy stripped the prefix first and
was unaffected, so the previous commit's claim that both copies were fixed was wrong.
The zones now come from xCAT::NetworkUtils::getIPv6ReverseZones, which both copies call. A
network whose prefix is not a multiple of 4 is covered by the zones of the next nibble -- a /62
by its four /64 zones -- which is what the IPv4 arm does with a /22. Rounding down to the /60
made xCAT answer for three networks it does not own.
kea_subnet_id_numeric.t only observes the encoding under the XS backend, and passed 6 of 6
under JSON::PP with the bug in place. It skips unless JSON->backend is the XS one, and the
workflow installs libjson-xs-perl so the backend is there.
dhcp6_boot_server now reports a substituted boot server, so an unresolvable tftpserver is not
silent, and the caller reports a warning that arrives with a server. The routine also moved
below grub2_node_loader, whose comment it had separated from it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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)