Closed zeshan1977 closed 3 years ago
Hi @zeshan1977 you need to detach the server hardware from the server profile. The below example will unassign the server hardware from the server profile.
server_profile = oneview_client.server_profiles server_hardwares = oneview_client.server_hardware
server_name = 'ILO2M20050BV.XYZFIII.com'
server = server_hardwares.get_by_name(server_name)
value = {"powerState": "Off", "powerControl":"MomentaryPress"} server.patch('replace', '/powerState', value)
profile = server_profile.get_by_uri(server.data['serverProfileUri'])
detach_profile = profile.data.copy() detach_profile['serverHardwareUri'] = None detached = profile.update(detach_profile)
server = server_hardwares.get_by_name(server_name) if server.data['serverProfileUri'] == None: print("Server Profile detached successfully from the Server Hardware")
Thank You. Intimate knowlwedge of payload is neccessary. Please guide me on online docimentation so that I am able to deduce this for myself. Thanks
I have an existing server hardware and it is assigjned to a server profile. I want to "DETACH" This profile from the server hardware. I cannot find how do I do this via the API
ERROR