openstack-resource-controller icon indicating copy to clipboard operation
openstack-resource-controller copied to clipboard

Add Port extra_dhcp_opts support

Open hjensas opened this issue 8 months ago • 1 comments

What would you like to see implemented?

I would like ORC to support setting more advanced options on Port resources, like extra_dhcp_opts.

Additional information

Background - in the future I would like to see if replacing or have k-orc as an option to Openstack Heat in https://github.com/openstack-k8s-operators/hotstack. The way Hotstack provisions OCP is utilizing Openshift's agent installer's PXE boot-assets - and as such it needs extra_dhcp_opts to be set on the port resource - example in heat:

  extra-dhcp-opts-value:
    type: OS::Heat::Value
    properties:
      type: json
      value:
        extra_dhcp_opts:
          - opt_name: "60"
            opt_value: "HTTPClient"
            ip_version: 4
          - opt_name: "67"
            opt_value:
              str_replace:
                template: http://$server_address:8081/boot-artifacts/agent.x86_64.ipxe
                params:
                  $server_address: {get_attr: [controller-machine-port, fixed_ips, 0, ip_address]}


  master0-machine-port:
    type: OS::Neutron::Port
    properties:
      network: {get_resource: machine-net}
      port_security_enabled: false
      fixed_ips:
        - ip_address: 192.168.32.10
      value_specs: {get_attr: [extra-dhcp-opts-value, value]}

Link to reference documentation

https://docs.openstack.org/api-ref/network/v2/#extra-dhcp-option-extra-dhcp-opt-extension

hjensas avatar Apr 25 '25 14:04 hjensas

This should be relatively straightforward to implement. Happy to provide guidance if you'd like to give it a shot.

mandre avatar Apr 30 '25 13:04 mandre