Capturing Solaris SPARC UUIDs

I am Trying to get UUID of all OS. for SunOS I am getting in output. However all other os are providing the resuls. I am using following relevance statement.

Solaris zone UUID is a feature that is only supported in Solaris v10+. WhereI we have Solaris 11, the information.

Any idea how I can get result from SunOS

As a matter of fact, yes, but in my use case I only looked into UUID IF the Serial Numbers are not there (apparently, SPARC virtualization LDOM/IODOM, etc “inherit” Serial Numbers from the hypevisor, so for those I opted to use UUID as an unique identifier). So as you can imagine it all depends on the architecture:

on X86 architecture [Relevance to check: (name of it starts with “SunOS” and architecture of it = “amd64”) of operating system]:

  • if the machine is container [Relevance to check: (exist file “/etc/zones/index” whose (exists lines whose (not (it starts with “#”) and (it as lowercase starts with (computer name as lowercase & “:”))) of it)) or (exist zone (computer name) | false)] then the info should be in this json file and just a matter of extracting it: value of key “uuid” of elements of json of file “/var/share/zones/index.json”
  • if the machine is physical [Relevance to check - pretty much if it is NOT a container] then the info should be available with default relevance inspectors: uuid of hardware but again, I didn’t really bother to look into that too much.

on SPARC architecture [Relevance to check: (name of it starts with “SunOS” and architecture of it = “sparcv9”) of operating system]:

  • if the machine is container [Relevance to check: (exist file “/etc/zones/index” whose (exists lines whose (not (it starts with “#”) and (it as lowercase starts with (computer name as lowercase & “:”))) of it)) or (exist zone (computer name) | false)] then the info should be in this json file and just a matter of extracting it: value of key “uuid” of elements of json of file "/var/share/zones/index.json"
    OLDER versions have /etc/zones/index instead of the JSON file, so might be worth taking a look at that file too
  • if the machine is physical [Relevance to check - pretty much if it is NOT a container] then the info should be available with default relevance inspectors: uuid of hardware but again, I didn’t really bother to look into that too much.
1 Like

I am just trying to get the zones and the UUID of each machines.

The above should give you what you need but can’t give you a direct solution cause it’s dependent on the environment (what machines you have; what OS; what architecture; what versions; etc) - don’t think anyone can. My suggestion is start building a solution and test the different codes - put in an analysis with each, see what works for you and then start putting the IF/Else if/else logic to combine the individual statements as needed.

1 Like