Project

General

Profile

Feature #25553

Neutron fixed ip support

Added by Petr Benas 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources - OpenStack
Target version:
-
Difficulty:
trivial
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When deploying a host on OpenStack with Neutron based networking, it's only possible to select networks. It would be nice to be able to specify a fixed IP as well.

fog-openstack has support for specifying a fixed address already: https://github.com/fog/fog-openstack/blob/master/lib/fog/openstack/compute/requests/create_server.rb#L50
It's not possible to use this feature right away because Foreman only expects the network ID and constructs the nic hash for fog itself https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/openstack.rb#L136

A simple backward-compatible change of the line 136 would allow user to post the whole nic hash to /api/hosts when deploying the host.

nics.map {|nic| nic.is_a?(String) ? { 'net_id' => nic } : nic }

I will create a pull request, filing this issue just to have the bug #.

Associated revisions

Revision 5064c68a (diff)
Added by Petr Benas 5 months ago

Fixes #25553 - neutron fixed IP support

Allows to post nic hash for fog-openstack when creating a host. It's
backward compatible, if a string is posted, it's transformed to a hash
like before. With this change a 'v4_fixed_ip' or 'port_id' can be
used, which enables user to select the desired IP.

https://github.com/fog/fog-openstack/blob/master/lib/\
fog/openstack/compute/requests/create_server.rb#L50

History

#1 Updated by Petr Benas 6 months ago

s/nics.map/args[:nics].map!/

#2 Updated by The Foreman Bot 6 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6282 added

#3 Updated by Lukas Zapletal 6 months ago

  • Triaged changed from No to Yes

Ahoj Petře, thanks for the patch.

#4 Updated by Tomer Brisker 5 months ago

  • Fixed in Releases 1.21.0 added

#5 Updated by Petr Benas 5 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF