Skip to content
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

Closed
Cynomus opened this issue May 7, 2020 · 5 comments
Closed

Get-HPOVServerProfile Bug #474

Cynomus opened this issue May 7, 2020 · 5 comments
Assignees
Labels

Comments

@Cynomus
Copy link

Cynomus commented May 7, 2020

When Retrieving data as follows:
$OVServerProfile = Get-HPOVServerProfile -ApplianceConnection $OVConnection -Name $VMHostName
image
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).
image
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

@Cynomus Cynomus added the Bug label May 7, 2020
@DungKHoang
Copy link
Collaborator

DungKHoang commented May 7, 2020 via email

@Cynomus
Copy link
Author

Cynomus commented May 7, 2020

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?

@VincentBerger
Copy link

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.
The reason for the error in your Invoke-RestMethod on the template uri is that you're passing X-API-Version=2 in the headers. That's a very old version of the API in which the server-profile-templates resource did not even exist, hence the 404 error.

@ChrisLynchHPE
Copy link
Member

ChrisLynchHPE commented May 21, 2020

Apologies for being late to this conversation, I had been heads down with planning and getting the HPE OneView 5.20 library released. The serverProfileTemplateUri is the actual property from the REST API. The Get-HPOVServerProfile Cmdlet is NOT changing the value. If you want to get all profiles associated with a template, pass the template into Get-HPOVServerProfile as such:

# Get the profile template
$SPT = Get-HPOVServerProfileTemplate -Name MyProfile

# Now, get associated profiles from the template
Get-HPOVServerProfile -InputObject $SPT

The screenshot shows the behavior in action:
image

@ChrisLynchHPE ChrisLynchHPE self-assigned this May 21, 2020
@ChrisLynchHPE
Copy link
Member

Closing due to no further activity. If you wish, feel free to re-open to discuss further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants