Skip to content

cannot set one-time-boot on M8 using sdk #86

@dancanran

Description

@dancanran

When Power-cycle an M8 blade for it to boot to PXE (via API), it keeps booting to HD and not to PXE.
But when doing the same manually, it is booting to PXE (therefore no network connection issue with our PXE server or a PXE server issue).

The code we are using wasn’t changed for years now and was working fine. I’m not sure if the issue we seen now is specific to M8 blades or a global issue as I’m not sure if we recently installed a UCSX blade other than M8.

The relevant code is this:

filter1 = "Name eq '" + host_location + "'"
blade_setting_mo = call_ucsx.compute_api_instance.get_compute_server_setting_list(filter=filter1)
if blade_setting_mo is not None and len(blade_setting_mo.results) > 0:
blade_setting_moid = blade_setting_mo.results[0].moid
call_ucsx.compute_server_setting.admin_power_state = "PowerCycle"
call_ucsx.compute_server_setting.one_time_boot_device = "pxe"
update_response = call_ucsx.compute_api_instance.update_compute_server_setting(blade_setting_moid, call_ucsx.compute_server_setting)
for i in update_response.server_op_status:
if 'ServerPowerCycle' in i.workflow_type:
return True

When testing it manually, I do get confirmation about the power-cycle, see here:

In [14]: update_response.server_op_status
Out[14]:
[{'WorkflowInfoMoid': '68b84ef0696f6e3301027f61',
'class_id': 'compute.ServerOpStatus',
'config_state': 'Scheduled',
'object_type': 'compute.ServerOpStatus',
'workflow_type': 'compute.ServerPowerCycle'},
{'WorkflowInfoMoid': '686a1bfb696f6e3301de7b24',
'class_id': 'compute.ServerOpStatus',
'config_state': 'Applied',
'object_type': 'compute.ServerOpStatus',
'workflow_type': 'compute.ServerHardReset'},
{'WorkflowInfoMoid': '686b9b7c696f6e33010605f2',
'class_id': 'compute.ServerOpStatus',
'config_state': 'Applied',
'object_type': 'compute.ServerOpStatus',
'workflow_type': 'compute.ServerPowerOff'},
{'WorkflowInfoMoid': '686baa1e696f6e3301087093',
'class_id': 'compute.ServerOpStatus',
'config_state': 'Failed',
'object_type': 'compute.ServerOpStatus',
'workflow_type': 'compute.ServerPowerOn'}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions