Project

General

Profile

Actions

Bug #105

closed

Operating Major version too short for AIX

Added by Andrew Forgue over 14 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Importers
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The major column of the operating system is too short for AIX hosts. It's character varying(5), but facter reports '6100-04-01-0944' for OS major version.

puppet1:/srv/www/apps/foreman # rake puppet:migrate:populate_hosts RAILS_ENV=production
(in /srv/www/apps/foreman)
rake aborted!
PGError: ERROR:  value too long for type character varying(5)
: INSERT INTO "operatingsystems" ("name", "created_at", "updated_at", "nameindicator", "major", "minor") VALUES(E'AIX', '2009-12-01 21:19:26.780600', '2009-12-01 21:19:26.780600', NULL, E'6100-04-01-0944', NULL) RETURNING "id" 

Related issues 2 (1 open1 closed)

Related to Foreman - Bug #799: AIX "operating system" info not appearing on "foreman/hosts" pageDuplicate03/29/2011Actions
Related to Foreman - Bug #4570: AIX Operating System version is shown in a strange way.Ready For TestingJosh BairdActions
Actions #1

Updated by Ohad Levy over 14 years ago

  • Target version set to 0.1-3
Actions #2

Updated by Ohad Levy over 14 years ago

  • Status changed from New to Need more information
  • Assignee changed from Ohad Levy to Andrew Forgue

what is an acceptable length? does this value make any sense to you or should it be ignored in AIX?

Actions #3

Updated by Andrew Forgue over 14 years ago

Hi Ohad,

The Version is broken down like this:

   6100-04-01-0944
   ^    ^   ^  ^
   |    |   |  + This is the year/week it was released, week 44 of 2009
   |    |   + Service Pack (this is SP1)
   |    + Technology Level (aka release #), in this case, TL 4
   + Major OS, in this case, this is AIX 6.1 (it'll be 5300, 5200, 5100)

IBM is a bit crazy about their versioning. Puppet reports the entire version string as major #, so maybe that should be fixed upstream in puppet?

I'd really rather have the major be "6", the minor be "1" and some other field for the TL and SP level. I don't know what that will gain me though -- I don't make decisions other than on the major and minor versions.

Actions #4

Updated by Ohad Levy over 14 years ago

Andrew Forgue wrote:

Hi Ohad,

The Version is broken down like this:
[...]

IBM is a bit crazy about their versioning. Puppet reports the entire version string as major #, so maybe that should be fixed upstream in puppet?

I'd really rather have the major be "6", the minor be "1" and some other field for the TL and SP level. I don't know what that will gain me though -- I don't make decisions other than on the major and minor versions.

so thats means that:
major = first 4 chars (or everything until the first "-")
minor = value between 2nd and 3rd "-"
?

I think that it make sense to push it to facter, but I can easily work around it for the time being

can you provide me a facts yaml file? (usually on your puppetmaster at /var/lib/puppet/yaml/facts/hostname)
another question, is this info is correct for all AIX versions? only recent ones etc?

Thanks

Actions #5

Updated by Ohad Levy over 14 years ago

  • Target version changed from 0.1-3 to 0.1-4

waiting for feedback, pushing a version for now

Actions #6

Updated by Ohad Levy over 14 years ago

  • Target version deleted (0.1-4)
Actions #7

Updated by Andrew Forgue over 14 years ago

Yes, the major is the first 4 characters, but should be converted into "v0.v2" and discard the 00 (It'll always be 00). Then the next should be the "Technology Level" and then Service pack level. I don't much care about the SP level, I don't know if there's a direct mapping to anything in the schema. There didn't seem to be.

I'll attach a YAML file in a few hours.

Actions #8

Updated by Andrew Forgue over 14 years ago

I have no YAML files, I use storeconfigs. How can I get you what you want out of that?

Actions #9

Updated by Ohad Levy over 14 years ago

Andrew Forgue wrote:

I have no YAML files, I use storeconfigs. How can I get you what you want out of that?

/var/lib/puppet/yaml/facts on your puppetmaster?

Actions #10

Updated by Andrew Forgue over 14 years ago

No, no yaml files in there.

Here's a patch to format it:

diff --git a/app/models/host.rb b/app/models/host.rb
index 3d4a407..e2415c5 100644
--- a/app/models/host.rb
+++ b/app/models/host.rb
@@ -274,7 +274,13 @@ class Host < Puppet::Rails::Host

     os_name = fv(:operatingsystem)
     if orel = fv(:lsbdistrelease) || fv(:operatingsystemrelease)
-      major, minor = orel.split(".")
+      if os_name == "AIX" 
+        ver, tl, sp, week = orel.split("-")
+        major = ver.split(//).join(".")
+        minor = [tl,sp].join(".")
+      else
+        major, minor = orel.split(".")
+      end
       self.os = Operatingsystem.find_or_create_by_name_and_major_and_minor os_name, major, minor
     end
     # again we are saving without validations as input is required (e.g. partition tables)
diff --git a/app/models/operatingsystem.rb b/app/models/operatingsystem.rb
index b9994f0..f56951f 100644
--- a/app/models/operatingsystem.rb
+++ b/app/models/operatingsystem.rb
@@ -12,7 +12,11 @@ class Operatingsystem < ActiveRecord::Base

   # The OS is usually represented as the catenation of the OS and the revision. E.G. "Solaris 10" 
   def to_label
-    "#{name} #{major}#{('.' + minor) unless minor.empty?}" 
+    if name == "AIX" 
+      "#{name} #{major}#{(" TL " + minor) unless minor.empty?}" 
+    else 
+      "#{name} #{major}#{('.' + minor) unless minor.empty?}" 
+    end
   end

   def to_s

Actions #11

Updated by Ohad Levy almost 12 years ago

Has facter been updated in the meanwhile? do we still have this issue with AIX?

thanks!

Actions #12

Updated by Benjamin Papillon over 11 years ago

Recently, I have the "chance" to get access to such a system. It seems that facter has been updated regarding this problem. Here is a small part of the result of facter 1.6.13 on AIX :

kernel => AIX
kernelmajversion => 6100
kernelrelease => 6100-06-05-1115
kernelversion => 6100
operatingsystem => AIX
operatingsystemrelease => 6100-06-05-1115
osfamily => AIX

Btw, the foreman used here in production (0.4.2) does not report the Operating system in the hosts page.

Actions #13

Updated by Benjamin Papillon almost 11 years ago

  • Status changed from Need more information to New
  • Assignee deleted (Andrew Forgue)
Actions #14

Updated by Benjamin Papillon about 10 years ago

I upgraded my facter program to the last 1.7.5. The AIX output is exactly the same as the one I posted last year.

Actions #15

Updated by Dominic Cleal about 10 years ago

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

Updated by Greg Sutcliffe about 8 years ago

  • Status changed from New to Resolved

This should no longer be an issue. In 1.11 (and probably earlier) the current code is:

elsif os_name[/AIX/i]                                               
majoraix, tlaix, spaix, _yearaix = orel.split("-")
orel = majoraix + "." + tlaix + spaix

Given an input of "6100-06-05-1115" this should split to "6100.0605" which would hit this code:

major, minor = orel.split(".")

Giving a os_major of "6100" which fits in the 5 char limit. Since the other AIX issue is tracked at #4570 I'm going to close this. Please re-open if there's anything missing.

Actions

Also available in: Atom PDF