rinstall prints "Failed to run 'nodeset' against the node" while nodeset
succeeds and reports no error. xCAT::Utils::runxcmd returns $::RUNCMD_RC, and
xCAT::Utils::runcmd and the service helpers of every plugin inside the
subrequest assign to that global, so the status of the last command of the
subrequest becomes the status of the subrequest. makedhcp supplies that
command: the ISC branch restarts dhcpd6 whenever /etc/dhcp/dhcpd6.conf is
absent or foreign, which is every run of a cluster with no IPv6 network, and
the restart fails because dhcpd6 has no subnet to serve.
runxcmd_subrequest_errorcode.t holds the result of a subrequest to the
errorcode of its responses. dhcp_isc_dhcp6_restart.t holds the restart of
dhcpd6 to a run that serves an IPv6 network. The condition moves out of
dhcp.pm into xCAT::DHCP::Backend::ISC unchanged, so that a test can read it.
Against this tree the first test fails 3 of its 5 assertions and the second
fails 1 of its 4.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
ra_interface_is_served looked up the interface name literally. With
dhcpinterfaces=*, which Kea accepts, no interface was served and
makedhcp wrote no advertisement.
configure_router_advertisements returned when no IPv6 network was
left, and the Kea callers ran it only with a DHCPv6 subnet. radvd then
kept announcing the old prefix and default route.
The wildcard now serves every interface. radvd_config starts its output
with a marker line. When no IPv6 network remains and the file carries
that marker, makedhcp stops and disables radvd and removes the file.
radvd sends a router lifetime of zero when it stops. A radvd
configuration without the marker is left alone. Both Kea paths now
call configure_router_advertisements on every run.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
With mac.duid=canonical, addnode6 gave the shim to the host that
answers iPXE, so iPXE never loaded the node script. delnode6 listed
only the ipxe and genesis hosts, so makedhcp -d left <node>-firmware.
On Kea, an entry of a client that holds no address has no hostname.
After a change of netboot, no reservation of the new set matched it,
and makedhcp -d matched only the DUIDs of the current clients.
addnode6 now asks for the boot file of the client that mac.duid
selects, removes the hosts of clients the node no longer has, and
delnode6 also removes <node>-firmware. Each Kea DHCPv6 entry names its
node in user-context. upsert_reservations replaces the entries of a
node as a set, and makedhcp -d matches on that owner.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
mypostscript assigned DHCP6DUID and did not export it, so configdhcpv6duid, which runs as a
child process, never saw mac.duid and wrote the firmware DUID-UUID. The script also rejected
ll, which makedhcp accepts and selects by default on ppc64le. It read the SMBIOS UUID before
the attribute, so a missing or nil UUID ended the script although a literal DUID needs none.
And it wrote no systemd-networkd configuration for a DUID that is not a DUID-UUID.
mypostscript now exports DHCP6DUID. The script reads the attribute first, builds the DUID-LL
from the first mac.mac address for ll and for an unset value on ppc64le, reads the UUID only
for firmware and canonical, and gives systemd-networkd the type of every DUID through
DUIDType and the rest through DUIDRawData.
postscript_dhcpv6_duid.bats fails without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
_subiquity_netplan6 wrote dhcp4: false and a static address, and left accept-ra unset. A
router advertisement with the managed flag still starts DHCPv6 in systemd-networkd. The pool
address it gets has no PTR record, so xcatd refuses the completion callback and the node
boots the installer again.
The same sub filtered site.nameservers on a colon, so a resolver given as a host name was
dropped and the management node replaced it.
The netplan now carries dhcp6: false and accept-ra: false, and the resolvers come from
_ipv6_nameservers_for_node, which resolves a host name to its AAAA address as the kickstart
path already does. subiquity_ipv6_netplan.t fails without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only diskless node needs its address in a NetworkManager keyfile, because the
booted system does not repeat the DHCPv6 exchange of the initial ramdisk. This branch
writes that keyfile inside the dhclient and ifcfg handoff of
xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot, and upstream commit
1c42a2c72 deletes the whole handoff. So the branch does not merge, and the keyfile
depends on ETHX and MACX, which getdevfrommac() and the deleted derivation supplied.
The deletion is the base now. xcat_boot_netif() names the provisioning NIC from ifname=,
from netdev=, or by matching the BOOTIF MAC against /sys/class/net/<dev>/address.
xcat_persist_ipv6_boot() reads the MAC of that interface from sysfs and calls
persist_ipv6_nm_connection(). The removal of ifcfg-$ETHX is dropped: the script writes no
ifcfg file any more, so there is no competing profile to remove.
Eight checks in xCAT-test/bats/ipv6_xcatroot_el_stateless.bats run the two functions
against a scratch sysfs tree. Three mutations of the rework each turn one check red. The
checks cannot run against the unreworked file, which holds neither function, so the test
and the change are one commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The OpenEmbedded Genesis image ships one NetworkManager configuration,
10-xcat-genesis.conf, and it sets ipv6.dhcp-duid=ll. The image therefore sends
the DUID-LL of the provisioning NIC on every netboot method. makedhcp reserves
the two DUID-UUID orders that EDK2 and iPXE send, and only a DUID-LL where
mac.duid says ll, so a node with the default selector gets no answer once
Genesis runs and a node with ll leaves the firmware and iPXE unanswered. Three
programs boot one node and each sends an identifier of its own.
dhcp6_client_duid_list in xCAT-server/lib/xcat/plugins/dhcp.pm returned the two
UUID orders alone. It now derives 00:03:00:01 and the MAC, which needs no value
the node reports first, and appends it as a third client. dhcp6_node_clients is
the one place the clients of a node are selected: it drops the iPXE order where
the method does not load iPXE and keeps the DUID-LL for every method, because
Genesis runs whatever loaded it. kea_node_reservations6, the ISC hosts and the
makedhcp -d match list all read that selection, so delnode6 removes the hosts
it writes. The first client still keeps the address and the hostname.
mac.duid=ll, a literal DUID and DHCPv4 are unchanged.
Seventeen assertions in dhcp_dhcpv6_duid.t fail without the appended client.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The Ubuntu genimage enters dracut mode only when the rootimg holds
/usr/share/dracut or /usr/lib/dracut (netboot/ubuntu/genimage:791). Seven
netboot package lists hold no dracut, so genimage writes the legacy /init.
That /init waits for an "inet addr" line from ifconfig (genimage:1339) and
cuts XCATSERVER at the first colon (genimage:1348). Both steps are IPv4-only,
so an IPv6-only diskless node never boots. Ubuntu 26.04 diskless is the row
this blocks.
Add dracut and dracut-network to the 24.04 ppc64el list, its ppc64le copy,
and the five 26.04 netboot lists. Both packages are published for noble
(universe, 060+5-1ubuntu3) and resolute (main, 110-11) on amd64, ppc64el and
riscv64. dracut-network pulls iproute2 on resolute and iputils-arping on
noble, so no other entry is needed.
The new xCAT-test/unit/ubuntu_netboot_dracut_pkglists.t reads the seven lists
plus the working 24.04 x86_64 reference and asserts both entries.
profile_customization.t now expects dracut in the 26.04 riscv64 list.
Removing dracut from compute.ubuntu26.04.pkglist fails only that list's
assertion; the reference stays green.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The Subiquity autoinstall of an IPv6-only node asked netplan for DHCPv6, and
the late-command wrote the same request into the installed system. A DHCPv6
client is identified by its DUID, which the installer generates in the
initramfs, so it matched no Kea reservation and the node took an address out
of the dynamic range. That address has no PTR record, because makedns writes
PTRs from the hosts table, and xcatd identifies a client over IPv6 only by the
name its address resolves to. post.xcat then fetched a mypostscript that
getpostscript could not build, and the install stopped.
subiquity_dhcp_keys and subiquity_target_dhcp_keys in Template.pm now render
the static address of the node, through a new _subiquity_netplan6, in the shape
xcatroot writes for a diskless IPv6 node. A new subiquity_install_match
replaces the literal name: "e*" of both templates: a static address on each of
three interfaces of one bridge is a broken network, so an IPv6-only node is
matched by its MAC. Each IPv4 return keeps its former string.
casper takes no static ip6=, so the debian.pm docs say where the reserved
address comes from instead.
subiquity_ipv6_netplan.t fails 15 of 30 without this change, and
subiquity_install_match.t has no subroutine to call.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
site.nameservers holds one list for the whole cluster, and on a normal lab it
names IPv4 resolvers. _static_kickstart_network6 in Template.pm kept only the
entries that resolve to an IPv6 address, so it rendered no --nameserver at all
and the installed node had no /etc/resolv.conf. Measured on a riscv64
openEuler install. EL 10 takes the same path, and EL 8 and EL 9 now take it
too, so the number of nodes exposed grows.
_autoyast_network6 in the same file already answered this: it maps
'<xcatmaster>' through ipv6_server_for_node and falls back to the management
node when the cluster configures no IPv6 resolver. The chooser is now one sub,
_ipv6_nameservers_for_node, and both callers use it. The fallback is the
management node and not the gateway, because a gateway can be a router that
serves no DNS. A management node with no address on the network of the node
yields no resolver, rather than a guess.
template_ipv6_rendering.t asserts the rendered network line for all three
cases. Without the fallback the IPv4-resolver case fails while the configured
IPv6 resolver case and the no-address control keep passing, and
autoyast_ipv6_network.t goes red with it, which shows both callers read the
same chooser.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only EL 8 or EL 9 node presents a different DHCPv6 DUID at each boot
stage: the UEFI firmware, then iPXE, then anaconda. makedhcp reserves the
first two, so the installer takes an address from the dynamic range and every
step that reads the reserved address or its PTR record fails.
xCAT::SvrUtils::uses_static_ipv6_boot accepted the rh family only at major 10,
so Template.pm rendered "dhcp --noipv4 --ipv6=dhcp" for EL 8 and EL 9. The
floor is now 8, by operator decision of 2026-11-05.
pre.rhels8 was IPv4 only in two places. The install monitor opened an AF_INET
socket, so the node reported no status. The install server was cut out of its
URL at the first colon, which splits an IPv6 literal. Both forms come from
pre.rhels10. pre.openeuler includes pre.rhels8 whole, so this also fixes the
reported openEuler defect.
ipv6_pre_rhels8.bats and the EL 8 and EL 9 cases of template_ipv6_rendering.t
capture it. With AF_UNSPEC back to AF_INET the three IPv6 monitor cases fail
and the IPv4 one passes. Without the bracket branch the three IPv6 URL cases
fail and the four IPv4 ones pass. With the floor back at 10 the EL 8 and EL 9
rendering cases fail and the EL 10 ones pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xnba.pm started its script server at ${next-server} and replaced it only when the IPv6 lookup
answered. An IPv6 node for which this server has no facing IPv6 address therefore kept the
DHCPv4 variable, an IPv6 client resolved it to the empty string, every URL in the script lost
its host, and nodeset reported success. ipxe.pm runs the same code with SCRIPTS set to
xcat/ipxe, so netboot=ipxe took the same path.
NetworkUtils gains ipxe_script_server_for_node, which makes the decision and returns either the
server or a reason. No value serves such a node, so xnba.pm now stops with that reason instead
of writing a script that cannot work.
netboot_ipxe_method.t and secureboot_ipxe_node_shim.t replace the whole NetworkUtils module
through %INC, so the new sub is stubbed there as well; both carry IPv4 nodes, for which the real
sub answers the iPXE variable.
Restoring the old behaviour in the new sub -- keep ${next-server} when the lookup does not
answer -- fails eight of the sixteen assertions in ipxe_script_server_for_node.t and leaves the
IPv4, unknown-family and IPv6-with-an-address outcomes passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node that sends its findme request over IPv6 is never discovered. Two
steps fail.
seqdiscovery.pm reads the arp(8) table to turn the client address into a MAC
and looks that MAC up in the mac table. arp(8) prints the IPv4 table only, so
the table holds no row for the client and the plugin logs "Could not find mac
of the <address>" and returns. aaadiscovery.pm, profilednodes.pm, blade.pm and
hpblade.pm carry the same parse. All five interpolate the address into a
regular expression as well, so a dot matches any character and 192.168.201.1
matches the row of 192.168.201.120.
nodediscover.pm then opens a TCP connection to the node to send "restart",
and NetworkUtils::send_tcp_msg does the same for its callers. Both build the
socket with IO::Socket::INET, which has no AF_INET6, so the node receives
nothing and Genesis exits on DISCOVERY_TIMEOUT after 36 attempts.
NetworkUtils gains mac_from_neighbour_table, which takes the text of a
neighbour table and the address and returns the MAC; neighbour_table_text,
which reads arp(8) for IPv4 and "ip -6 neigh show" for IPv6; and
mac_of_neighbour, which joins them. The addresses are compared after both
are normalized, so 2001:db8::2 and its full form are one address. The five
plugins call mac_of_neighbour. open_tcp_socket opens the callback through
IO::Socket::INET6 when it is installed and keeps IO::Socket::INET as the
fallback, the way credentials.pm already does; nodediscover.pm and
send_tcp_msg use it.
networkutils_neighbour_mac.t and networkutils_tcp_callback_family.t fail
without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
dhcp6_bootfile_url_for_node in dhcp.pm returned nothing when the UEFI loader was not under the
tftpdir of the node, and reported nothing. The reservation was still written with its address and
its DUID, makedhcp exited 0, and the node reached a firmware timeout with no line anywhere naming
the file it had asked for. On an IPv6 cell that is the whole boot: there is no second method to
fall back to.
BootPolicy gains dhcp6_missing_loader_warning, which takes the tftpdir of the node and the loader
name and returns the sentence or nothing. dhcp6_bootfile_url_for_node reports it through the
callback, once per node per makedhcp, and then drops the boot file as before. Naming the node
matters because the path comes from noderes.tftpdir, which the reader cannot derive from the site
value.
The three assertions the previous commit added to dhcp_dhcpv6_duid.t now pass, and the nine in
dhcp_ipxe_readiness.t with them. Blanking the file check in the new sub fails five of those nine
and leaves the four controls passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An unknown client on an IPv6 provisioning network gets no network boot
script. mknb builds its list of networks from my_nets and my_hexnets, and
both skip inet6 on Linux, so nothing is written under xcat/ipxe/nets and
the client has nothing to fetch.
Where an address does reach a script it is written as
"xcatd=" . $address . ":$port". For 2001:db8:177::1 that is
xcatd=2001:db8:177::1:3001, which parses as an IPv6 literal with no port,
so Genesis contacts a different address and reports nothing. The same
concatenation builds the POWER HTTP URLs and the grub2 roots. xnba.pm and
destiny.pm already bracket an IPv6 address through
NetworkUtils::xcatd_cmdline_address and format_uri_host, so the node
files were correct and the net files were not.
NetworkUtils gains my_nets6, which returns the host's global IPv6
networks keyed the way my_nets keys its IPv4 ones, and
ipv6_network_address, which masks an address to its prefix. my_nets keeps
its IPv4-only behaviour: lsslp.pm and PPCdb.pm read its keys with
dotted-quad arithmetic, so an IPv6 key there would be a wrong answer
rather than a new one. my_hexnets keeps its own, because a hexnet is a
PXELINUX file name built from a hexadecimal IPv4 prefix and DHCPv6 has no
equivalent. mknb merges my_nets6 into the networks it writes nets/
scripts for, asks getipaddr for the IPv6 addresses of site.master as well,
and takes every xcatd= value and every HTTP authority from the two
formatting helpers.
mknb_xcatd_address.t and networkutils_my_nets6.t fail without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Two gaps in the ISC DHCPv6 path.
An IPv6 node on an ISC backend gets no resolver and no domain-search list.
addrangedetection keys %netcfgs on networks.net, which a conf may write with
no prefix length, while addnet6 names the subnet "<net>/<prefix>" from the
"ip -6 route" output. addnet6 read the domain, the nameservers and the
ddnsdomain under the long name alone, so all three were undef and the
subnet6 carried neither statement. dynamic_range_for in the same file already
fell back to the bare net, which is why the range was the only value that
survived.
And "makedhcp -d <node>" removed the DHCPv4 host alone. addnode6 creates the
DHCPv6 host as a separate omapi object on port 7912, and delnode never
touched it, so the reservation outlived the node and kept its address and its
boot file.
net_config_for does the lookup with the same fallback dynamic_range_for uses,
and addnet6 takes its values from it. isc_dhcp6_subnet_statements renders the
domain and resolver statements from that entry, so they can be read back.
delnode6 writes the removal over the open DHCPv6 session.
dhcp_isc_dhcpv6_subnet_and_delete.t captures both. Removing the fallback from
net_config_for fails its three lookup assertions and leaves the
dynamic_range_for assertion passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A diskful Ubuntu 24.04 install reaches Subiquity, runs curtin, and dies in
exclusive_open on the root partition with curtin.util.NotExclusiveError. The
console names apt-get as a user of the partition.
pre.ubuntu.subiquity starts rsyslogd inside the live installer to forward the
install log to the management node. In the 24.04 installer that process holds
11.9G of a 16G node while its message queue is empty: impstats reports
"main Q: size=0 enqueued=7 maxqsize=6" beside "maxrss=11951868", so no rsyslog
setting bounds it. rsyslogd runs in the cgroup of
snap.subiquity.subiquity-server.service, so the kernel OOM killer stops the
installer. systemd starts a second subiquity-server, and that server runs
curtin partitioning while the first server's curtin is still installing the
kernel into the target, so clear_holders cannot open the root partition.
xcat_start_installer_rsyslog starts the forwarder with systemd-run, in a
transient unit with MemoryMax=128M and MemorySwapMax=0. The kernel then kills
the forwarder alone. Where systemd-run is absent the install forwards no
syslog, because the install is worth more than its remote log.
ubuntu_subiquity_installer_syslog.bats reads the command line the routine asks
for. Dropping the two memory properties fails the limit assertions and leaves
the launcher and the no-fallback assertions green.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 2db399cd6c07e98494353c292990c150a9adce15)
makedns writes the address record of the name server itself into every zone file
it creates, and it wrote one record. The address came from
_preferred_ip_address, which returns the first IPv4 address, so a server with an
A and an AAAA in /etc/hosts published the A alone.
An IPv6-only compute node resolves that name to reach the server. With no AAAA in
the zone it gets no usable address, and behind a NAT64 translator it gets the
synthesis of the IPv4 address, which does not reach the server.
_server_ip_addresses returns every valid address, IPv4 first, and the zone writer
loops over it, taking the record type from _dns_record_type as before.
_preferred_ip_address is unchanged and still names one address for the error path.
xCAT-test/unit/ddns_server_dual_stack.t captures this. With the routine returning
the single preferred address, its first assertion fails and the other six pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only node netboots, installs and reaches the end of its installer, then
fails in any step that resolves a name. The node console reports "no search or
nameservers found in /run/net-*.conf /run/net6-*.conf". On Ubuntu this stops
subiquity in its postinstall package step, seconds after curtin finishes and
before any xCAT late command, so the node never boots from disk.
Three writers were involved, and none of them produced a resolver:
kea_subnet6_intent wrote dns-servers only when a configured nameserver resolved
to an IPv6 address. site.nameservers holds IPv4 addresses and the IPv6 network
row's nameservers column is normally empty, so the option was absent.
addnet6 wrote "nameservers <list>;", which is not an ISC dhcpd statement. RFC
3646 names the option dhcp6.name-servers. dhcpd refuses the whole file on an
unknown statement, so the only networks that could reach that line were the ones
that broke the configuration.
radvd_config emitted no RDNSS, so a node that configures itself from the router
advertisement had no second source.
dhcp6_resolvers_for_network is now the one chooser for all three. It keeps a
configured IPv6 nameserver, and otherwise falls back to the management node's
own address on that network, which is what <xcatmaster> names for IPv4. It
returns undef when the management node has no address on the network, because a
resolver that never answers costs the node a DNS timeout instead of a lease.
Measured with dig against an IPv6 cluster management node: a cluster name and an
external name both resolve over IPv6, so the fallback address answers.
xCAT-test/unit/dhcp6_resolver_fallback.t covers the chooser and all three
writers. Against the previous behaviour 12 of its 17 checks fail, and the 5 that
pass are the controls: a configured IPv6 nameserver is kept, and a management
node with no address on the network yields no resolver, no statement and no
RDNSS.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
nodehm.serialport holds a port number, so the plugin that writes the kernel
command line also names the device. anaconda.pm, debian.pm, sles.pm, destiny.pm
and mknb.pm each chose between hvc for POWER and ttyS for everything else. An
aarch64 platform presents a PL011 serial port, which Linux names ttyAMA, so an
aarch64 node was told console=ttyS0 and wrote its console to a device that is
not there. A provisioning failure on such a node leaves no console record.
Three of those sites named ttyS with no architecture test at all, so a ppc64le
node lost its console the same way in mksysclone.
The device is now chosen in one place, xCAT::ConsolePolicy, which maps the
architecture to hvc, ttysclp, ttyAMA or ttyS and builds the console arguments
from a port and an optional speed. The ten call sites call it.
_genesis_uses_power_console is removed; destiny.pm calls the module.
console_policy.t covers every architecture and the empty-port case.
anaconda_console_device.t drives mknetboot and reads the arguments out of the
command line the plugin wrote: it fails on the unfixed tree with ttyS0,115200
where ttyAMA0,115200 is expected, and the ppc64le and x86_64 cases pass either
way, so a change that renamed every device would not satisfy it.
An aarch64 platform with a 16550 instead of a PL011 is not covered, as a POWER
machine without a hypervisor console is not: the map takes one device per
architecture, which is what the two existing entries already assumed.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 1b984211212a12cd56603bdfb6fab6cecf197314)
SLOF, the open firmware of a PowerKVM guest and a PowerVM LPAR, identifies
itself with an RFC 3315 DUID-LL built from the MAC of its interface, and it
reports no UUID at all. makedhcp derives every DHCPv6 reservation from
vpd.uuid, so the reservation of a ppc64le node can never match: measured on an
IPv6-only node, SLOF sent 00:03:00:01:<mac> against the 00:04:<uuid>
reservation xCAT wrote. The node gets no reserved address and no RFC 5970
option 59, and its firmware has nothing to load.
dhcp6_client_duid now takes the MAC and the architecture. kea_duid_ll_from_mac
builds the DUID-LL from the first address of mac.mac, which is the interface
that netboots, and dhcp6_firmware_duid_is_link_layer says which architectures
send one. A ppc64le node takes the DUID-LL with no attribute set, and the
byte-order warning about vpd.uuid is not reported for it, because that firmware
does not read the value. mac.duid gains ll, which selects the DUID-LL on any
architecture. firmware and canonical are unchanged and still override.
One reservation covers the whole netboot: the grub2 ieee1275 network stack
builds its DUID from the same interface, so the loader sends what the firmware
sent. That is why no second reservation is written, unlike a chainloading UEFI
node.
dhcp_dhcpv6_duid.t gains five cases. On the unfixed tree 15 of its 195
assertions fail, cn11 with the firmware-order DUID-UUID where the DUID-LL is
expected. A mutation that gives every architecture the DUID-LL fails 42,
naming the x86_64 cases that must keep the DUID-UUID.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
On an IPv6-only x86_64 node with netboot=ipxe the firmware fetches the shim and
starts iPXE, and iPXE then prints "Nothing to boot: No such file or directory".
The node falls through to "BdsDxe: No bootable option or device was found". The
same node boots over IPv4.
A UEFI node that chainloads is two DHCPv6 clients on one NIC and they send
different DUIDs. EDK2 copies the SMBIOS UUID into its DUID-UUID in the order
SMBIOS stores it, little-endian in the first three fields from SMBIOS 2.6 on,
and iPXE converts the same bytes to RFC 4122 order first. Measured on
xcat147-cn-tmp-333 with vpd.uuid 5d2df358-d529-11f1-9757-4233c0a89316: the
firmware sends 00:04:58:f3:2d:5d:29:d5:... and iPXE sends
00:04:5d:2d:f3:58:d5:29:... kea_node_reservations6 and addnode6 write one
reservation, keyed on the DUID that mac.duid selects, so the other client
matches nothing and gets no RFC 5970 option 59. On IPv4 the reservation is
keyed on the MAC and both clients share it.
dhcp6_client_duid_list now returns every DUID the clients of a node send, and
both backends reserve for each of them when the netboot method chainloads. The
first entry keeps the address and the hostname: Kea refuses a second
reservation for one address, and _reservation_matches treats a shared hostname
as the same reservation. dhcp6_bootfile_url_for_node takes the client, because
iPXE needs the boot script of the node and not the shim again, which is the
split the DHCPv4 client classes make with the iPXE feature options.
A MAC-keyed reservation was measured and rejected. Kea 2.4.1 derived no MAC for
these clients even with mac-sources ipv6-link-local and the EUI-64 link-local
on the wire: the lease kept an empty hwaddr column and the firmware took a pool
address. ISC DHCP has no hardware-address match for DHCPv6 at all. Two
reservations for one address are refused with "There's already reservation for
this address/prefix", and one reservation cannot hold both identifiers:
"the 'hw-address' and 'duid' are mutually exclusive".
xCAT-test/unit/dhcp_dhcpv6_duid.t covers both backends. Seven of its cases fail
without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
yaboot links its configuration file to one name for each address of the node in
the mac table. The name is sprintf("%02x%02x%02x%02x", split(/\./, $ip)), and an
IPv6 address has no four octets: sprintf reads the first field as a number and
fills the rest with zeroes, so 2001:db8:156::10 gives 7d1000000. A dual-stack
node got one correct link and one link to a name no firmware requests, with no
warning. getipaddr returns the IPv6 address first on such a node, so this is
reachable without an IPv6-only network.
yaboot_config_name returns a name only for an address with four octets in range,
and the loop passes over anything else. A node that produced no name at all is
reported with what to use instead, rather than reporting success.
The error for a node with no facing address and no service node interpolated
$myname, which is declared in the branch above it and not in that one. The file
has no "use strict", so the message read ": " and the name of the management node
was lost. It now determines the name where it uses it.
This commit no longer routes the facing address by family. yaboot is reachable
only at osarch=ppc64 with RHEL earlier than 7 or SLES earlier than 11.4, and the
support matrix carries no ppc64 column, so there is no supported configuration
whose yaboot node could be IPv6-only. petitboot keeps that work, because
nodediscover selects it for PowerNV and noderes.5 documents it for bare-metal
ppc64le.
yaboot_config_name.t covers the guard. Removing it fails the four name checks and
leaves the two IPv4 checks passing, which tells the defect apart from a test that
dies.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Integration test of the 51 commits that landed on upstream master after this
branch was built. Four conflicts, all from edits to the same lines:
perl-XCAT/xCAT/BootUtils.pm: both sides add a new sub at the end of the file.
Master adds expand_node_template, this branch adds grub2_kernel_commands and
grub2_image_provides. All three are kept.
xCAT/xCAT.spec and xCATsn/xCATsn.spec: master wraps the chrony and dhcpd
requirements in a suse_version test, and its %endif lands on the line this
branch uses for radvd. The requirement stays outside the test, because an
openSUSE management node writes radvd.conf too.
xCAT-server/xCAT-server.spec: master's openSUSE requirement list is a superset
of this branch's, so master's is taken whole.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The Subiquity templates build three URLs as
"http://#XCATVAR:XCATMASTER##COLONHTTPPORT#/install/autoinst/...", and that tag
renders the bare value of the master. For an IPv6-only node that is a literal
address, so wget read the last group as a port:
wget -T 30 -O /tmp/getinstdisk http://2001:db8:147::1/install/autoinst/getinstdiskhttp://2001:db8:147::1/install/autoinst/getinstdisk: Bad port number.
The early-commands script runs under "set -eux", so that one line ended it.
subiquity reported CalledProcessError from Early/run, wrote a crash report of
kind "unknown", and stopped before curtin ran. Nothing in the installer logs
named the cause: curtin-install.log was empty, cloud-init was healthy, and the
error report that looked like the failure was the Error CONTROLLER loading its
own configuration.
Template.pm already computed $master_uri_host, bracketed for an IPv6-only
node, and used it for the SLES media URL and the repo baseurl. It is now
exposed as #MASTERURIHOST#, and the three URLs take it.
#XCATVAR:XCATMASTER# keeps the bare value where it is right: bash reads
/dev/tcp/<host>/<port> with no brackets, and the updateflag notification uses
that form.
subiquity_uri_host.t reads both templates, which are the artifact: every
http:// URL has to take the URI host, the /dev/tcp line has to keep the bare
one, and Template.pm has to substitute the tag. Restoring the bare tag in one
URL fails two checks; dropping the substitution fails the third.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Both Subiquity templates wrote "dhcp4: true" for every node, in the network
section the installer uses and in the netplan the late command writes into the
installed system. An IPv6-only node has no DHCPv4 server to answer, so netplan
brought the provisioning NIC up with no address.
Measured on an IPv6-only node: the installer fetched its autoinstall seed over
IPv6, then could not configure the interface and fell back to asking at the
console. On a serial console that waits for a keypress, so the install stopped
at the mode prompt with no sign of why. The installed system would have had no
address either, which is the defect xcatroot had for a diskless node and
cd6719946 fixed there.
#SUBIQUITYDHCP:<indent># and #SUBIQUITYTARGETDHCP# render from the address
family of the node, beside the #SUBIQUITYINSTALLNIC# and #SUBIQUITYINSTALLMAC#
tags that were already there. An IPv6-only node gets dhcp6 with dhcp4 turned
off explicitly, because netplan defaults dhcp4 to false only when nothing
names it, and the overrides follow the family in use. An IPv4 node gets what
it had, byte for byte.
$node_ipv6_only becomes 'our' so a test can set it. subvars already computes
it before these substitutions run, so nothing recomputes the lookup.
subiquity_ipv6_netplan.t covers both families and both sites, and asserts the
templates carry the tags rather than a literal. ubuntu_subiquity_installnic.t
renders the new tag and gains an IPv6 case: it runs the late command for real,
and an unrendered tag is a shell comment that swallows the redirect, so that
test would have written no file at all.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
subiquity_url_kcmdline left ip= out of the command line, on the reasoning that
casper treats an absent IPv4 half as already done. It does, and it also skips
the whole networking stage: casper calls configure_networking only inside
if [ -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]
and STATICIP comes from ip=. With no ip= the interface was never brought up,
so wget answered "Cannot assign requested address" and casper panicked with
"Unable to find a live file system on the network". The URL, the brackets and
the served ISO were all correct; nothing had an address to reach them from.
ip=off takes that branch while asking for no IPv4: configure_networking reads
ip= into IP and treats off as already done, then runs dhcpcd -6 on ip6=dhcp.
Measured on an IPv6-only node. With ip=off the console shows dhcpcd-10.0.6,
then "Trying to download and mount http://[2001:db8:147::1]:80/.../install.iso",
and the management node's access log records
2001:db8:147::1003 "GET /install/ubuntu24.04.4/x86_64/install.iso" 200 3405470119 "Wget"
the whole 3.2G ISO over IPv6, after which subiquity starts. Without ip=off the
same node fails at the wget every time.
debian_subiquity_boot_params.t asserts ip= is present. Removing it from the
command line fails that check alone.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
configure_router_advertisements took the mgtifname of every IPv6 network in
the networks table. site.dhcpinterfaces names the interfaces this server
answers on, and the advertisement ignored it, so a management node restricted
to eth1 still advertised itself on eth0. Every client on that LAN can then
select it as a router, which is what restricting the interface was meant to
prevent.
The sub now takes the interface set the DHCP configuration was built from and
skips a network whose interface is not in it. All three call sites already had
the set: the ISC path in scope, and both Kea paths as a parameter. An empty or
absent set is no restriction, so a cluster that sets no dhcpinterfaces keeps
the behaviour it had.
There are also two fixes to how radvd is started:
- The service is examined on every call rather than only when the
configuration file changed. A start that failed left the file already
correct, so every later makedhcp returned on the file alone and never tried
again while radvd stayed down. The call also moved out of the dhcpd6 restart
branch of the ISC path, which a repeat makedhcp does not enter at all.
- restartservice answers -1 when the service is not installed and the exit
status of the command otherwise. Only the -1 was reported, so a radvd that
failed to start was silent. Every nonzero result is now reported, and the
message says which of the two it was.
dhcp_dhcpv6_duid.t drives the sub directly for the service cases, because
process_request reaches it only on some paths. Dropping the interface filter
fails the check on an unserved network; restoring the early return on an
unchanged file fails the restart check and leaves the one for a service that
is already up passing; ignoring a positive exit status fails the two checks
that name it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
mknetboot read networks.gateway and passed it to dracut_static_ip6 as it
stood. '<xcatmaster>' is the common value of that column, and it reached the
kernel command line as "[<xcatmaster>]", which is not an address. A node whose
image server sits off its own link then had no route to it.
static_ip6_boot_arg resolves the gateway through ipv6_server_for_node, which
already knew the placeholder and which the AutoYaST path already used. A
gateway that does not resolve is dropped rather than written as a bad address:
an address with no route still reaches a server on the same link.
The composition is its own sub, taking its two lookups as coderefs, because
the helpers were covered while nothing connected them to the call site.
debian_static_ip6_gateway.t drives it with the real dracut_static_ip6.
Passing the gateway unresolved puts "[<xcatmaster>]" in the argument, which
two of its checks report.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
link_install_iso unlinked its destination and then created the link. copycds
can be given the ISO that is already in the install tree, or the link that a
previous run left there, and the destination is then the same file as the
source. The unlink deleted it, and the symlink that followed pointed at a path
that no longer existed. An ISO copied into /install by hand was lost, and the
tree was left with a dangling link that answers 404 to the node fetching it.
The source and the destination are now compared by device and inode before
anything is removed, which also follows the link, so a second copycds of the
same media leaves the link alone instead of recreating it.
debian_subiquity_boot_params.t covers an ISO at the destination, a link that
resolves to the media, and a different ISO that replaces the link. Without the
comparison the first case leaves a dangling link and the file is gone, which
three of the new checks report.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
configdhcpv6duid always derived the DHCPv6 client identifier from the SMBIOS
UUID in firmware byte order. makedhcp does that only when mac.duid is unset or
holds 'firmware': 'canonical' reserves the order product_uuid prints, and a
literal DUID is reserved as it stands. A node with either setting wrote an
identifier that matched no reservation, so it took a pool address and had no
boot file URL.
mypostscript.tmpl now exports the attribute as DHCP6DUID, and the postscript
reads it. 'canonical' keeps the order product_uuid printed. A literal is
written as it stands for NetworkManager, which takes a whole DUID.
systemd-networkd composes one from a named type, and only the UUID type can be
expressed that way, so a literal of another type is written for
NetworkManager alone and the reason is logged. A value that is neither keyword
nor DUID writes nothing, which is what makedhcp refuses as well.
The derived values are byte-identical to kea_duid_from_uuid for both orders.
postscript_dhcpv6_duid.bats goes from 9 checks to 16; ignoring the attribute
fails the five that name a setting and leaves the firmware default passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
_autoyast_network6 replaced '<xcatmaster>' in site.nameservers with the
gateway of the node, and fell back to the gateway when the list held no IPv6
address. '<xcatmaster>' is the management node, which runs named. The gateway
is not: a cluster whose gateway is a separate router gave every node a
resolver that answers nothing, and a cluster with no gateway gave none at all,
so the installed node resolved no hostname.
The placeholder now resolves through ipv6_server_for_node, which is what the
gateway itself already used. A value that is not an address is not written,
so an unresolvable placeholder leaves the list empty rather than putting
"<xcatmaster>" in the profile.
autoyast_ipv6_network.t gains a management node that is nobody's gateway, so
the two can be told apart, and the check that asserted the old behaviour now
asserts the new one. Restoring the gateway fails five checks and leaves the
other nineteen passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
An IPv6-only node could not install Ubuntu. subiquity_boot_params refused it,
because casper mounts the live filesystem with klibc nfsmount, which has no
IPv6: it answers "need a path" for "[2001:db8::1]:/export" and for
"2001:db8::1:/export", while an IPv4 server gets past parsing to the mount.
casper takes nfsroot= as an opaque path, so no option changes the family.
casper has a second route. do_urlmount downloads an ISO with casper's own
wget, which speaks IPv6, and loop-mounts it, and the network itself was never
the limit: init parses ip6= and configure_networking runs "dhcpcd -1KL -6" on
it. The route needs an ISO to fetch, and xCAT serves the extracted media and
kept no ISO.
copycds now passes the ISO it was given to the distribution plugin, which
links it into the install tree as install.iso. A symbolic link, because the
Ubuntu 24.04 ISO is 3.2G, and the xcat.conf xCAT ships gives /install
"Options FollowSymLinks". A block device has no path to link and passes none.
An IPv6-only node then gets "ip6=dhcp boot=casper netboot=url
url=http://[server]:port/install/<os>/<arch>/install.iso", with no nfsroot
and no toram: do_urlmount already holds the ISO in the initramfs tmpfs, so
copying the live filesystem again only doubles the memory the node needs.
That memory is the cost of the route -- 3.2G for the ISO on top of the
installer -- so a node with 4G cannot take it.
An IPv4 node is untouched and still mounts its root over NFS. A tree copied
before this change carries no ISO, so such a node is refused as before, with
a message naming install.iso and copycds.
debian_subiquity_boot_params.t goes from 17 checks to 36. Routing an IPv6-only
node back to the NFS form fails the six HTTP checks; dropping the bracketing
fails exactly the two bracketing checks; and returning success from
link_install_iso without creating the link fails the three that read the link
back, while the one that reads the return value still passes.
Not yet booted on a cluster.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
subiquity_boot_params refuses an IPv6-only node and says the live installer
"configures its network and mounts its root with klibc, which has no IPv6
support". The first half is wrong. casper reads ip6= from the kernel command
line and configures the interface with dhcpcd -6, which speaks DHCPv6:
scripts/functions runs "dhcpcd -1KL -t $ROUNDTTT -6" on the ip6= value, and
init parses ip6= at line 156. klibc ipconfig is only the IPv4 branch.
The one component with no IPv6 is klibc nfsmount, which casper uses for the
live filesystem. Measured on noble klibc-utils 2.0.13: it answers "need a
path" for "[2001:db8::1]:/export" and for "2001:db8::1:/export", while an
IPv4 server gets past parsing to the mount, and the binary carries no inet6
string against seven nfs and mount strings.
The refusal stands, because casper takes nfsroot= as an opaque path and has
no way to pass it an address family. Only its reason changes. The comment
also records the route that would close this: netboot=url fetches an ISO with
casper's own wget, which does IPv6, and that is a different provisioning
method than the extracted tree xCAT exports.
The check on the message matched /klibc/, which is the family and not the
component, so it passed for any klibc tool. It now matches /nfsmount/, and
the previous wording fails it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
yaboot links its configuration file to one name for each address of the node
in the mac table. The name is sprintf("%02x%02x%02x%02x", split(/\./, $ip)),
and an IPv6 address has no four octets: sprintf reads the first field as a
number and fills the rest with zeroes, so 2001:db8:156::10 gives 7d1000000.
A dual-stack node therefore got one correct link and one link to a name no
firmware requests, with no warning. An IPv6-only node got only the second.
yaboot_config_name returns a name only for an address with four octets in
range, and the loop passes over anything else. A node that produced no name
at all is reported with what to use instead, rather than reporting success.
The facing address was found with my_ip_facing, which resolves with inet_aton
and reports an IPv6-only node unresolvable. yaboot_facing_address asks
node_address_family first, the way grub2.pm and petitboot.pm do, and the
!myipfn! substitution goes through substitute_facing_address so a placeholder
that a port follows is bracketed.
The error for a node with no facing address and no service node interpolated
$myname, which is declared in the branch above it and not in that one. The
file has no "use strict", so the message read ": " and the name of the
management node was lost. It now determines the name where it uses it.
yaboot_ipv6.t covers both subs. Restoring the unguarded sprintf fails the
four name checks; calling my_ip_facing unconditionally fails the three family
checks. The IPv4 checks pass under both, which is what tells the two defects
apart from a test that dies.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
petitboot asks for a configuration file named after the four octets of the
IPv4 address of the node, in hexadecimal. The name is built with
sprintf("%02x%02x%02x%02x", split(/\./, $ip)), and an IPv6 address has no
four octets: sprintf reads the first field as a number and fills the rest
with zeroes, so 2001:db8:156::10 gives 7D1000000. nodeset then links the
configuration to a name no firmware requests, reports success, and the node
boots nothing.
petitboot_config_name returns the name only for an address that has four
octets in range, and nodeset reports the node instead of linking a name that
cannot work. The message says what to use: an IPv4 address on the node, or
netboot=grub2, which carries the server in the boot file URL and needs no
name of this form.
This is a refusal, not support. What name petitboot asks for over DHCPv6 is
not established here, and no cell in the lab runs petitboot, so the value
cannot be measured. An error that names the limit is what an operator can
act on; a wrong name is not.
Five checks in petitboot_ipv6.t cover it. Restoring the unguarded sprintf
fails the three IPv6 and undef checks and leaves the two IPv4 checks passing,
including the name of 192.0.2.50, which stays C0000232.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
petitboot builds the URL it fetches a kernel and an initrd from as
"$httpmethod://$installsrv:$httpport$tftpdir/", so an IPv6 install server
gives "http://2001:db8::1:80/tftpboot/...", which cannot be split into a host
and a port. The node then has no server to fetch from.
The facing address is found with my_ip_facing, which resolves with inet_aton.
An IPv6-only node is reported unresolvable, and the node gets no
configuration at all.
petitboot_boot_url builds the URL through uri_authority, which brackets an
IPv6 address. petitboot_facing_address asks the family of the node which
helper answers, the way grub2.pm does. The three !myipfn! substitutions go
through substitute_facing_address, which brackets the placeholder that a port
follows and leaves every other one bare. petitboot.pm also now loads
xCAT::NetworkUtils, which it has always used and never named.
An IPv4 node keeps the URL it had, byte for byte, including the port that the
old form always wrote.
petitboot_ipv6.t covers both. Writing "$server:$port" back in place of
uri_authority fails the two IPv6 URL checks. Calling my_ip_facing
unconditionally fails the three family checks. Neither mutation touches the
IPv4 checks, which is what separates the two defects from a test that dies.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
configure_router_advertisements writes /etc/radvd.conf and runs sysctl on the
management interface. dhcp_dhcpv6_duid.t drives makedhcp through
process_request, so the test reaches both. The suite runs as root in the
GitHub CI, where the test therefore replaces the real /etc/radvd.conf of the
runner and turns IPv6 forwarding on for its interfaces.
Where the file is not writable the warning also reaches the callback that
other checks read, so the test failed on an unprivileged host:
Structures begin differing at:
$got->[2] = 'Cannot write /etc/radvd.conf, so the IPv6 networks
announce no route: Permission denied'
$expected->[2] = Does not exist
The path is now the package variable $radvdconffile, and the sysctl call is
the sub enable_ipv6_forwarding. The test localizes both, the way it already
localizes $dhcpconffile and xCAT::Utils::restartservice.
Six checks now cover the behaviour the configuration carries: the file is
written, it names the interface of the IPv6 network, the interface sends
advertisements, the managed flag is on, the prefix is announced, and
forwarding is enabled. Removing the call from the ISC path fails exactly
those six and leaves the other 127 passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
kea_process_request has two paths. The full regeneration writes the whole
configuration, restarts the services, unlocks and returns; the incremental one
falls through to the end. The call added in the previous commit sat only on the
incremental path, so makedhcp -n, which is what configures a new cluster, wrote
no /etc/radvd.conf at all.
Measured on an IPv6-only alma10.1 management node: with radvd.conf removed,
radvd stopped and forwarding set to 0, makedhcp -n left all three unchanged.
The generator itself was correct the whole time; it was never called.
The full regeneration now configures the advertisements before it returns.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
makedhcp writes the DHCPv6 reservations and nothing announces the network. xCAT
configures no router advertisement anywhere: a fresh IPv6 provision network has
no radvd and forwarding off.
Two failures follow from that one gap. A client that follows RFC 4861 uses
DHCPv6 only when an advertisement sets the managed flag, so iPXE reported
"No configuration methods succeeded" and never sent a solicit: the DHCPv6 log
held the firmware DUID alone. And a client that does solicit gets one address
with a prefix length of 128, because the on-link prefix and the default route
come from the advertisement, not from DHCPv6.
makedhcp now writes /etc/radvd.conf for every IPv6 network in the networks
table and restarts radvd, for both the ISC and the Kea backend. The
advertisement sets the managed flag and marks the prefix on-link but not
autonomous, so the address still comes from DHCPv6, which holds the
reservations. An IPv4 cluster gets no file and no service. A management node
without radvd gets a warning naming what the nodes lose.
Measured on an IPv6-only alma10.1 node with netboot=ipxe. Without the
advertisement iPXE stopped at "No configuration methods succeeded". With it
iPXE reported "Configuring (net0 ...) ok" and
"net0: 2001:db8:149::1002/64 gw fe80::4054:ff:fec9:95d3", loaded the kernel,
and the node booted and answered ssh, xdsh and updatenode over IPv6.
Captured by xCAT-test/unit/radvd_config.t. Removing the managed flag fails the
assertion that names it; making the prefix autonomous fails the assertion that
names that.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The commit that added ipxe to the DHCPv6 gate justified it with strings found
in snponly.efi. That was not evidence that the feature is built in, and a boot
disproved it.
Measured on an IPv6-only alma10.1 node with ipxe-xcat 2.0.0: the firmware does
fetch the shim over IPv6 from the option this code sends, the shim chains to
snponly.efi, and iPXE then reports "No configuration methods succeeded" on a
network whose only DHCP server is DHCPv6. iPXE never reaches the script.
The option stays, because it is what xCAT owes a client that asks, and the node
fails at the same point without it. The comment now records what the loader
cannot do, so the next reader does not repeat the strings test.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The previous commit replaced !myipfn! with the facing address, which fixed the
kernel command line. It left the eleven other places where setstate writes
${next-server} into the script directly, among them the imgfetch lines for the
kernel and the initial ramdisk. An IPv6 node resolved those to
"http:///tftpboot/..." and had no server to fetch its kernel from.
Measured on an IPv6-only alma10.1 node: the script carried
"http://[2001:db8:149::1]:80/install/..." for the command line and
"http://${next-server}/tftpboot/.../vmlinuz" for the kernel.
The server is now computed once in setstate and used at every site, so the
whole script names one server. An IPv4 node still gets ${next-server}, which
iPXE fills from its own offer.
netboot_ipxe_method.t and secureboot_ipxe_node_shim.t load xnba.pm against a
stub of xCAT::NetworkUtils. The stub gains the two methods setstate now calls,
and both tests describe their nodes as IPv4, which keeps ${next-server}.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xnba.pm writes ${next-server} in place of !myipfn! and lets iPXE fill it from
the DHCP offer. next-server is a DHCPv4 field, so an IPv6 node resolves it to
the empty string and every URL in the script loses its host. The fallback does
not help either: my_ip_facing resolves with inet_aton, so it reports an
IPv6-only node unresolvable.
The script now carries the facing address of the management node when the node
has an IPv6 address, bracketed because the script puts it in a URL. The lookup
names the family, the way grub2.pm does. An IPv4 node keeps ${next-server}, so
nothing changes for it.
ipxe.pm runs this code with SCRIPTS and METHOD set to its own, so the change
reaches netboot=ipxe as well as netboot=xnba.
xnba.pm also calls xCAT::NetworkUtils eight times without loading it, and works
only because another module does. The use is now explicit.
Captured by xCAT-test/unit/ipxe_script_server.t. Ignoring the family fails five
of its seven assertions and leaves the two IPv4 ones passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>