HPE OneView

HPE OneView - Remove Server via API (with force)

Go to solution
Occasional Visitor

HPE OneView - Remove Server via API (with force)

Hello Guys,

I'm trying to remove servers from an HPE OneView Instance via rest API with a forced command.

Cannot find any documentation about it as the reference guide has still not been updated for the DELETE Command as already discussed here: https://community.hpe.com/t5/hpe-oneview/delete-server-hard-via-rest-api/td-p/7044396#.X61AWpNKhTZ

Long story short: 

How can we delete servers from HPE OneView via Rest API with force: true?

curl --insecure \
--header "auth: TOKEN" \
--data '{"force":true}' \
--request DELETE https://INSTANCE/rest/server-hardware/ID

doesn't work.


Thanks for your help.


Occasional Advisor

Re: HPE OneView - Remove Server via API (with force)

The force option is a query parameter, so specify it via the URL (https://INSTANCE/rest/server-hardware/ID?force=true).

The DELETE server-hardware API for some reason wasn't documented until the 5.10 release of OneView.  And is only documented for the VM version of OneView (not Synergy where it is not allowed).

Hope that helps,


Re: HPE OneView - Remove Server via API (with force)

To add to @DaveArko , this API call is not supported with BladeSystem or Synergy.  To remove a BL or SY server/compute from the enclosure/frame, you need to physically remove it.

As for the API documentation, it was added to the 5.30 and newer API docs.  The same API call can be used for any OneView API version, as that API call has not changed since X-API-Version 1.

It is documented as DELETE /rest/server-hardware/{id}.


I am an HPE employee

Accept or Kudo

Occasional Visitor

Re: HPE OneView - Remove Server via API (with force)

Thank you Dave & Chris!

That has solved it.