[nova] Spawning instance that will do PXE booting

Cedric Lemarchand yipikai7 at gmail.com
Sun Dec 12 17:38:46 UTC 2021


So I validated what from my point of view seems to be the most
"supported" way to boot an Openstack instance in PXE :

- add the flavor the extra specs "hw:boot_menu = 1" (thanks Sean)
- spawn the instance
- configure the extra_dhcp_opts of the associated port (thanks
Christian). Its not supported with the CLI, but doable with an sdk,
below a Pythonic example [1]
- reboot the instance, hit esc at the bios prompt then third choice (iPXE)

This allows the use of the Openstack DHCP and to keep port security
enabled, which is nice.

Cheers

[1]
---
conn.update_port(port_id, extra_dhcp_opts=[
    {"opt_name": "server-ip-address","opt_value": "10.0.0.15"},
    {"opt_name": "bootfile-name", "opt_value": "pxelinux.0"},
    {"opt_name": "tftp-server", "opt_value": "10.0.0.15"}
    ]
)
---

On Wed, Dec 8, 2021 at 8:52 PM Cedric Lemarchand <yipikai7 at gmail.com> wrote:
>
> Thanks for the heads up.
>
> Pointer is about ovn, I didnt find anything regarding ovs.
>
> Did the Neutron API support these options both for ovn and ovs ?
>
> On Wed, Dec 8, 2021, 17:12 Christian Rohmann <christian.rohmann at inovex.de> wrote:
>>
>> On 03/12/2021 21:01, Cedric Lemarchand wrote:
>> > We faced the same use case, and we end up doing something like this:
>> >
>> > - disable security on the network provider (or on the instance port
>> > where pxe boot is needed)
>> > - deploy or rescue the intance with an ipxe image
>> >
>>
>> As for DHCP, you can very much use the OpenStack DHCP and just set the
>> options like next-server / server-ip-address
>>
>>   *
>> https://docs.openstack.org/api-ref/network/v2/?expanded=update-port-detail#extra-dhcp-option-extra-dhcp-opt-extension
>>   * https://docs.openstack.org/neutron/latest/ovn/dhcp_opts.html
>>
>>
>> and this IP then points to your VM with the TFTP and other PXE / iPXE
>> tooling running.
>>
>>
>>
>>
>> Regards
>>
>>
>> Christian
>>



More information about the openstack-discuss mailing list