Excerpts from Nick Coghlan's message of 2014-06-27 11:38 +10:00:
Currently, doing a hardware scan on a system requires a command line
like the following:
bkr machine-test --inventory --family=RedHatEnterpriseLinux6 --arch=x86_64
--machine=<FQDN>
The "family" part may need to change when using Beaker to manage
architectures that RHEL6 doesn't support. However, due to the fact
beaker-system-scan currently still depends on smolt for some features,
using RHEL7 or Fedora instead isn't ideal if RHEL6 supports the
hardware.
In order to eventually add a "Scan this system now" button to the web
UI, and, equivalently, a simple "bkr update-inventory <FQDN>" command,
I think we may need to move the logic of choosing a preferred distro
family to run the inventory task to the main Beaker server.
Specifically, I'm thinking of a mapping of architecture -> distro
family + inventory task, with a default distro and inventory task to
use for unspecified architectures, together with a dedicated server
API *separate* from the normal job submission API, that requested an
inventory scan for a particular machine. The task of choosing which
distro to use, and which inventory task to run would then be handled
by the server.
The purpose of this would be to better enable working with
architectures that the default approach can't handle yet - standard
supported architectures would use the default of
/distribution/inventory-on-RHEL-6 (at least until we manage to remove
the dependency on smolt, then we can switch to RHEL7 by default),
while experimental architectures could use a different distro, or even
a different inventory task.
By making this admin configurable (include the default distro used),
we'd also better support instances that don't have RHEL trees loaded
at all, but only Fedora and/or CentOS.
My preferred approach for this would be:
1. First get off smolt onto lshw.
2. Ensure lshw is in the harness repos for RHEL5-7 (similarly CentOS
5-7) and Fedora, for all arches. This is (theoretically) not an issue
since lshw is quite portable. So lshw is effectively always available,
no matter what distro you are running.
3. For bkr machine-test, --arch is only relevant when you need to pick
between the 64- and 32-bit ISA. So we can just hardcode some simple
rules saying x86_64 is better than i386, ppc64 is better than ppc, s390x
is better than s390, aarch64 is better than arm(hfp).
4. Modify the distro picking logic in bkr machine-test so that if
--family is not given, we just pick the newest matching tree from *any*
family. So that effectively means RHEL7 or Fedora will be picked unless
it's an arch that doesn't have those (ia64) in which case RHEL5 will be
picked.
For (3) and (4) we just want to make sure that logic lives server-side,
as you noted, so that we can then easily implement the "Scan now" button
in the web UI using the same code.
--
Dan Callaghan <dcallagh(a)redhat.com>
Software Engineer, Hosted & Shared Services
Red Hat, Inc.