xcat2 / xcat-inventory

An inventory tool for xcat cluster
8 stars 16 forks source link

Some issues with xcat-inventory importing and exporting... #96

Open whowutwut opened 6 years ago

whowutwut commented 6 years ago

Some issues seen....

I can export xcatdefaults, import and then delete

When exporting xcat-inventory export -t node it includes xcatdefults which normally does not display in lsdef -t groups After importing, I can now delete the xcatdefaults group and my postscripts are missing default postscripts

Many more objects are exported than are seen in lsdef

Somehow there is some meta data left around.

You can see this on boston01 ,, if you do xcat-inventory export -t node and compare the output with what you can see with xCAT commmands.

Disabled objects are not represented correctly

I disabled this object by doing tabedit... and set 1 at the end:

[root@boston01 ~]# tabdump nodelist | grep cn05
"mid21tor24cn05","ib0_regex","booted","04-10-2018 16:08:17",,,,,,,,"machine moved out of frame, IST borrowing","1"
[root@boston01 ~]#

But when exporting it, it shows up with obj_type: group instead of node

[root@boston01 ~]# xcat-inventory export -t node -o mid21tor24cn05 --format=yaml
node:
  mid21tor24cn05:
    device_info:
      arch: ppc64le
      characteristics: mp
      cpucount: '160'
      cputype: POWER8NVL (raw), altivec supported
      disksize: sda:932GB,sdb:932GB
      memory: 261490MB
      mtm: 8335-GTB
      serial: 2109D0A
      supportedarchs: ppc64
      uuid: 8335-gtb-2109d0a-98be9405d780
    device_type: server
    engines:
      console_engine:
        engine_info:
          consoleenabled: '1'
      netboot_engine:
        engine_info:
          chain: runcmd=bmcsetup,osimage=rhels7.5-snap2-ppc64le-ANSIBLE-netboot-compute
          osimage: rhels7.5-alt-rc2-ppc64le-netboot-compute
        engine_type: petitboot
    network_info:
      primarynic:
        mac:
        - 70:e2:84:14:0c:c9
    obj_type: group
    role: compute
schema_version: '1.0'

Then when I import, it, it shows up as a group:

[root@boston36 p8le]# lsdef -t group mid21tor24cn05
Object name: mid21tor24cn05
    arch=ppc64le
    consoleenabled=1
    cpucount=160
    cputype=POWER8NVL (raw), altivec supported
    disksize=sda:932GB,sdb:932GB
    mac=70:e2:84:14:0c:c9
    members=
    memory=261490MB
    mtm=8335-GTB
    netboot=petitboot
    nodetype=mp
    provmethod=rhels7.5-alt-rc2-ppc64le-netboot-compute
    serial=2109D0A
    supportedarchs=ppc64

[root@boston36 p8le]# nodels | grep mid21tor24cn05
[root@boston36 p8le]#
immarvin commented 6 years ago

Hi @whowutwut , I think the orphan objects are imported to be a group is a problem, I will take a look at this.

@gurevichmark opened a ticket on this before https://github.com/xcat2/xcat-inventory/issues/85

on xcatdefaults, there is a request from CORAL to make it to be a object , see https://github.com/xcat2/xcat-core/issues/1919

Disabled objects are not represented correctly, currently, xcat-inventory will not ignore the disabled entries during export, so the disabled entry in nodelist for mid21tor24cn05 will not be used to compose the object yaml during export, and the criteria to determine whether the obj_type of node object yaml is a group or node, is based on whether there is an entry in nodelist, hence it is exported as a group. will look to find any better solution for this

whowutwut commented 6 years ago

Is there a way to indicate that the object is disabled and it will be imported back as disabled also? There may be case where we want to use this as back up the database but also do not change the end result when imported...

immarvin commented 6 years ago

will consider this, the difficulty is that the disbled table entries create a partial object, how to differentiate the disabled attribute and other attributes