1

Closed

Get-HPOVServer fails with name or URI

description

Calling Get-HPOVServer fails if you pass either a name or a URI as the name parameter. Unfortunately this also means you can't pass a server name to New-HPOVProfile, since it tries to use Get-HPOVServer -name to get the hardware type.
$name = (get-hpovserver)[0].name
Done. 16 server resource(s) found.
$uri = (get-hpovserver)[0].uri
Done. 16 server resource(s) found.
get-hpovserver -name $name
get-hpovserver : Server 'Oxygen, bay 1' not found. Please check the name again, and try again.
At line:1 char:1
  • get-hpovserver -name $name
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : ObjectNotFound: (Get-HPOVServer:String) [Get-HPOVServer], InvalidOperationException
    • FullyQualifiedErrorId : ServerHardwareResourceNotFound,Get-HPOVServer
get-hpovserver -name $uri
get-hpovserver : Server '/rest/server-hardware/30313436-3631-584D-5133-30383030324E' not found. Please check the name
again, and try again.
At line:1 char:1
  • get-hpovserver -name $uri
  • ~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : ObjectNotFound: (Get-HPOVServer:String) [Get-HPOVServer], InvalidOperationException
    • FullyQualifiedErrorId : ServerHardwareResourceNotFound,Get-HPOVServer
get-hpovserver|where{$_.name -eq $name}
type : server-hardware-3
name : Oxygen, bay 1
state : ProfileApplied
stateReason : NotApplicable
assetTag :
category : server-hardware
created : 2014-10-31T18:31:45.997Z
description :
eTag : 1414801864604
formFactor : HalfHeight
licensingIntent : OneViewNoiLO
locationUri : /rest/enclosures/09USE02429M4
memoryMb : 32768
model : ProLiant BL460c Gen8
modified : 2014-11-01T00:31:04.604Z
mpDnsName : ILOMXQ308002N
mpFirmwareVersion : 1.51 Jun 16 2014
mpIpAddress : 192.168.146.231
mpModel : iLO4
partNumber : 641016-B21
portMap : @{deviceSlots=System.Object[]} position : 1
powerLock : False
powerState : On
processorCoreCount : 8
processorCount : 2
processorSpeedMhz : 2600
processorType : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
refreshState : NotRefreshing
romVersion : I31 02/10/2014
serialNumber : MXQ308002N
serverGroupUri : /rest/enclosure-groups/057eeae1-df9e-416c-9c85-8291854a77e6
serverHardwareTypeUri : /rest/server-hardware-types/DFF2C783-AF28-4AD2-81DE-0CE4EAD9F6A0
serverProfileUri : /rest/server-profiles/bef13b3b-6680-4c61-9fed-b948118edcac
shortModel : BL460c Gen8
signature : @{serverHwChecksum=-1066265695; personalityChecksum=590265880}
status : OK
uri : /rest/server-hardware/30313436-3631-584D-5133-30383030324E
uuid : 30313436-3631-584D-5133-30383030324E
virtualSerialNumber : VCUCSL400M
virtualUuid : bef13b3b-6680-4c61-9fed-b948118edcac

Done. 16 server resource(s) found.
get-hpovserver|where{$_.uri -eq $uri}
type : server-hardware-3
name : Oxygen, bay 1
state : ProfileApplied
stateReason : NotApplicable
assetTag :
category : server-hardware
created : 2014-10-31T18:31:45.997Z
description :
eTag : 1414801864604
formFactor : HalfHeight
licensingIntent : OneViewNoiLO
locationUri : /rest/enclosures/09USE02429M4
memoryMb : 32768
model : ProLiant BL460c Gen8
modified : 2014-11-01T00:31:04.604Z
mpDnsName : ILOMXQ308002N
mpFirmwareVersion : 1.51 Jun 16 2014
mpIpAddress : 192.168.146.231
mpModel : iLO4
partNumber : 641016-B21
portMap : @{deviceSlots=System.Object[]} position : 1
powerLock : False
powerState : On
processorCoreCount : 8
processorCount : 2
processorSpeedMhz : 2600
processorType : Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
refreshState : NotRefreshing
romVersion : I31 02/10/2014
serialNumber : MXQ308002N
serverGroupUri : /rest/enclosure-groups/057eeae1-df9e-416c-9c85-8291854a77e6
serverHardwareTypeUri : /rest/server-hardware-types/DFF2C783-AF28-4AD2-81DE-0CE4EAD9F6A0
serverProfileUri : /rest/server-profiles/bef13b3b-6680-4c61-9fed-b948118edcac
shortModel : BL460c Gen8
signature : @{serverHwChecksum=-1066265695; personalityChecksum=590265880}
status : OK
uri : /rest/server-hardware/30313436-3631-584D-5133-30383030324E
uuid : 30313436-3631-584D-5133-30383030324E
virtualSerialNumber : VCUCSL400M
virtualUuid : bef13b3b-6680-4c61-9fed-b948118edcac

Done. 16 server resource(s) found.
Closed Nov 6, 2014 at 4:05 PM by ChrisLynchHP
Fixed in the 1.10.1415 release.

comments

ChrisLynchHP wrote Nov 4, 2014 at 4:53 AM

This is fixed and will be in the next release.

You can provide the Server object to New-HPOVProfile. You can either provide the server object or pipe the server object via the pipeline to New-HPOVProfile. Workaround example:
$name = "Encl1, Bay 1"
$serverProfile = (Get-HPOVServer)  | ? { $_.name -eq $name } | New-HPOVProfile <remaining_parameters>