forked from metal3-io/ironic-image
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds support for IPv6. When $PROVISIONING_IP is specified, which may be an IPv6 address, the various containers will wait for that IP to become available on an interface. If the IP is IPv6, then we use an IPv6-specific configurations. Note, IPv6 hosts are expected to be using UEFI boot, as we use snponly.efi. snponly.efi uses the UEFI network stack instead of the iPXE drivers. When using EDK2 OVMF + iPXE + ipxe.efi, we have seen lock-ups in initialization of the hardware devices. As neither CentOS nor RHEL distribute iPXE builds with IPv6 support, we build them from source as part of the container build.
- Loading branch information
Showing
8 changed files
with
99 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
interface=PROVISIONING_INTERFACE | ||
bind-dynamic | ||
enable-tftp | ||
tftp-root=/shared/tftpboot | ||
log-dhcp | ||
|
||
enable-ra | ||
ra-param=PROVISIONING_INTERFACE,10 | ||
|
||
dhcp-vendorclass=set:pxe6,enterprise:343,PXEClient | ||
dhcp-range=DHCP_RANGE | ||
dhcp-userclass=set:ipxe6,iPXE | ||
dhcp-option=tag:pxe6,option6:bootfile-url,tftp://IRONIC_URL_HOST/snponly.efi | ||
dhcp-option=tag:ipxe6,option6:bootfile-url,http://IRONIC_URL_HOST:HTTP_PORT/dualboot.ipxe | ||
|
||
# Disable listening for DNS | ||
port=0 | ||
|
||
# Disable default router(s) and DNS over provisioning network | ||
dhcp-option=3 | ||
dhcp-option=6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"} | ||
|
||
# Wait for the interface or IP to be up, sets $IRONIC_IP | ||
function wait_for_interface_or_ip() { | ||
# If $PROVISIONING_IP is specified, then we wait for that to become available on an interface, otherwise we look at $PROVISIONING_INTERFACE for an IP | ||
if [ ! -z "${PROVISIONING_IP}" ]; | ||
then | ||
IRONIC_IP="" | ||
until [ ! -z "${IRONIC_IP}" ]; do | ||
echo "Waiting for ${PROVISIONING_IP} to be configured on an interface" | ||
IRONIC_IP=$(ip -br addr show | grep "${PROVISIONING_IP}" | grep -Po "[^\s]+/[0-9]+" | sed -e 's%/.*%%' | head -n 1) | ||
sleep 1 | ||
done | ||
else | ||
until [ ! -z "${IRONIC_IP}" ]; do | ||
echo "Waiting for ${PROVISIONING_INTERFACE} interface to be configured" | ||
IRONIC_IP=$(ip -br addr show dev $PROVISIONING_INTERFACE | grep -Po "[^\s]+/[0-9]+" | grep -e "^fd" -e "\." | sed -e 's%/.*%%' | head -n 1) | ||
sleep 1 | ||
done | ||
fi | ||
|
||
# If the IP contains a colon, then it's an IPv6 address, and the HTTP | ||
# host needs surrounding with brackets | ||
if [[ "$IRONIC_IP" =~ .*:.* ]] | ||
then | ||
IPV=6 | ||
IRONIC_URL_HOST="[$IRONIC_IP]" | ||
else | ||
IPV=4 | ||
IRONIC_URL_HOST=$IRONIC_IP | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters