xcatroot writes the netplan of the booted system from the interface it found,
and it always wrote "dhcp4: true". An IPv6-only node has no DHCPv4 server, so it
reached its login prompt with no address: Ubuntu 24.04.5 reported
"[FAILED] Failed to start systemd-networkd-w... Wait for Network to be
Configured." and "[FAILED] Failed to start xcatpostinit.service", and the node
answered no ssh.
The address is already on the kernel command line, in the static form dracut
takes. xcat_static_ip6_fields reads it and the netplan carries the address, the
prefix and a default route through the gateway. A node whose command line holds
an IPv4 form keeps dhcp4, because the fields are read only from a bracketed
literal.
Captured by xCAT-test/bats/ipv6_xcatroot_netplan.bats. Reading the fields by
cutting on the first colon, which is what an IPv6 literal breaks, fails the
three parsing assertions and leaves the four refusals passing.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
pre.sle substitutes the install server for XCATNEXTSERVERHOOK in the media_url
that xCAT::Template writes for every install source. The substitution read
sed -e 's!XCATNEXTSERVERHOOK!'$nextserver'!', with the value unquoted, and
shopt -s nullglob is set earlier in the same script. An IPv6 server is bracketed,
so "[2001:db8::1]" is a glob that matches no file and the whole sed script word
is removed. sed then reads the profile as its script and writes nothing, so
/tmp/profile/modified.xml is empty. AutoYaST falls back to the unmodified profile
and stops on "Disk 'XCATPARTITIONHOOK' was not found", because the pre-script
also substitutes the install disk into that profile.
The substitution moves into substitute_nextserver, which quotes the value. An
IPv4 server was never affected, because it carries no bracket.
Captured by xCAT-test/bats/ipv6_pre_sle_nextserver.bats. With the quotes removed
again, assertions 9 and 10 fail and the IPv4 assertion 11 still passes.
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>
The previous commit required Socket6 and IO::Socket::INET6 on every RPM family. That
is wrong for EL and openEuler, where dnf installs a recommended package and the
existing Recommends already delivers both modules.
The gap is openSUSE only, and it has two parts. xCAT-server recommends both modules
inside a guard that names fedora, rhel and openEuler and omits suse_version, so an
openSUSE build declares neither a requires nor a recommends. perl-xCAT declares nothing
at all, although xCAT::SLP, xCAT::Client and xCAT::NetworkUtils all reach IPv6 through
these modules. A recommendation would not close it either: the openSUSE Minimal-VM
image sets solver.onlyRequires = true, so zypper installs no recommended package, which
is why xCAT already names a DHCP server directly.
Both specs now require both modules on openSUSE and recommend them on the families
whose package manager honours a weak dependency. The xCAT-server deb returns to a
Recommends.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The nextserver derivation in pre.sle and pre.sles split the URL authority at the
first colon, which splits an IPv6 literal. YaST then had no usable install source
on a SLE15 or SLES12 node installed over IPv6.
Both scripts now read the authority with the bracket-aware form pre.rhels10 already
uses, and put the brackets back when the host is an IPv6 address, because the value
goes into a media_url. A portless IPv4 URL no longer keeps its path.
Captured by xCAT-test/bats/ipv6_pre_sle_nextserver.bats, which fails 5 of its 8
assertions without this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Socket6 and IO::Socket::INET6 are absent on a Leap 15.6 management node that carries
every other xCAT dependency, so $ip6support in xCAT::SLP and $doipv6 in xCAT::IPMI
evaluate to 0. SLP discovery and IPMI over IPv6 then do nothing and report no error.
Both packages exist: perl-Socket6 and perl-IO-Socket-INET6 are in the openSUSE main
repository and in the EL appstream repository. Nothing asked for them. perl-generators
reads a use statement, and every caller uses eval { require ... }, so the EL build
derives no perl(Socket6) either. xCAT-server named the deb packages as Recommends,
which apt 3.0 solver3 drops when it cannot place them.
perl-xCAT and xCAT-server now require both modules on every RPM family, and the
xCAT-server deb moves them from Recommends to Depends.
Captured by xCAT-test/unit/ipv6_socket_modules_declared.t, which fails 16 of its 20
assertions without this change.
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>
xcatd.pm uses Date::Parse. xCAT-server relies on the automatic dependency
generator for it, and EL does emit perl(Date::Parse). openSUSE has no
perl-generators, so nothing installs perl-TimeDate and every start of xcatd ends
with "Can't locate Date/Parse.pm in @INC at xCAT/xcatd.pm line 10". systemd
retries and the service never comes up.
xCAT-server.spec now requires the perl(Date::Parse) capability where
suse_version is set.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xCAT-server requires perl-DB_File on every platform below EL10. openSUSE has no
package of that name -- it ships the module in perl-core-DB_File -- so zypper
answers "nothing provides 'perl-DB_File' needed by the to be installed
xCAT-server" and refuses to install xCAT on an openSUSE management node.
xCAT-server.spec now requires the perl(DB_File) capability where suse_version is
set, which perl-core-DB_File provides. EL9 keeps the package name EPEL
publishes, and EL10 keeps the weak requirement it has for riscv64.
xCAT-test/unit/opensuse_db_file_requires.t fails on the openSUSE assertions
without this change.
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>
post.xcat and post.xcat.ng exported XCATSERVER as "$MASTER_IP:3001".
getcredentials.awk and updateflag.awk split that value on a colon to separate the
address from the port, and an IPv6 address is full of colons, so the node could not
reach xcatd. remoteshell installed no root key and the node stopped at
installstatus postbooting.
Measured on openEuler 24.03: the node installed, booted, answered ping6 on its
reserved address, and refused xdsh with "Permission denied (publickey)" while its
status stayed postbooting.
Both scripts now build the endpoint with format_host_port, as post.xcat.rhels10
already did.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
post.xcat and post.xcat.ng built their download URLs as
"http://$MASTER_IP:${HTTPPORT}...". An IPv6 management node address already
contains colons, so the result is not a URL, curl and wget refuse it, the script
reports installstatus failed and halts with sleep infinity. The install itself has
already succeeded at that point, so the node sits in %post and xCAT records
status=failed, which reads as an install failure.
Measured on openEuler 24.03: the node took its reserved address, installed all 565
packages over IPv6, then stopped in "Running post-installation scripts".
Both scripts now carry the format_uri_host helper that post.xcat.rhels10 already
had, and build their URLs from MASTER_HTTP_HOST. The helper is a third copy because
a node has no shared shell library at the point these scripts run.
This reaches openEuler, EL 8, EL 9 and CentOS 8 through post.xcat.ng, and the
Ubuntu and SUSE post scripts through post.xcat. EL 10 was already correct.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
The IO::Socket::INET6 and Socket6 recommendations were guarded with
%if !0%{?suse_version}, which is true on EL7. EL7 carries rpm 4.11, which predates the
Recommends tag and fails to parse the spec, so the xCAT-server build breaks there. The
guard also excluded every SUSE release, while the comment beside it names EL AppStream
and openEuler as where the packages are.
The guard now names those distributions directly, in the form this file already uses at
its openssl requirement: 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?openEuler}.
Measured with rpmspec -P on a minimal spec, host macros undefined. Old guard: emitted
on rhel 7 and rhel 8, absent on suse_version 1500. New guard: absent on rhel 7, emitted
on rhel 8, rhel 10, fedora 40 and openEuler 2403, absent on suse_version 1500.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
A node with an A line and an AAAA line in /etc/hosts under one name loses one of them.
Running makehosts for a node whose hosts.ip is IPv4 left only the IPv4 line. A second
line under the same name is the only way to give a node both records through
/etc/hosts and makedns.
_host_line_index_values records node names for any line whose first field looks like an
address, IPv6 included, and addnode overwrites the first match and blanks every other
one. Driving the plugin with 192.0.2.10 node01 and 2001:db8::10 node01 returned both
line indexes for the IPv4 address, so the IPv6 line was blanked.
A node name now matches only lines of the family being written. The reason the index
records node names at all, so a node that changes address does not leave a second
entry, is unchanged and is asserted per family. An unparsable first field counts as the
same family, so a legacy entry keeps the behaviour it had.
makehosts_dual_stack.t fails 6 of its 9 assertions without the family check; the three
that pass include an unknown node matching no line.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
xcatd asks gethostbyaddr for AF_INET6 and retries with AF_INET when the first
lookup answers nothing. Both calls pass $conn->peeraddr. On a dual-stack
listener that is the 16-byte ::ffff:a.b.c.d for an IPv4 peer, and AF_INET
needs 4 bytes, so the retry is unreachable code. The install monitor then
discards the node's status update and no node reaches the booted state.
xCAT::NetworkUtils::unmap_v4mapped_addr returns the 4 IPv4 bytes of a mapped
address and returns anything else unchanged, so a real IPv6 address keeps all
16 bytes. The install monitor and the SSL listener pass the peer address
through it before the AF_INET retry.
networkutils_unmap_v4mapped.t covers both directions. Removing the mapped
branch fails only the mapped assertion; returning substr for every 16-byte
address fails only the two IPv6 assertions.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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)