HewlettPackard / python-hpOneView

DEPRECATED - no longer actively maintained. New repository: https://github.com/HewlettPackard/oneview-python
MIT License
87 stars 57 forks source link

Creating a server profile from a profile template with a local storage logical drive #366

Closed rollenburger closed 6 years ago

rollenburger commented 6 years ago

Scenario/Intent

Creating a server profile from a profile template that has a local storage raid 1 logical drive does not apply the drive configuration to the new server profile.

Environment Details

Steps to Reproduce

PROFILE = oneview_client.server_profiles.create(PROFILE_OPTIONS) PROFILE_NAME_URI = oneview_client.server_profiles.get_by_name(PROFILE_NAME)['uri'] PROFILE_PATCH = oneview_client.server_profiles.patch(id_or_uri=PROFILE_NAME_URI, operation="replace", path="/templateCompliance", value="Compliant")



### Expected Result
I expect that the new server profile will have a logical drive created that matches the template

### Actual Result
The new server profile displays no logical drives and states that it is still inconsistent with its profile template. Its compliance status states the profile must be manually edited to match the local storage configuration of the profile template

Creating a profile from the template manually in the GUI successfully creates the logical drive on the new server profile...maybe I'm using the incorrect patch options?
rollenburger commented 6 years ago

I was able to figure this out.... You need to first get the profile template configuration and then substitute in the name of your new server profile and the server hardware uri you are deploying the profile to.

PROFILE_OBJECT = oneview_client.server_profile_templates.get_new_profile(TEMPLATE_URI)
PROFILE_OBJECT["name"] = PROFILE_NAME
PROFILE_OBJECT["serverHardwareUri"] = SERVER_URI
PROFILE = oneview_client.server_profiles.create(PROFILE_OBJECT)