xcat2 / xcat-core

Code repo for xCAT core packages
Eclipse Public License 1.0
364 stars 171 forks source link

mkdef complains with error, but it still allows the node definition to be created #3706

Open whowutwut opened 7 years ago

whowutwut commented 7 years ago

When I specify a field in mkdef that causes an error....

# mkdef cn01 groups="all,compute" ip=192.168.95.101 bmc=192.168.95.201 switch=actcon-1gb-edge switchport=1
Cannot set the 'bmc' attribute unless a value is provided for 'mgt'.
mgt => The method to use to do general hardware management of the node.  This attribute is used as the default if power or getmac is not set.  Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm.  See the power attribute for more details.
Error: Cannot set the attr='bmc' attribute unless 'mgt=openbmc'.
1 object definitions have been created or modified.

Why do we have Error, but then allow the definition to be created?

The easiest way for me to recover from this is to run the command again adding the fields that was missing.... but then that becomes a hard error...

# mkdef cn01 groups="all,compute" ip=192.168.95.101 bmc=192.168.95.201 switch=actcon-1gb-edge switchport=1 mgt=openbmc cons=openbmc
Warning: A definition for 'cn01' already exists. No changes will be made.  Run again with '-f' option to force replace.
Error: 0 object definitions have been created or modified.

Would it be better to NOT create the definition if there is an ERROR instead of partially creating it? What is the benefit in partially creating that?

immarvin commented 7 years ago

hi @chenglch , would you please take a look at this?thx