Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I am using redfish to try and mount a virtual media to the iso and not sure what to do exactly and i need it so when I mount it , it then reboots into to the iso as well.

I am using python for this.

What I have tried:

def ex17_mount_virtual_media_iso(restobj, iso_url, boot_on_next_server_reset):
instances = restobj.search_for_type("Manager.")
for instance in instances:
rsp = restobj.rest_get(instance["href"])
rsp = restobj.rest_get(rsp.dict["links"]["VirtualMedia"]["href"])
for vmlink in rsp.dict["links"]["Member"]:
response = restobj.rest_get(vmlink["href"])
if response.status == 200 and "DVD" in response.dict["MediaTypes"]:
body = {"Image": iso_url}

if (iso_url is not None and \
boot_on_next_server_reset is not None):
body["Oem"] = {"Hp": {"BootOnNextServerReset": \
boot_on_next_server_reset}}
response = restobj.rest_patch(vmlink["href"], body)
restobj.error_handler(response)

This code here helps a little but i need it so when rebooting it, it reboots straight into the iso.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900