Project

General

Profile

Actions

Bug #16061

closed

automatical ip assignment not working for non-primary interfaces

Added by Klaas D over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi,
when creating a server over the api the automatical ip assignment only works for the primary interface, the other configured interfaces are being created but no ip is set.

The call from production.log:

Parameters: {"host"=>{"name"=>"server1.example.com", "location_id"=>"3", "organization_id"=>"1", "compute_resource_id"=>"2", "compute_profile_id"=>"2", "hostgroup_id"=>"6", "interfaces_attributes"=>[{"identifier"=>"eth0", "name"=>"server1", "subnet_id"=>7, "domain_id"=>2, "managed"=>true, "provision"=>true, "primary"=>true}, {"identifier"=>"eth1", "name"=>"server1i1", "subnet_id"=>4, "domain_id"=>2, "managed"=>true, "provision"=>false, "primary"=>false}, {"identifier"=>"eth2", "name"=>"server1i2", "subnet_id"=>6, "domain_id"=>2, "managed"=>true, "provision"=>false, "primary"=>false}, {"identifier"=>"eth3", "name"=>"server1i3", "subnet_id"=>5, "domain_id"=>2, "managed"=>true, "provision"=>false, "primary"=>false}], "host_parameters_attributes"=>[{"name"=>"E-Mail", "value"=>"[FILTERED]"}], "build"=>true}, "apiv"=>"v2"}

I think the set_ip_address function needs to iterate over all interfaces that are set to managed
https://github.com/theforeman/foreman/blob/develop/app/models/host/managed.rb#L630-L635

Greetings
Klaas

Actions #1

Updated by The Foreman Bot over 8 years ago

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

Updated by Anonymous over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #3

Updated by Dominic Cleal over 8 years ago

  • Assignee set to Klaas D
  • Translation missing: en.field_release set to 175
Actions

Also available in: Atom PDF