QuestionQ139
Cisco Platforms
Refer to the exhibit. Drag the code snippets from the bottom to the blanks in the code to provision a new UCS server. Not all options are used.
Drag & Drop
STATE_ERROR
STATE_FAILED
LsServerConsts
event_handle
from ucsmsdk.ucseventhandler import UcsEventHandle from ucsmsdk.mometa.ls.LsServer import end_script = False def_sp_associate_callback(mce): global end_script if mce.mo.assoc_state == LsServerConsts.ASSOC_STATE_ASSOCIATED: log.debug("SP:" + mce.mo.dn + " Assoc Successful. assoc_state: "+ mce.mo.assoc_state) elif mce.mo.assoc_state == LsServerConsts.ASSIGN_STATE_FAILED: log.error("SP:" + mce.mo.dn + "Assoc Failed. assoc_state: " + mce.mo.assoc_state) end_script = True def _sp_associate_monitor(event_handle, mo): .add(managed_object=mo, prop= "assoc_state", success_value=[LsServerConsts.ASSOC_STATE_ASSOCIATED], failure_value=[LsServerConsts.ASSOC_], timeout_sec=600, call_back=_sp_associate_callback)
Community Discussion