HPE OneView
1753797 Members
7004 Online
108799 Solutions
New Discussion юеВ

Re: PowerShell failure to copy a profile using cmdlet

 
ArubaGuy
Occasional Advisor

PowerShell failure to copy a profile using cmdlet

Hey all - somewhat new to scripting, general programming background but learning a lot of server-stuff in a new role. Looking for some help on what I'm doing wrong here... I have a OneView server running 4.10.01. I've added almost 50 servers into OneView using a wildcard for their IP range. I'm trying to create a Server Profile for each one. I can obviously do it manually, or I can copy an existing one 50 times... but the engineer in me wants to do it the right way. I've been playing with the HPE PowerShell Library (also v4.10) and it has a command Copy-HPOVServerProfile, but it's not working as expected.

I know I'm connected to the OneView server, and I can perform various commands like Get-HPOVServerProfile, which shows me the existing profiles: (edited for clarity)

PS C:\Users\Michael> get-hpovserverprofile

Name                       Status Compliance Template        Server Hardware Server Hardware Type Enclosure Group Affinity
----                       ------ ---------- --------        --------------- -------------------- --------------- --------
DL360-.135                 OK     Compliant  DL360 Gen10     ILOMXQ834007F   DL360 Gen10 1

So next I'm trying to copy that profile, give it a new name, and assign it to a specific server. I enter the source profile, the destination profile name that I want to create, and assign it to the ILO name for the new server, yet I get the error below:

PS C:\Users\Michael> Copy-HPOVServerProfile -SourceName "DL360-.135" -DestinationName "DL360-.131" -assign "ILOMXQ8340070"
Copy-HPOVServerProfile : The Target Server Hardware Type does not match the source Profile Server Hardware Type. Please specify a different Server Hardware Device to assign.
At line:1 char:1
+ Copy-HPOVServerProfile -SourceName "DL360-.135" -DestinationName "DL3 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Copy-HPOVProfile:String) [Copy-HPOVServerProfile], ServerProfileResourceException
    + FullyQualifiedErrorId : ServerHardwareTypeMismatch,Copy-HPOVServerProfile

Any ideas why it's saying the Server Hardware Type does not match? All of these servers are exactly the same hardware. I'm probably doing something boneheaded, but could use a pointer. Thanks!

Mike

2 REPLIES 2
ajav01
HPE Pro

Re: PowerShell failure to copy a profile using cmdlet

hi,

since you added 50 Servers, based on the configuration hardware type is created in oneview, identify the different hardware type created post adding the Servers, and create profile templete and add profile. 

regards

 


I am a HPE Employee
ArubaGuy
Occasional Advisor

Re: PowerShell failure to copy a profile using cmdlet

Thanks for the response. Can you help me understand your guidance?

since you added 50 Servers, based on the configuration hardware type is created in oneview

I did add the 50 servers, and OneView did autocreate the Server Hardware Type "DL360 Gen10 1". All 50 servers have that type.

identify the different hardware type created post adding the Servers

There is only one type, "DL360 Gen10 1", which is why I'm confused that they don't match.

create profile templete and add profile. 

I don't think I can do this until I resolve the second item above...

Thanks!

Michael