Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 response code for python api #15

Closed
ankitkr034 opened this issue Apr 17, 2018 · 4 comments
Closed

404 response code for python api #15

ankitkr034 opened this issue Apr 17, 2018 · 4 comments

Comments

@ankitkr034
Copy link

ankitkr034 commented Apr 17, 2018

url = 'https://%s/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset' % idrac_ip

payload = {'ResetType': 'ForceOff'}
headers = {'content-type': 'application/json'}
response = requests.post(url, data=json.dumps(payload), headers=headers, verify=False, auth=(idrac_username,idrac_password))
statusCode = response.status_code
print statusCode
404
quit()

I am trying to reboot the host using this however, everytime I am getting 404 response.
idrac is reachable normally from browser using same IP and access details.

Please help.

@texroemer
Copy link
Collaborator

texroemer commented Apr 17, 2018

Hi,

404 usually means Redfish support is not enabled on the iDRAC. Can you check from either RACADM or iDRAC GUI, see if Redfish is enabled on the iDRAC?

Example to check Redfish setting:

C:>racadm -r 192.168.0.120 -u root -p calvin get idrac.redfish
Security Alert: Certificate is invalid - Certificate is not signed by Trusted Third Party
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
[Key=idrac.Embedded.1#Redfish.1]
Enable=Enabled

If Redfish is enabled, can you give me the message details for the POST command? Add this line to the script to print the message details.

print(response.__dict__)

@ankitkr034
Copy link
Author

ankitkr034 commented Apr 17, 2018

racadm -r *** -u 'root' -p '*****' get idrac.redfish
Security Alert: Certificate is invalid - self signed certificate
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
ERROR: Invalid subcommand specified.

FYI idrac is : Integrated Dell Remote Access Controller 6 Version 3.65

@texroemer
Copy link
Collaborator

iDRAC 6 does not have Redfish support. You must have either have iDRAC 7/8 which is supported on 12G /13G servers or iDRAC 9 which is supported on 14G servers.

Since you can't use Redfish with your current iDRAC, i would recommend using RACADM to script the power operation. You can use "racadm serveraction" command for server power operations.

_C:>racadm -r 192.168.0.120 -u root -p calvin help serveraction
Security Alert: Certificate is invalid - Certificate is not signed by Trusted Third Party
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.

serveraction -- perform system power management operations

Usage:

racadm serveraction
racadm serveraction -f


Valid Options:

-f : Force the server power management operation.
This option is applicable only for the POWEREDGE-VRTX platform.
This option can be used with powerdown, powercycle and hardreset.
: server power management operation to perform. Must be one of:
graceshutdown : perform a graceful shutdown of server
powerdown : power server off
powerup : power server on
powercycle : perform server power cycle
hardreset : force hard server power reset
powerstatus : display current power status of server
nmi : Genarate Non-Masking Interrupt to halt system operation


Usage Examples:

  • Power down server.
    racadm serveraction powerdown

  • Get power status.
    racadm serveraction powerstatus


For help on viewing the properties of a group, run the command - racadm help get
For help on configuring the properties of a group, run the command - racadm help set


C:>_

@ankitkr034
Copy link
Author

Thanks for help.
I was expecting version issue.
I will go with ipmitool or racadm serveraction both are working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants