Skip to content

CP-312187: Allow VMs to restrict PXE boot protocols - #7318

Open
GeraldEV wants to merge 2 commits into
xapi-project:masterfrom
GeraldEV:private/geralde/CP-312187
Open

GeraldEV wants to merge 2 commits into
xapi-project:masterfrom
GeraldEV:private/geralde/CP-312187

Conversation

@GeraldEV

@GeraldEV GeraldEV commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

This PR is an updated version of #7312 where the restriction was applied at the network level, it has been changed to apply at the VM/template level.

This improvement is from a customer request to avoid network boot using disabled internet protocols specifically on UEFI VMs.
It is expected the VM sits on a single network which holds the protocol limitation but this cannot be guaranteed, so we restrict the VM which can be easily templated to apply across many VMs with finer control.

The Toolstack will populate a XenStore entry before the VM boots which the virtual firmware will read to determine if a boot device/protocol is valid.
In XenServer, the firmware will assume the protocol is enabled unless it can; access XenStore, determine the XenStore entry for the protocol exists, read the entry, confirm the entry is exactly "false".
Along with populating the default value on create/upgrade; this will ensure there is no change in behaviour until a user opts into the feature.

The code in this PR was Co-authored by claude using the Sonnet 5 model


Fresh install/upgraded:

# xe vm-list uuid=<uuid> params=all
<snip>
                 pxe-dhcp-ipv4-allowed ( RW): true
                 pxe-dhcp-ipv6-allowed ( RW): true

Changing the value:

# xe vm-param-set uuid=425c249c-7499-c59d-01c0-cd749d34fd5d pxe-dhcp-ipv6-allowed=false
# xe vm-list uuid=<uuid> params=all
<snip>
                 pxe-dhcp-ipv4-allowed ( RW): true
                 pxe-dhcp-ipv6-allowed ( RW): false

XenStore is correctly populated:

# xenstore-ls /local/domain/6/dhcp
allow-ipv4 = "true"
allow-ipv6 = "false"

GeraldEV and others added 2 commits October 6, 2026 10:03
Some networks may not provide IPv4 or IPv6 access based on hardware
configuration. A user may want to restrict IPv4 network booting to
verify an environment has moved to IPv6 only.

While this restriction exists at a network layer; it creates
complexities around determining which boot device (vif) should or
shouldn't restrict a protocol. Instead we add the restriction to the VM
(or template) itself in order to let users identify which VMs should be
restricted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@citrix.com>
Some networks may not provide IPv4 or IPv6 access based on hardware
configuration. If a user attempts to network boot it will prioritise
IPv6 before falling back to IPv4 if the IPv6 DHCP request times out.
This can create a long delay before booting successfully.

While this restriction exists at a network layer; it creates
complexities around determining which boot device (vif) should or
shouldn't restrict a protocol. Instead we add the restriction to the VM
(or template) itself in order to let users identify which VMs should be
restricted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Gerald Elder-Vass <gerald.elder-vass@citrix.com>
@GeraldEV
GeraldEV marked this pull request as ready for review October 6, 2026 15:56
@cplaursen

Copy link
Copy Markdown
Contributor

Everything looks good with the code, but I haven't been able to verify that writing those keys to xenstore will indeed disallow ipv4/ipv6 boot. Could you point me to where that is documented?

@GeraldEV

GeraldEV commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Everything looks good with the code, but I haven't been able to verify that writing those keys to xenstore will indeed disallow ipv4/ipv6 boot. Could you point me to where that is documented?

The behaviour is enforced by the firmware of the VM, for XenServer that's edk2 (OVMF)
Our current implementation is in a patch queue and not yet upstreamed, I'll send you a link to the patch and the internal docs

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants