On 2020-07-18 20:58, Mark Post wrote:
> On 7/17/20 12:18 PM, Marcy Cortes wrote:
>> Late to the game, but I would probably make a .service file that did 
>> something like
>>
>> ExecStart= echo $(/sbin/vmcp q userid | awk '{print $3}') > /etc/vmsysname
>>
>> and then anything could look at the file.
>>
>> An LGR'd guest would be wrong, but I don't think you use that.
> 
> Would people find it helpful if a command is introduced to the
> s390-tools package that will return one or more of the following data
> points:
> 1. z/VM or KVM Guest name
> 2. z/VM Host name
> 3. KVM Host name
> 4. LPAR name
> 5. CEC name

OK, here's a shot at what this could look like:

  $ zhypinfo --help

     Usage: zhypinfo [OPTIONS]
     -j/--json   Export raw data in Json format
     -l/--layers Print number of layers
     -L/--levels Print number of virtualization levels


  $ zhypinfo
  No    Layer               Lvl  Type        Name         IFL     CP
  ------------------------------------------------------------------
  4     z/VM_Guest          1    guest       myguest        2      0
  3     z/VM_Resource_Pool  1    pool        pooltest       3      0
  2     z/VM                1    hypervisor  myzvm          8      0
  1     LPAR                0    guest       S38LP43       10      0
  0     CEC                 0    host        S38           34     10


  $ zhypinfo -l
  5


  $ zhypinfo -L
  2


  $ zhypinfo --json
  ...     # dumps out _all_ info of qclib in json format


So this would be a rather simplistic approach, but hopefully addressing most
needs - bear with me:
- the format in the table should be comprehensible
- it should also be easy enough to parse in other scripts
- the fields 'Lvl' and 'Type' would help to make things addressable:
  'No' won't help much with scripting as one cannot know e.g. whether there's a
  z/VM resource pool present or not (which would shift the index accordingly).
  However, since there is only one guest/hypervisor/pool/etc. in each
  virtualization level, the combination of these two fields makes things
  adressable.
- I was actually wondering if column 'No' should be dropped...
- the json export is the catchall: It would export _all_ data made available by
  qclib, which is substantially more than printed in the table. There's tools
  like 'jq' that allow to filter out any given piece of data from json, so it
  would serve to fulfill any needs of folks who want to process the data and
  stop short of programming against qclib proper.
- The CPU counts (IFL and CP) do not distinguish between shared and dedicated.
  It is easy to get carried away with what data we provide. I'd refer folks with
  exotic requests to the '--json' option, and only think about expanding the
  format in case some piece of info is very popular/frequently requested.

All feedback appreciated!


Mit freundlichen Grüßen / Kind regards

Stefan Raspl


Linux on Z & Virtualization Development
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland
Schoenaicher Str. 220
71032 Boeblingen
Phone: +49-7031-16-2177
E-Mail: stefan.ra...@de.ibm.com
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats:
Gregor Pillen
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB
243294

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www2.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to