mknetboot gave an IPv6-only node ip=either6, which asks dracut for DHCPv6.
DHCPv6 assigns one address with a prefix length of 128 and carries no route, and
an xCAT provision network sends no router advertisement: radvd is not installed
and net.ipv6.conf.<nic>.forwarding is 0. The node came up with the address and
no way to reach the server, and the dracut hook reported
"Connecting to [2001:db8:147::1]:80... failed: Network is unreachable."
debian.pm now builds the static form from the address, gateway and prefix the
node already has in the database, the way sles.pm passes hostip and gateway to
linuxrc. either6 remains the answer when the address cannot be resolved.
Captured by xCAT-test/unit/dracut_static_ip6.t. Removing the prefix length from
the parameter fails four of its nine assertions and leaves the bracketing and
the refusal cases passing.
Measured on an IPv6-only Ubuntu 24.04 node: Kea records prefix_len=128 for its
lease, and dracut logged BOUND6 for eth0 before the fetch failed.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
grub2_kernel_commands read the image and not the architecture, so a ppc node
whose grub2 image carries linuxefi was given it. linuxefi loads an EFI binary
and a ppc loader is not one. The previous commit removed the architecture test
along with the defect it carried.
The command now needs both: the architecture whose loader is an EFI binary, and
an image that carries the command.
grub2_netboot_protocol.t covers the three architectures and caught this. Its
loader fixture now records the commands it carries, because the configuration
follows the image.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
setstate in grub2.pm appends "efi" to the kernel and initrd commands for every
node whose architecture matches x86, so the configuration reads linuxefi and
initrdefi. Both come from a downstream patch. grub2-xcat 2.12-2 for Ubuntu is
built from upstream grub and carries neither, so the node loads the loader and
its own configuration over TFTP, prints "can't find command `linuxefi'", asks
for no kernel, and waits at the menu until it is powered off.
The pair now comes from the image served to the node. BootUtils reads the
image, which records the name of every command its modules register, and
answers linuxefi and initrdefi only when the image carries them. An image that
cannot be read is answered with linux and initrd, which every grub2 image
carries.
This reaches a node only when it netboots with grub2. An IPv6 node has no other
loader, because bootfile-url is written for grub2 alone.
Measured on an IPv6-only Ubuntu 24.04 node: with linuxefi the node made no TFTP
request for the kernel; with linux it loaded the kernel and the initial ramdisk
and printed no error.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The search list added in the previous commit carried no config:type, and the
AutoYaST schema gives searchlist the LIST type, the way it gives it to
nameservers. xmllint against profile.rng of Leap 15.6 reports only "Element
profile failed to validate content", and YaST refuses the profile entirely, so
the node cannot install at all.
searchlist is now emitted as a typed list. Measured against
/usr/share/YaST2/schema/autoyast/rng/profile.rng on a live management node: the
generated profile fails to validate, the same profile with the attribute added
validates, and removing hostname as well changes nothing, so hostname was not
the element at fault.
Captured by xCAT-test/unit/autoyast_ipv6_network.t, which gained an assertion on
the attribute.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
_autoyast_network6 sets dhcp_hostname to false, because an IPv6-only node has no
DHCPv4 to take a hostname from, and it writes no hostname of its own. YaST then
has nothing to set: y2log of an installed node records Y2Network::Hostname with
@static=nil, @transient=nil and @dhcp_hostname=:none, and the node answers
"localhost". The two sibling builders in the same file write both keys.
The dns section now carries the node name and a search list of the node domain.
getNodeNetworkCfg6 already returns the name, so no new lookup is needed.
Captured by xCAT-test/unit/autoyast_ipv6_network.t. Without the two keys its
assertions 17 and 18 fail and the other 16 pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
_autoyast_network6 passed the node nameserver list through unchanged, so an IPv6-only
node was configured with the IPv4 resolver that site.nameservers names for the cluster.
The node cannot reach it, and an unreachable server in resolv.conf costs every lookup
a timeout.
The list now keeps only the IPv6 servers. When that leaves none, the gateway stands
in, which is the management node and already answers for the node. The <xcatmaster>
substitution is unchanged.
Captured by xCAT-test/unit/autoyast_ipv6_network.t, where two of its sixteen
assertions fail without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only openSUSE node completed its install with the static IPv6 address in its
AutoYaST profile, then booted with a link-local address only. The applied profile on
the node carried bootproto static and the address, and ifcfg-eth0 read BOOTPROTO=dhcp
with a modification time later than the install.
post.sles.common writes that file. It keeps the interface configuration only when
MANAGEDADDRESSMODE reads static, and managed_address_mode returned
site.managedaddressmode, which was unset. xCAT wrote the static configuration and then
removed it.
managed_address_mode now takes the node and reports static for a node that
xCAT::NetworkUtils::node_is_ipv6_only reports as IPv6-only. A node with any IPv4
address keeps the site value, so an IPv4 and a dual-stack cluster are unchanged.
Captured by xCAT-test/unit/template_ipv6_rendering.t, where one of the three new
assertions fails without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The Ubuntu diskless kernel command line carries no dracut ip= parameter. dracut then
configures the interface it needs with DHCPv4, so an IPv6-only node comes up with no
global address, cannot fetch imgurl and never mounts a root.
gen_net_boot_params now returns ip6 beside the ip it already derived, spelled either6,
which asks dracut for DHCPv6 and falls back to router advertisement. debian.pm appends
it for a node that xCAT::NetworkUtils::node_is_ipv6_only reports as IPv6-only, so an
IPv4 node is told exactly what it was told before. The ip the EL path reads is
unchanged.
Captured by xCAT-test/unit/networkutils_dracut_ipv6_boot_param.t. This closes the
derivation; the Ubuntu diskless path is not yet proven end to end on a cluster.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
_autoyast_network6 builds a networking section with a static interface, but did
not set keep_install_network. AutoYaST then keeps the network the installer
used and ignores the interface in the profile.
The node installed over IPv6 and booted with ifcfg-eth0 BOOTPROTO=dhcp and no
address but a link-local one. xcat.sh could not reach the management node:
"logger: failed to connect to 2001:db8:156::1 port syslog-conn" and
"connect: Network is unreachable", so no postscript ran and the node never
registered.
The section now sets keep_install_network to false, which is what makes AutoYaST
write the static interface.
Measured on the installed node: /etc/sysconfig/network/ifcfg-eth0 carried
BOOTPROTO=dhcp and the only address was fe80::4078:c0ff:fea8:9c0a.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
_autoyast_network6 emitted dhcp_resolv in the dns block of the networking
section. The AutoYaST schema of Leap 15.6 does not accept that element, and one
element it refuses invalidates the whole profile: YaST reported "Extra element
networking in interleave", then "A profile for this machine could not be found
or retrieved", and the installation stopped.
dhcp_resolv says whether DHCP may overwrite resolv.conf. The section configures
the node statically, so there is no DHCP to keep away from resolv.conf.
Measured with the schema the installer ships, /usr/share/YaST2/schema/autoyast/
rng/profile.rng: the profile failed to validate at the networking element, and
removing dhcp_resolv alone made it validate.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
sles.pm gave linuxrc no network arguments beyond the net device. linuxrc
configures IPv4 by default, so an IPv6-only node sent an IPv4 DHCPDISCOVER,
received "no/incomplete answer", and reported "Failed to download AutoYaST
file" without ever contacting the install source.
static_ipv6_boot_args() adds ipv6only=1 with the address, prefix, gateway and
IPv6 nameserver of the node. The node is configured statically for the reason
anaconda.pm configures EL statically: the firmware answers DHCPv6 with the
RFC 6355 DUID-UUID that the reservation is keyed on, while the installer builds
a DUID of its own that matches no reservation.
Measured on a Leap 15.6 node: with these arguments the installer fetched
control.xml from http://[2001:db8:156::1]:80/install/leap15.6/x86_64/1 from its
own address 2001:db8:156::10. Without ipv6only=1 linuxrc ignores the rest and
stays on IPv4.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
addnet6 read the dynamic range from $netcfgs{$net}, where $net is the subnet it
writes, "2001:db8:156::/64". addrangedetection stores the range under
networks.net, "2001:db8:156::", so the lookup always missed and makedhcp warned
"No dynamic range specified" for a network whose row declares one.
The subnet then carried no range6, and a DHCPv6 client whose DUID matches no
reservation received no address. The SUSE installer is such a client: linuxrc
builds its own DUID rather than the DUID-UUID the firmware sends, so it could
not get an address even though the node has a reservation for the same MAC.
dynamic_range_for() looks the range up under the subnet as written and then
under the network address alone.
xCAT-test/unit/dhcp_dhcpv6_conf_file.t fails its prefix-form assertion when the
second lookup is removed.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The media_url of an autoyast add-on product came from
"#TABLE:noderes:$NODE:nfsserver#", which substitutes the address of the
management node without brackets. An IPv6-only node therefore received
<media_url>http://2001:db8::1//install/leap15.6/x86_64</media_url>, and YaST
cannot read that as a URL, so the installer reached no repository.
_sles_media_url() uses the bracketed master host for a node with no IPv4 address
and keeps the substitution for every other node, which service nodes rely on.
xCAT-test/unit/template_ipv6_rendering.t fails its two IPv6 assertions when the
bracketed host is dropped.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
grub2.pm replaced !myipfn! with the facing address as it stands. sles.pm and
anaconda.pm put that placeholder where a URI authority expects a host, with the
port already appended, so an IPv6-only node was told to install from
"http://2001:db8:156::1:80/install/...". Nothing can split that into an address
and a port, so the installer could not reach the repository.
substitute_facing_address() brackets a placeholder that a port follows and
leaves every other one bare, because xcatd=!myipfn! names a host with no port
and the postscripts read that value as it stands.
The other five plugins that substitute the placeholder serve BIOS PXE, ppc64le
and yaboot, none of which network boots over IPv6, so they keep the bare
replacement.
grub2_ipv6.t and sles_install_url_ipv6.t fail their bracketing assertions when
the port-aware branch is removed, and their bare-address assertions still pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
sles.pm built its install URLs as "$server:$port". An IPv6 address contains
colons, so a node was told to install from
"http://2001:db8:156::1:80/install/leap15.6/x86_64/1" and could not reach the
repository. The same join was in the statelite and stateless imgurl=. The XCAT=
argument beside them was already bracketed.
rootimg_url() and autoyast_boot_args() now build those URLs through
xCAT::NetworkUtils::uri_authority(), which brackets an IPv6 address and passes a
name or a !myipfn! placeholder through unchanged. uri_authority is the former
xcatd_cmdline_address, renamed because three URL sites now share it;
xcatd_cmdline_address stays as a wrapper for its own callers.
xCAT-test/unit/sles_install_url_ipv6.t fails its four IPv6 assertions when the
colon join is restored.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
ISC serves DHCPv4 and DHCPv6 from two files in the same directory. dhcp.pm set
the v6 file inside the branch that switches the v4 file to /etc/dhcp/dhcpd.conf.
openSUSE already has /etc/dhcpd.conf, so the branch never ran, $dhcp6conffile
stayed undef, and makedhcp wrote no IPv6 configuration. dhcpd6 then exited with
"No subnet6 declaration for eth1" and no node could get an IPv6 lease.
dhcp6_conf_file_for() now returns the v6 file that belongs beside a given v4
file, and the module derives it after every branch that chooses the v4 file.
xCAT-test/unit/dhcp_dhcpv6_conf_file.t fails on the openSUSE and /etc/dhcp3
layouts when the derivation is restricted to /etc/dhcp again.
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>
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>
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>
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>
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>
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_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>
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>
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>
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)
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)
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)
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)
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>
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>
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>
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>
makedhcp answers "Error: Unable to resolve the tftpserver for node" for a node
whose tftpserver or xcatmaster is an IPv6 address, and exits non-zero. Measured
on an AlmaLinux 10.2 management node with tftpserver=2001:db8:7309::1: the
DHCPv6 reservation and its bootfile-url were written correctly and makedhcp
still reported the error.
next_server_for_node reads both attributes with inet_aton, which cannot parse
an IPv6 literal, and treats the failure as a misconfiguration. An IPv6 boot
server is named in the DHCPv6 reservation rather than in a DHCPv4
next-server, so there is no DHCPv4 answer due and nothing to report. Both
branches now return without a value when the attribute is an IPv6 address.
A name that does not resolve is still reported, which is the behaviour the new
assertions would otherwise be satisfied by removing. dhcp_kea_plugin_intent.t
covers all three: removing either guard fails the matching "reports no error"
assertion, and removing the error path fails the assertion that names the
attribute.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
makedhcp -n answers "IPv6 network 2001:db8:7309:: must include a prefix length
for Kea DHCPv6" and writes no DHCPv6 config for a network whose mask column
holds /64. Measured on an AlmaLinux 10.2 management node: the network was
defined with mask=/64 and makedhcp -n exited 1, leaving /etc/kea/kea-dhcp6.conf
as the example file the Kea package ships.
kea_subnet6_intent in dhcp.pm parsed the mask itself with /^(\d+)$/, so it took
64 and refused /64. NetworkUtils::getIPv6PrefixLength already reads both
spellings, from the net value or from the mask column, and is what the rest of
the IPv6 code uses. kea_subnet6_intent now calls it, which removes the second
parse of the same field.
dhcp_kea_plugin_intent.t drives kea_subnet6_intent with both spellings and
asserts each yields the /64 subnet. Against the unfixed tree the /64 case fails
two assertions. A third assertion holds the refusal for a network that names no
prefix at all, matched on the message rather than on the error being set.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The ported branch predates the Kea control-socket detection, the iPXE netboot
method and the isValidIp validator that master now carries, so seven unit
files failed: six on the isValidIPAddress name the branch added beside
master's isValidIp, and netboot_options_ipv6.t on the netboot method list.
Every caller now uses isValidIp. netboot_options_ipv6.t no longer names a
method list: it reads the netboot value each node template ships, and asserts
that lookupNetboot offers it for that architecture and that a plugin of that
name exists. The Kea renderer loses the control_socket_name assertions, which
expected a socket basename; control_socket_path reads the real runtime
directory out of the Kea build report instead. getipaddr keeps one address per
host, so the cache assertion now states the invariant master implements: an
IPv6 cache entry is never served to an OnlyV4 caller.
kea_node_reservations resolves the next server on first use, because
next_server_for_node reports an unresolvable tftpserver and an IPv6-only node
leaves the loop before it needs one. kea_sync_node_client_classes skips an
IPv6-only node before the mac column is read, so a *NOIP* alias on such a node
no longer produces a DHCPv4 DROP class, while the same alias on an IPv4 node
still does.
network_utils_ip_validation.t is renamed networkutils_ipv6_helpers.t, one
character away from master's networkutils_ip_validation.t being too close to
tell apart.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>