<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Query: OneView REST API force discover hardware server in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162592#M6989</link>
    <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your updates,&amp;nbsp;&lt;BR /&gt;I have lookup the API reference and the Links you provide, it doesn't work.&lt;BR /&gt;&lt;BR /&gt;Based on Powershell HPEOneView.600 Add-OVServer help:&lt;BR /&gt;&lt;EM&gt;-Confirm &amp;lt;SwitchParameter&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;When attempting to add a Server to the appliance, the appliance will validate the target Server is not already claimed. If it is, this parameter is used when the server has been claimed by another appliance to bypass the confirmation prompt, and force add the server resource.&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;It still doesn't work.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Add-OVServer -Hostname $IP -Confirm -LicensingIntent OneView -Password $passwd -Username $user&lt;/STRONG&gt;&lt;BR /&gt;Add-OVServer : "The server hardware has already been added as "". Release the server from its current manager and try again, or retry the&lt;BR /&gt;request using force option. If the server is orphaned, use Remove-OVServer -Force Cmdlet, and then try your add again.&lt;BR /&gt;At line:1 char:1&lt;BR /&gt;+ Add-OVServer -Hostname IP -LicensingIntent OneView -Pass ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : ResourceExists: (Hostname:String) [Add-OVServer], ServerHardwareResourceException&lt;BR /&gt;+ FullyQualifiedErrorId : ServerResourceExists,Add-OVServer&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Seven&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Mar 2022 16:15:14 GMT</pubDate>
    <dc:creator>HPESeven</dc:creator>
    <dc:date>2022-03-16T16:15:14Z</dc:date>
    <item>
      <title>OneView REST API force discover hardware server</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162585#M6985</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello Guys,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd like to know if that is possible to force discover hardware server via OneView REST API?&lt;BR /&gt;Since I have 100+ HPE servers managed by another Oneview Instance(&lt;STRONG&gt;crashed&lt;/STRONG&gt; ), I don't like to click the option "&lt;STRONG&gt;force add hardware server&lt;/STRONG&gt; " one by one when I add them into my new Instance,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Is there something like below, by adding parameters like force Ture?&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;POST https://{appl}/rest/server-hardware/discovery &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Auth: abcdefghijklmnopqrstuvwxyz012345&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;X-Api-Version: 3600&lt;BR /&gt;Content-Type: application/json&lt;BR /&gt;Accept-Language: en_US&lt;BR /&gt;{&lt;BR /&gt;"mpHostsAndRanges" : ["enc-ilo.corp.com", "172.1.1.1-172.1.1.10"],&lt;BR /&gt;"username" : "Administrator",&lt;BR /&gt;"password" : "mypassword",&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;"licensingIntent":"OneView",&lt;BR /&gt;"configurationState":"Managed",&lt;BR /&gt;&lt;STRONG&gt;"force": ture,&lt;/STRONG&gt;&lt;BR /&gt;"initialScopeUris": ["/rest/scopes/13c1606f-f1cb-473b-9c01-02e3a1a54589"]&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I very much appreciate it if there is any update, thanks in advance.&lt;BR /&gt;Best Regards&lt;BR /&gt;Seven&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;BTW the failed error logs FYI&lt;/P&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Validate server information.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;OL&gt;&lt;LI&gt;&lt;DIV&gt;Issue&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt;Server already monitored&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Server {0} cannot be added as it is already being monitored.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;Resolution&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt;Release the server from its current manager and try again, or retry the request using force option.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Mar 2022 14:57:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162585#M6985</guid>
      <dc:creator>HPESeven</dc:creator>
      <dc:date>2022-03-16T14:57:10Z</dc:date>
    </item>
    <item>
      <title>Query: OneView REST API force discover hardware server</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162590#M6988</link>
      <description>&lt;P style="margin: 0;"&gt;&lt;STRONG&gt;System recommended content:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;1. &lt;A href="https://community.hpe.com/hpeb/plugins/custom/hp/hpebresponsive/article_click_sprinklr_bot?clickData=eyJxdWVyeVBpcGVsaW5lIjoiU3ByaW5rbHItQXV0b21hdGlvbiIsImRvY3VtZW50VXJpSGFzaCI6IjBiM2JvOVZuUjF1TXJJZ3EiLCJzb3VyY2VOYW1lIjoiY2RwLWttLWRvY3VtZW50LXByby1oNC12MiIsImRvY3VtZW50VGl0bGUiOiJIUCBPbmVWaWV3IFJFU1QgQVBJIFJlZmVyZW5jZSIsImFydGljbGVDbGlja1VybCI6Imh0dHBzOi8vc3VwcG9ydC5ocGUuY29tL2hwZXNjL3B1YmxpYy9kb2NEaXNwbGF5P2RvY0lkPWMwMzk2NzE0MiIsInNlYXJjaFF1ZXJ5VWlkIjoiOGQ0YjgyY2MtMzFmNi00MjViLWFkNDYtOGY1NDcwMDQzOGYwIn0=" target="_blank" rel="noopener"&gt;HP OneView REST API Reference&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;2. &lt;A href="https://community.hpe.com/hpeb/plugins/custom/hp/hpebresponsive/article_click_sprinklr_bot?clickData=eyJxdWVyeVBpcGVsaW5lIjoiU3ByaW5rbHItQXV0b21hdGlvbiIsImRvY3VtZW50VXJpSGFzaCI6ImRWbGdkaWs2U0dCam3DsXFyIiwic291cmNlTmFtZSI6ImNkcC1rbS1kb2N1bWVudC1wcm8taDQtdjIiLCJkb2N1bWVudFRpdGxlIjoiSFBFIFN0b3JlT25jZSBSRVNUIEFQSSBhbmQgU0RLIHZlcnNpb24gMy4xOC54IFVzZXIgR3VpZGUiLCJhcnRpY2xlQ2xpY2tVcmwiOiJodHRwczovL3N1cHBvcnQuaHBlLmNvbS9ocGVzYy9wdWJsaWMvZG9jRGlzcGxheT9kb2NJZD1jMDQ2MDg5OTMiLCJzZWFyY2hRdWVyeVVpZCI6IjhkNGI4MmNjLTMxZjYtNDI1Yi1hZDQ2LThmNTQ3MDA0MzhmMCJ9" target="_blank" rel="noopener"&gt;HPE StoreOnce REST API and SDK version 3.18.x User Guide&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;Please click on "Thumbs Up/Kudo" icon to give a "Kudo".&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;Thank you for being a HPE valuable community member.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 15:57:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162590#M6988</guid>
      <dc:creator>support_s</dc:creator>
      <dc:date>2022-03-16T15:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Query: OneView REST API force discover hardware server</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162592#M6989</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your updates,&amp;nbsp;&lt;BR /&gt;I have lookup the API reference and the Links you provide, it doesn't work.&lt;BR /&gt;&lt;BR /&gt;Based on Powershell HPEOneView.600 Add-OVServer help:&lt;BR /&gt;&lt;EM&gt;-Confirm &amp;lt;SwitchParameter&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;When attempting to add a Server to the appliance, the appliance will validate the target Server is not already claimed. If it is, this parameter is used when the server has been claimed by another appliance to bypass the confirmation prompt, and force add the server resource.&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;It still doesn't work.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Add-OVServer -Hostname $IP -Confirm -LicensingIntent OneView -Password $passwd -Username $user&lt;/STRONG&gt;&lt;BR /&gt;Add-OVServer : "The server hardware has already been added as "". Release the server from its current manager and try again, or retry the&lt;BR /&gt;request using force option. If the server is orphaned, use Remove-OVServer -Force Cmdlet, and then try your add again.&lt;BR /&gt;At line:1 char:1&lt;BR /&gt;+ Add-OVServer -Hostname IP -LicensingIntent OneView -Pass ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : ResourceExists: (Hostname:String) [Add-OVServer], ServerHardwareResourceException&lt;BR /&gt;+ FullyQualifiedErrorId : ServerResourceExists,Add-OVServer&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Seven&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 16:15:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162592#M6989</guid>
      <dc:creator>HPESeven</dc:creator>
      <dc:date>2022-03-16T16:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Query: OneView REST API force discover hardware server</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162609#M6995</link>
      <description>&lt;P&gt;Your use of the Cmdlet is off.&amp;nbsp; It should be:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Add-OVServer -Hostname $IP -Confirm -LicensingIntent OneView -Password $passwd -Username $user -Confirm:$false&lt;/LI-CODE&gt;&lt;P&gt;The&lt;FONT face="courier new,courier"&gt; -Confirm&lt;/FONT&gt; switch is a common PowerShell parameter.&lt;/P&gt;&lt;P&gt;As for a native REST API call, one does not exist.&amp;nbsp; We never scoped the add host range to force claim.&amp;nbsp; This would cause severe sideaffects we didn't want customers to get themselves into.&amp;nbsp; Instead, you need to loop through a collection of iLO addresses and use the JSON &lt;FONT face="courier new,courier"&gt;force&lt;/FONT&gt; property instead.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 18:02:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162609#M6995</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2022-03-16T18:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Query: OneView REST API force discover hardware server</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162824#M7003</link>
      <description>&lt;P&gt;Hi Chris,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, much, for the REST API, refer to your recommendations, I can do it now via the&amp;nbsp;script below:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;for i in {10..100}
do
data="{ \"hostname\":\192.168.1.${i}\",\"username\":\"admin\",\"password\":\"passwd\",\"force\":true,\"licensingIntent\":\"OneView\",\"configurationState\":\"Managed\" }"
echo $data
curl -k -H "accept: application/json" -H "content-type: application/json" -d "${data}" -H "auth: $sessionID" -X POST https://{appl}/rest/server-hardware
done&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;For&amp;nbsp;&lt;SPAN&gt;the Cmdlet,&amp;nbsp; It also works&amp;nbsp; via cmd below:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;PS&amp;gt; Add-OVServer -Hostname 192.168.1.100-Password passwd -Username admin -Confirm:$true
Appliance    Name Owner         Created              Duration TaskState PercentComplete
---------    ---- -----         -------              -------- --------- ---------------
appl Add  administrator 3/21/2022 3:38:45 AM 00:00:29 Completed 100            &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Thanks again,&amp;nbsp; have a great day. &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Seven&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 02:44:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7162824#M7003</guid>
      <dc:creator>HPESeven</dc:creator>
      <dc:date>2022-03-21T02:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Query: OneView REST API force discover hardware server</title>
      <link>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7163089#M7012</link>
      <description>&lt;P&gt;Hi Seven,&lt;/P&gt;&lt;P&gt;Just a throught - an alternative to using all of the backslashes:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data="{ \"hostname\":\192.168.1.${i}\",\"username\":\"admin\",\"password\":\"passwd\",\"force\":true,\"licensingIntent\":\"OneView\",\"configurationState\":\"Managed\" }"

try:

data='{"hostname":"192.168.1.'${i}'","username":"admin","password":"passwd","force":true,"licensingIntent":"OneView","configurationState":"Managed"}'&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Mar 2022 10:11:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/oneview-rest-api-force-discover-hardware-server/m-p/7163089#M7012</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2022-03-23T10:11:26Z</dc:date>
    </item>
  </channel>
</rss>

