Bug #1489

AIX not showing up on Hosts page

Added by Jon Whited almost 10 years ago. Updated over 3 years ago.

Unattended installations
Target version:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:


AIX is not showing up on the Hosts page in Foreman 0.4.1. If I look at the Facts view for this host, operatingsystem=AIX. However, I looked at the hosts table in the db and operatingsystem_id is null. Also, AIX does not
show up in the operatingsystems table in the db. yaml from facter --yaml from aix 6.1 is attached.

I have made an update to my facter to "correctly" set productname, manufacturer, serialnumber, and hardwaremodel. "Model" does show correctly on the Hosts page.

Thanks for taking a look.

aix.yaml.txt aix.yaml.txt 1.05 KB Jon Whited, 02/08/2012 02:36 PM

Related issues

Related to Foreman - Bug #799: AIX "operating system" info not appearing on "foreman/hosts" pageDuplicate2011-03-29
Related to Foreman - Feature #2445: Add OS image for AIXClosed2013-04-30
Related to Foreman - Bug #4570: AIX Operating System version is shown in a strange way.Ready For Testing

Associated revisions

Revision 7e2880b6 (diff)
Added by Ruediger Mueck about 8 years ago

fixes #1489 - add AIX family and facts importer support


#1 Updated by Jon Whited almost 10 years ago

I did what someone else perhaps has done as a good workaround -- modify the facter fact for operatingsystemrelease since foreman is expecting major.minor

I added this to operatingsystemrelease.rb before the "catch-all" entry at the end.

Facter.add(:operatingsystemrelease) do
  confine :operatingsystem => :aix
  setcode 'oslevel | cut -c1-3'

Then AIX gets added to the database and it shows up correctly on the hosts and statistics pages.

#2 Updated by Jon Whited almost 10 years ago

Actually, I also had to create app/models/aix.rb. It would not work for provisioning, but it does the job otherwise:

class AIX < Operatingsystem

  PXEFILES = {:kernel => "powerpc", :initrd => "initrd"}

  # Override the class representation, as this breaks many rails helpers
  def class

  def pxe_type

  def pxedir

  def url_for_boot(file)
    pxedir + "/" + PXEFILES[file]


#3 Updated by Ohad Levy almost 10 years ago

great job!
not 100% sure why would you need to add the Aix OS type, did you get any other errors without it?

and while we are at it, any chance you want to add an AIX icon? :)

#4 Updated by Jon Whited almost 10 years ago

Unfortunately, I'm not aware of any copyright free images for AIX. Otherwise, this is a nice one -- :)

Yes, I did get an error without it:

The single-table inheritance mechanism failed to locate the subclass: 'AIX'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Operatingsystem.inheritance_column to use another column for that information.

#5 Updated by Benjamin Papillon over 8 years ago

#6 Updated by Ruediger Mueck about 8 years ago

Because we are using AIX i also added this to operatingsystems_helper.rb (/usr/share/foreman/app/helpers)

  when /gentoo/i
  when /SLC/i
  when /AIX/i

And in manifest.yaml (/usr/share/foreman/public/assets)

AIX.png: AIX.png

#7 Updated by Ludovic Dépinoy about 8 years ago


By using Ruediger Mueck's modifications and patching /usr/share/foreman/app/services/facts_importer.rb in Foreman, AIX hosts finally show up on the hosts page. I did not want to directly patch the operatingsystemrelease fact because it would be too complicated to manage the facter package upgrade.

Here is the patch :

--- facts_importer.rb.old    2013-10-30 09:40:50.000000000 +0100
+++ facts_importer.rb    2013-10-30 09:34:50.000000000 +0100
@@ -28,6 +28,9 @@
             when /sid/i
               orel = "99" 
+        elsif os_name[/AIX/i]
+            majoraix, tlaix, spaix, yearaix = orel.split("-")
+            orel = majoraix + "." + tlaix + spaix
         major, minor = orel.split(".")
         major.to_s.gsub!(/\D/,'') unless is_numeric? major

#8 Updated by Dominic Cleal about 8 years ago

  • Description updated (diff)
  • Category set to Unattended installations
  • Status changed from New to Ready For Testing
  • Target version set to 1.9.3
  • Legacy Backlogs Release (now unused) set to 2

#9 Updated by Ruediger Mueck about 8 years ago

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

#10 Updated by Dominic Cleal almost 8 years ago

  • Related to Bug #4570: AIX Operating System version is shown in a strange way. added

Also available in: Atom PDF