Project

General

Profile

Actions

Bug #1845

closed

Inventory sometimes doesn't find a machine's UUID: "/dev/mem: mmap: Bad address"

Added by Jonathan CLARKE about 13 years ago. Updated about 12 years ago.

Status:
Released
Priority:
3
Category:
System techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

Sometimes, for example on EC2, we are not able to find that machine UUID, and so the report contains things like:

<MACHINEID>/dev/mem: mmap: Bad address</MACHINEID>
Actions #1

Updated by Jonathan CLARKE about 13 years ago

  • Subject changed from FusionInventory sometimes doesn't find a machine's UUID: "/dev/mem: mmap: Bad address" to Inventory sometimes doesn't find a machine's UUID: "/dev/mem: mmap: Bad address"

OK, actually the MACHINEID is not set by Fusion, but by our own promises. To get it we run "/usr/sbin/dmidecode -s system-uuid"

This command queries low-level hardware, but is not available on Xen, as documented in several places: https://bugzilla.redhat.com/show_bug.cgi?id=210295, http://forum.slicehost.com/comments.php?DiscussionID=82.

In other words, there is no machine ID on Xen guests, so we will never be able to get it!

Actions #2

Updated by Nicolas CHARLES about 13 years ago

It used to work, a long time ago...

bundle agent fusiAgent {
#...
  xen::
    "xen" 
    package_policy => "add",
    package_method => yum,
    classes => cf2_if_else("xen_installed", "cant_install_xen"),
    comment => "Installing xen package for extended data";
}

#...
bundle agent addInformationsToInventory {
#...
  xen::
    "UUID" string => execresult("/usr/bin/xenstore-read vm","noshell");
    "CFKEY" string => execresult("/bin/cat ${sys.workdir}/ppkeys/localhost.pub", "noshell");
    "USER" string => execresult("/usr/bin/whoami", "noshell");
    "usersnumber" int =>  readstringarray("userslist","/etc/passwd","#[^\n]*",":",50,4000);
    "users" slist => getindices("userslist");

  linux.!xen::
    "UUID" string => execresult("/usr/sbin/dmidecode -s system-uuid","noshell");
    "CFKEY" string => execresult("/bin/cat ${sys.workdir}/ppkeys/localhost.pub", "noshell");
    "USER" string => execresult("/usr/bin/whoami", "noshell");        
    "usersnumber" int =>  readstringarray("userslist","/etc/passwd","#[^\n]*",":",50,4000);
    "users" slist => getindices("userslist");
}

Reference : https://redmine.normation.com/projects/policy-templates/repository/revisions/bf0cc7bb79b772038d3e237b11a1df4825248755/entry/policies/initPolicies/ocsi-agent.cf

Actions #3

Updated by Jonathan CLARKE about 13 years ago

  • Target version changed from 23 to 18
Actions #4

Updated by Jonathan CLARKE about 13 years ago

  • Assignee deleted (Jonathan CLARKE)
Actions #5

Updated by François ARMAND about 13 years ago

  • Target version changed from 18 to 24
Actions #6

Updated by Jonathan CLARKE over 12 years ago

  • Assignee set to Vincent MEMBRÉ
  • Target version changed from 24 to Ideas (not version specific)

Vincent, this should interest you!

Actions #7

Updated by Vincent MEMBRÉ over 12 years ago

  • Status changed from 2 to Discussion

I'm trying to have less information for our promises and I try to get machine ID with Fusion intead (Which is in HARDWARE -> UUID)

I'm going to try an inventory on a Xen VM.

But fusion uses dmidecode to determine machine ID so i think there will be a problem too...

If fusion can't find any machine ID, there's stille some solutions, we may:

- find a way to get an ID for Xen VM and submit that to fusion (in Nicolas Charles answer : "UUID" string => execresult("/usr/bin/xenstore-read vm","noshell");)
- We could generate a random machineID ... But it will create a new entry in LDAP for each Machine inventory, which is bad ...
- We could generate a random machineID and check if the node contained is already in ldap, if not insert the machine with generated machine ID, else Use the data from LDAP (Node > container which give a machine ID) and use that machine ID instead
use a promises with "/usr/bin/xenstore-read vm" instead of "/usr/sbin/dmidecode -s system-uuid" (if it works...)

What do you think about those solutions ??

Actions #8

Updated by François ARMAND about 12 years ago

  • Target version changed from Ideas (not version specific) to 2.4.0~rc2

I change the target version of that one because actual people are actually hit by that bug, see #2898.
Perhaps it's even a little worst than what explained here, because even the VM host doesn't have a MachineID.

To answer Vincent, we have two bugs:

1/ we are not able to fullfill the "MachineId" tag for Xen VM, and we should in some way (it's that one) ;
2/ we should be able to have some criteria on a machine other than only the MachineId (or hardware/uuid) to decide if a machine in a report is a new one or is already in our database (and so the old information should be updated). That's perhaps #2898, perhaps an other bug.

Actions #9

Updated by Nicolas CHARLES about 12 years ago

  • Status changed from Discussion to Pending technical review
  • % Done changed from 0 to 100

Applied in changeset commit:150e0c728807d344379d5ed02273f479569c998e.

Actions #10

Updated by Nicolas PERRON about 12 years ago

  • Target version changed from 2.4.0~rc2 to 2.4.0~beta5
Actions #11

Updated by François ARMAND about 12 years ago

  • Assignee changed from Vincent MEMBRÉ to Nicolas CHARLES
Actions #12

Updated by François ARMAND about 12 years ago

  • Category changed from 26 to System techniques
Actions #13

Updated by Jonathan CLARKE about 12 years ago

  • Status changed from Pending technical review to Released

Looks good to me.

Actions

Also available in: Atom PDF