Bug #10993
closed
Error adding Windows host
Added by Felipe Ortega over 9 years ago.
Updated over 6 years ago.
Description
I've found several issues after adding a new Windows host to Foreman 1.8.
The Windows test client is 2003 Server, running Puppet client 3.8.1.
I've tried installing Foreman in various test environments:
OS: Debian 7.8 (minimal basic installation) + Foreman 1.7 (using foreman-installer): no problem at all
OS: Debian 7.8 (minimal basic installation) + Foreman 1.8 (using foreman-installer): host is added, but
- no "Operating system", "Environment", "Model" info is shown in "Hosts"->"All hosts" dashboard for the Windows host (see attached 'screenshot1').
- no "Properties" is shown in host's detailed page (left click on the host) (see attached 'screenshot2' and 'screenshot3').
- wrong number of "windows 5.2" hosts in "Hosts"->"Operating systems". In fact, it seems to be the number of Puppet runs in that client (if they are run in different minutes) (see attached 'screenshot4'). Also, clicking in "Hosts" column shows no hosts (see attached 'screenshot5')
OS: Debian 8.1 (minimal basic installation) + Foreman 1.8 (using foreman-installer): same issues that with Debian 7.8 + Foreman 1.8
The problem seems to be related to the way interfaces are handled in Foreman 1.8. In fact, there is an exception shown in /var/log/foreman/production.log (see attached file with the excerpt)
Files
- Category set to Importers
Hello,
I have the exactly the same bug with Foreman 1.9.2 : my Windows 2003 Server will not back properties.
Is a fix is planned ?
Thanks.
Could you please provide an output of facter --yaml from the windows host? As a workaround you can try disable interface importing by changing "Ignore Puppet facts for provisioning" setting to false. You can find it under Administer -> Settings -> Provisioning.
Thanks for the tip.
As a workaround, in /usr/share/foreman/app/models/host/base.rb:150, it is better if i change this
set_interfaces(parser) if parser.parse_interfaces?
to this
begin
set_interfaces(parser) if parser.parse_interfaces?
rescue
end
(to keep provisioning for servers where this issue does not cause problems) ?
Facter output is in attachment.
Interesting, in your case the "interfaces" fact is empty. For some reason WMI does not seems to report any interface on your host. We should be able to handle this situation but it would be interesting to find out the real cause.
The module Facter::Util::IP used by the fact interfaces use this method :
Facter::Util::IP::Windows.interfaces # line 62 in /usr/lib/ruby/vendor_ruby/facter/util/ip.rb
def self.interfaces # line 42 in /usr/lib/ruby/vendor_ruby/facter/util/ip/windows.rb
interface_names = []
network_adapter_configurations.map do |nic|
Facter::Util::WMI.execquery("SELECT * FROM Win32_NetworkAdapter WHERE Index = #{nic.Index} AND NetEnabled = TRUE").each do |nic|
interface_names << nic.NetConnectionId unless nic.NetConnectionId.nil? or nic.NetConnectionId.empty?
end
end
interface_names.uniq
end
The problem is that the WMI class Win32_NetworkAdapter doesn't provide the NetEnabled property on Windows 2003 but does on 2008/2012.
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2778 added
- Pull request deleted (
)
- Assignee set to Marek Hulán
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Translation missing: en.field_release set to 63
Also available in: Atom
PDF