New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-HPOVServerProfile Bug #474
Comments
Hi,
You can leverage the cmdlet Send-HPOVRequest to get inot the object and
select its attribute
$OVServerProfile = get-hpovserverprofile -name $OVname
$sptUri = $OVserverprofile.profileTemplateUri
$templatename = (Send-HPOVRequest -uri $sptUri).name
The Template attribute from the Get-HPOVServer is dynamically built based
on the same method for output
Hope that helps
/Dung
…On Thu, May 7, 2020 at 9:31 AM Cynomus ***@***.***> wrote:
When Retrieving data as follows:
$OVServerProfile = Get-HPOVServerProfile -ApplianceConnection
$OVConnection -Name $VMHostName
[image: image]
<https://user-images.githubusercontent.com/26909773/81318978-a3eb9780-9054-11ea-8e3b-8b1f89afc658.png>
*Where did the Template Property Go???*
NEXT:
Using the REST API to OneView or OneView Global Dashboard, We SHOULD be
able to use cmdlet generated data to retrieve the Server Profile Template,
except the returned value of $OVServerProfile.serverProfileTemplateUri is
*WRONG*
The ID returned “664feb66-21b7-43f4-87ad-d1fca89e1f27” is NOT Correct.
The Correct ID, in this instance, is actually
“6a4fa19f-a6da-454b-ab19-664947b84bfe”, as determined via the web GUI.
[image: image]
<https://user-images.githubusercontent.com/26909773/81318204-7fdb8680-9053-11ea-86bd-2a6c8fcbb6d1.png>
We had to retrieve EVERY Template and compare the template “*originalUri*”
property to the Profile “*serverProfileTemplateUri*” property to find a
match.
So while we COULD add the *Profile Template* metadata to the Server
Profile Object as a property, it should already included in the
Get-HPOVServerProfile cmdlet AND the "*.serverProfileTemplateUri*" *should
properly return the correct string*.
CommandType: Function
Name: Get-HPOVServerProfile
Version: 5.0.2341.1920
Source: HPOneView.500
PS C:> $PSVersionTable
PSVersion: 5.1.18362.752
PSEdition: Desktop
PSCompatibleVersions: {1.0, 2.0, 3.0, 4.0...}
BuildVersion: 10.0.18362.752
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#474>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGFHKHWXPHRTDZU66HWMR3RQLO6JANCNFSM4M3PGFJQ>
.
--
Dung K Hoang
|
Thanks Dung for the quick response! Yes I looked at the code for the cmdlet, and am familiar with workarounds, my intention was primarily to see the Get-HPOVServerProfile return correct results and appropriate content. Otherwise why even publish it in the module? |
In your first screenshot, "Template" is simply a column header in the default display output of Get-HPOVServerProfile, it does NOT mean it is a property of the ServerProfile object. In fact it is not, which is why your query | Select Template returns nothing. In your second screenshot, 664feb66-21b7-43f4-87ad-d1fca89e1f27 IS the correct ID for your server profile template. The other ID you mention, 6a4fa19f-a6da-454b-ab19-664947b84bfe, is the ID of the server profile, not the server profile template it is derived from. |
Apologies for being late to this conversation, I had been heads down with planning and getting the HPE OneView 5.20 library released. The # Get the profile template
$SPT = Get-HPOVServerProfileTemplate -Name MyProfile
# Now, get associated profiles from the template
Get-HPOVServerProfile -InputObject $SPT |
Closing due to no further activity. If you wish, feel free to re-open to discuss further. |
When Retrieving data as follows:
$OVServerProfile = Get-HPOVServerProfile -ApplianceConnection $OVConnection -Name $VMHostName
Where did the Template Property Go???
Edit: Additionally, the Template ID should also be included since names could potentially have duplicates.
NEXT:
Using the REST API to OneView or OneView Global Dashboard, We SHOULD be able to use cmdlet generated data to retrieve the Server Profile Template, except the returned value of $OVServerProfile.serverProfileTemplateUri is WRONG
The ID returned “664feb66-21b7-43f4-87ad-d1fca89e1f27” is NOT Correct.
The Correct ID, in this instance, is actually “6a4fa19f-a6da-454b-ab19-664947b84bfe”, as determined via the web GUI (and confirmed below).
We had to retrieve EVERY Template and compare the template “originalUri” property to the Profile “serverProfileTemplateUri” property to find a match.
So while we COULD add the Profile Template metadata to the Server Profile Object as a property, it should already be included in the Get-HPOVServerProfile cmdlet AND the ".serverProfileTemplateUri" should properly return the correct string.
CommandType: Function
Name: Get-HPOVServerProfile
Version: 5.0.2341.1920
Source: HPOneView.500
PS C:> $PSVersionTable
PSVersion: 5.1.18362.752
PSEdition: Desktop
PSCompatibleVersions: {1.0, 2.0, 3.0, 4.0...}
BuildVersion: 10.0.18362.752
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
The text was updated successfully, but these errors were encountered: