04-20-2020 11:57 AM
I'm trying to automate the assignment of the CIMC OOB mgmt interface network info (IP/GW/Mask) using ucsmsdk. It appears that the correct object is 'MgmtIf' but the properties ext_ip, ext_gw, ext_mask are all set to "access: READ_ONLY". Is there some other object that I can use to actually set these values?
04-21-2020 02:17 AM
Hi @mystique99
That should be the correct managed object indeed. Have you tried to modify it? What is the result?
I only have UCS-C managed by FIs, so I cannot really test your scenario. For me it shows mgmtIf access="unspecified".
Cheers,
Sergiu
04-22-2020 04:57 PM
>>> object = handle.query_dn("sys/chassis-1/blade-1/mgmt/if-1")
>>> print(object)
Managed Object : MgmtIf
--------------
class_id :MgmtIf
access :unspecified
admin_state :enable
aggr_port_id :0
chassis_id :1
child_action :None
discovery :absent
dn :sys/chassis-1/blade-1/mgmt/if-1
ep_dn :
ext_broadcast :0.0.0.0
ext_gw :XX.XX.4.129
ext_ip :XX.XX.4.137
ext_mask :255.255.255.128
fsm_descr :
fsm_prev :nop
fsm_progr :100
fsm_rmt_inv_err_code :none
fsm_rmt_inv_err_descr :
fsm_rmt_inv_rslt :
fsm_stage_descr :
fsm_stamp :never
fsm_status :nop
fsm_try :0
id :1
if_role :unknown
if_type :physical
instance_id :1
ip :127.5.1.1
locale :
mac :3C:51:0E:EF:2A:08
mask :0.0.0.0
name :
peer_aggr_port_id :0
peer_chassis_id :N/A
peer_dn :
peer_port_id :0
peer_slot_id :0
port_id :1
rn :if-1
sacl :None
slot_id :1
state_qual :unspecified
status :None
subject :blade
switch_id :A
transport :
type :
vnet :1
>>> object.name = 'Testing_Name'
>>> object.ext_ip = '192.168.1.111'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/ucsmsdk/ucsmo.py", line 175, in __setattr__
self.__set_prop(name, value)
File "/usr/local/lib/python3.6/site-packages/ucsmsdk/ucsmo.py", line 220, in __set_prop
raise ValueError("%s is not a read-write property." % name)
ValueError: ext_ip is not a read-write property.
04-22-2020 05:04 PM
>>> class_meta = get_meta_info( 'MgmtIf' )
>>> print (class_meta)
[AdaptorHostEthIf]
[MgmtController]
|-MgmtIf
|-DhcpAcquired
|-EventInst
|-FaultInst
|-MgmtIPv6IfConfig
| |-MgmtIPv6IfAddr
| |-EventInst
| |-FaultInst
| |-MgmtIPv6IfAddrFsm
| | |-MgmtIPv6IfAddrFsmStage
| |-MgmtIPv6IfAddrFsmTask
|-MgmtIfFsm
| |-MgmtIfFsmStage
|-MgmtIfFsmTask
ClassId MgmtIf
------- ------
xml_attribute :mgmtIf
rn :if-[id]
min_version :1.0(1e)
access :InputOutput
access_privilege :['admin']
parents :['adaptorHostEthIf', 'mgmtController']
children :['dhcpAcquired', 'eventInst', 'faultInst', 'mgmtIPv6IfConfig', 'mgmtIfFsm', 'mgmtIfFsmTask']
Property access
-------- ------
xml_attribute :access
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :None
max_length :None
pattern :None
value_set :['in-band', 'internal', 'out-of-band', 'unspecified', 'virtual']
range_val :[]
Property admin_state
-------- -----------
xml_attribute :adminState
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :None
max_length :None
pattern :None
value_set :['disable', 'enable']
range_val :[]
Property aggr_port_id
-------- ------------
xml_attribute :aggrPortId
field_type :uint
min_version :3.0(2c)
access :READ_ONLY
min_length :None
max_length :None
pattern :None
value_set :[]
range_val :[]
Property chassis_id
-------- ----------
xml_attribute :chassisId
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :None
max_length :None
pattern :None
value_set :['N/A']
range_val :['0-255']
Property child_action
-------- ------------
xml_attribute :childAction
field_type :string
min_version :1.0(1e)
access :INTERNAL
min_length :None
max_length :None
pattern :((deleteAll|ignore|deleteNonPresent),){0,2}(deleteAll|ignore|deleteNonPresent){0,1}
value_set :[]
range_val :[]
Property discovery
-------- ---------
xml_attribute :discovery
field_type :string
min_version :1.4(1i)
access :READ_ONLY
min_length :None
max_length :None
pattern :None
value_set :['absent', 'mis-connect', 'missing', 'new', 'present', 'un-initialized', 'un-supported']
range_val :[]
Property dn
-------- --
xml_attribute :dn
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :0
max_length :256
pattern :None
value_set :[]
range_val :[]
Property ep_dn
-------- -----
xml_attribute :epDn
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :0
max_length :256
pattern :None
value_set :[]
range_val :[]
Property ext_broadcast
-------- -------------
xml_attribute :extBroadcast
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :0
max_length :256
pattern :((([0-9]){1,3}\.){3}[0-9]{1,3})
value_set :[]
range_val :[]
Property ext_gw
-------- ------
xml_attribute :extGw
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :0
max_length :256
pattern :((([0-9]){1,3}\.){3}[0-9]{1,3})
value_set :[]
range_val :[]
Property ext_ip
-------- ------
xml_attribute :extIp
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :0
max_length :256
pattern :((([0-9]){1,3}\.){3}[0-9]{1,3})
value_set :[]
range_val :[]
Property ext_mask
-------- --------
xml_attribute :extMask
field_type :string
min_version :1.0(1e)
access :READ_ONLY
min_length :0
max_length :256
pattern :((([0-9]){1,3}\.){3}[0-9]{1,3})
value_set :[]
range_val :[]
...
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide