Project

General

Profile

Actions

Bug #1489

closed

AIX not showing up on Hosts page

Added by Jon Whited about 12 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Unattended installations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

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.


Files

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

Related issues 3 (1 open2 closed)

Related to Foreman - Bug #799: AIX "operating system" info not appearing on "foreman/hosts" pageDuplicate03/29/2011Actions
Related to Foreman - Feature #2445: Add OS image for AIXClosedBryan Kearney04/30/2013Actions
Related to Foreman - Bug #4570: AIX Operating System version is shown in a strange way.Ready For TestingJosh BairdActions
Actions #1

Updated by Jon Whited about 12 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'
end

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

Actions #2

Updated by Jon Whited about 12 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
    Operatingsystem
  end

  def pxe_type
    "nim" 
  end

  def pxedir
    "boot/$arch/loader" 
  end

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

end
Actions #3

Updated by Ohad Levy about 12 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? :)

Actions #4

Updated by Jon Whited about 12 years ago

Unfortunately, I'm not aware of any copyright free images for AIX. Otherwise, this is a nice one -- http://en.wikipedia.org/wiki/File:IBM-AIX_logo20080906.png :)

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.

Actions #5

Updated by Benjamin Papillon over 10 years ago

Actions #6

Updated by Ruediger Mueck over 10 years ago

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

  when /gentoo/i
      "Gentoo" 
  when /SLC/i
      "SLC" 
  when /AIX/i
      "AIX" 
    else

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

---
AIX.png: AIX.png

Actions #7

Updated by Ludovic Dépinoy over 10 years ago

Hi,

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" 
           end
+        elsif os_name[/AIX/i]
+            majoraix, tlaix, spaix, yearaix = orel.split("-")
+            orel = majoraix + "." + tlaix + spaix
         end
         major, minor = orel.split(".")
         major.to_s.gsub!(/\D/,'') unless is_numeric? major
Actions #8

Updated by Dominic Cleal over 10 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
  • translation missing: en.field_release set to 2
Actions #9

Updated by Ruediger Mueck over 10 years ago

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

Updated by Dominic Cleal about 10 years ago

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

Also available in: Atom PDF