HPE OneView
1855899 Members
7240 Online
104107 Solutions
New Discussion

Licenses

 
SOLVED
Go to solution
bradawk1
Trusted Contributor

Licenses

First, I think the words around the REST API documentation for GET /rest/licenses should make it clear that only a maximum of 50 licenses can be pulled down with each call.  That is not at all clear.  I finally got it working with:

# Make a directory to place the temporary files:
cd /data   # where ever you have space
mkdir ov-licenses
cd ov-licenses
LICFIL=licenses
curl --insecure --silent \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --output ${LICFIL} \
     --request GET ${OneView}/rest/licenses?start=0&count=-1
#
# That only pulls down 50 licenses.  Pull down the rest with:
i=1
NEXT=$(jq -r '.nextPageUri' ${LICFIL})
while [[ ${NEXT} != *"null"* ]]; do
   curl --insecure --silent \
        --header "X-API-Version: ${currentVersion}" \
        --header "auth: ${sessionID}" \
        --output ${LICFIL}${i} \
        --request GET ${OneView}${NEXT}
   NEXT=$(jq -r '.nextPageUri' ${LICFIL}${i})
   ((i++))
done
# Concantenate into a single file.
j=0
while [[ ${j} -t ${i} ]]; do
   echo ${j}
   if [[ ${j} -eq 0 ]]; then
      CMD="cat ${LICFIL}"
   else
      CMD="${CMD} ${LICFIL}${j}"
   fi
   ((j++))
done
$(echo ${CMD}) > ${LICFIL}-all-comp
#
# Process into a readable json format:
jq -r '.' ${LICFIL}-all-comp > ${LICFIL}-all
# 
# Clean up
/bin/rm ${LICFIL} $[0-9]* ${LICFIL}-all
#
LICENSES=${LICFIL}-all

Our problem is the OneView is out of licenses.  With the exported license file, I was able to find there are four licenses consumed by non-existent hardware:

jq -r '.members[] | select(.nodes[].nodeManaged == false)' ${LICENSES}

I tried to delete the identified nodeUri, but that did not work because that hardware no longer exists.  I tried to delete the license, but it said the license was in use.

How do I remove the association of these licenses to non-existent hardware?

I believe these all came about by system board replacements.

2 REPLIES 2
TKop
HPE Pro
Solution

Re: Licenses

Once a license is assigned and used by a server, it can not be unassigned.  It remains assigned even when the server is removed from the appliance.  OV ties licenses for servers to the UUID, which is composed from the serial number and product number.  During system board replacement, there are steps to reprogram the board to give it the same serial number and product number used before, so that the server identifies like it did with the original board.  Just noting and not sure what happened with your case. You would need to try a support case to get help to reclaim licenses.

RE: the count limits, there is documentation on the behavior in the common parameters section of the API reference.  Each API to date doesn't mention, as you noted.



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
bradawk1
Trusted Contributor

Re: Licenses

Thanks.  I do have a current ticket opened.  Hopefully we can work out how to retrieve those licenses.