- Community Home
- >
- Software
- >
- HPE OneView
- >
- Re: Powershell create profile from template
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2017 10:36 AM - edited 08-14-2017 10:37 AM
08-14-2017 10:36 AM - edited 08-14-2017 10:37 AM
Powershell create profile from template
So not quite following the logic on the powershell wiki. Is there actually a way to create a profile from a server template? Assumed it was copy profile but that didn't work, or I did it wrong. Google fu is failing me when attempting to find a script. Any suggestions? I am on Oneview 3.1 and using PS module 300.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2017 11:07 AM
08-14-2017 11:07 AM
Re: Powershell create profile from template
First, if you are using OneView 3.1 then you should be using the 3.1 version of the PowerShell library found here:
https://github.com/HewlettPackard/POSH-HPOneView/releases/tag/v3.10.1377.2109
Secondly, if you look at the WIKI for the 3.1 version of the New-HPOVServerProfile cmdlet found here:
https://github.com/HewlettPackard/POSH-HPOneView/wiki/New-HPOVServerProfile#3.10
you will see several examples of how to use this call. Example #2 on that page shows how to create a Server Profile by providing an existing template:
-------------------------- EXAMPLE 2 --------------------------
PS C:\> $spt = Get-HPOVServerProfileTemplate -Name 'Hypervisor Cluster Node Template v1'
PS C:\> Get-HPOVServer -Name "Encl1, Bay 1" | New-HPOVServerProfile -name "Hyp-Clus-01" -ServerProfileTemplate $spt | Wait-HPOVTaskComplete
Hope this helps,
Dave
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2017 12:05 PM
08-14-2017 12:05 PM
Re: Powershell create profile from template
As I am the developer and maintainer of the PowerShell library, I wanted to make 1 slight correction:
You can use a lower Major.Minor versioned library with a newer appliance. So, using the 3.00 PowerShell library will work with a 3.10 appliance. Please know that I will only support N-2 HPE OneView appliance to PowerShell library versions, which will follows the appliance supported API versions.
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 03:12 PM
10-18-2018 03:12 PM
Re: Powershell create profile from template
Dave/Chris - I'm in a similar boat, hoping someone can help... This is a brand new OneView install (and I'm new to OV as well). I'm using OneView 4.10.01 and the 4.10 PowerShell LIbrary. Two functions don't seem to be working as expected. I've created a Server Profile Template "ACDC DL-360 Gen10", and I've added a Server Hardware with Name "ILOMXQ8340076". But when I try to create a new Server Profile for it, using the Example info in the original document and in Dave's comment above, I use this modified commandline:
$spt = Get-HPOVServerProfileTemplate -Name 'ACDC DL-360 Gen10' Get-HPOVServer -Name "ILOMXQ8340076" | New-HPOVServerProfile -name "DL360-.136" -ServerProfileTemplate $spt | Wait-HPOVTaskComplete
But I get prompted to input an AssignmentType. From what I read, the correct response here is "server", however as soon as I do that, I get the following error message:
PS C:\Users\Michael> $spt = Get-HPOVServerProfileTemplate -Name 'ACDC DL-360 Gen10' PS C:\Users\Michael> Get-HPOVServer -Name "ILOMXQ8340076" | New-HPOVServerProfile -name "DL360-.136" -ServerProfileTemplate $spt | Wait-HPOVTaskComplete cmdlet New-HPOVServerProfile at command pipeline position 2 Supply values for the following parameters: AssignmentType: server New-HPOVServerProfile : A Server resource object or name must be provided when using the "Server" AssignmentType parameter. At line:1 char:40 + ... Q8340076" | New-HPOVServerProfile -name "DL360-.136" -ServerProfileTe ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (Server:String) [New-HPOVServerProfile], ServerProfileTemplateResourceException + FullyQualifiedErrorId : NullServerNotAllowed,New-HPOVServerProfile
I'm not sure what's missing, as I'm following the example fairly closely.
I tried a second route, imported a second server, and created a Server Profile manually through the HPOV GUI. I then tried to use the Copy-HPOVServer Profile function as follows:
PS C:\Users\Michael> Copy-HPOVServerProfile -SourceName "DL360-.134" -DestinationName "DL360-.136" -assign "ILOMXQ8340076" 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-.134" -DestinationName "DL3 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Copy-HPOVProfile:String) [Copy-HPOVServerProfile], ServerProfileResourceException + FullyQualifiedErrorId : ServerHardwareTypeMismatch,Copy-HPOVServerProfile
As you can see, it's pretty simple logic, but for some reason it tells me the Hardware Type is different. This isn't the case, all the servers are identical, and are showing up in OneView that way:
PS C:\Users\Michael> get-hpovserver Name ServerName Status Power Serial Number Model ROM iLO Server Profile License ---- ---------- ------ ----- ------------- ----- --- --- -------------- ------- ILOMXQ8340076 OK Off MXQ8340076 DL360 Gen10 U32 v1.36 (02/14/2018) iLO5 1.35 No Profile OneViewNoiLO ILOMXQ834007B OK Off MXQ834007B DL360 Gen10 U32 v1.42 (06/20/2018) iLO5 1.35 DL360-.134 OneViewNoiLO ILOMXQ834007F OK Off MXQ834007F DL360 Gen10 U32 v1.36 (02/14/2018) iLO5 1.35 No Profile OneViewNoiLO
Any ideas? Are these bugs? Documentation errors? Any alternative ideas for me?
Thanks,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 03:34 PM
10-18-2018 03:34 PM
Re: Powershell create profile from template
The first issue you reported is a bug, where logic checking for -Server parameter, is flawed. To get past it, you should omit Pipeline operation at this time, and supply -Server and -AssignmentType during execution of New-HPOVServerProfile.
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 05:47 PM
10-18-2018 05:47 PM
Re: Powershell create profile from template
Thanks Chris! I was able to make it all work on one line as you suggested:
New-HPOVServerProfile -name "DL360-.133" -ServerProfileTemplate "ACDC DL-360 Gen10" -Server "ILOMXQ834007J" -AssignmentType "server"
I created a .PS1 batch file and it is adding the servers now.
Any idea why the Copy-HPOVServerProfile command didn't work?
Thanks again,
Michael