Closed daveolker closed 5 years ago
@daveolker , You are comparing server profile template out with deployment plan out. oneview_os_deployment_plan_facts, is pulling data from deployment plan.
Can you check the custom attributes values of the Deployment plan from the image streamer UI?
Assuming issue got resolved and closing this for now. You can reopen if any questions related to this issue
Scenario/Intent
Attempting to create a server profile template using the OS Custom Attributes returned by oneview_os_deployment_plan_facts. Failure due to ManagementNIC properties not populated properly.
Environment Details
Module Version: [Version of the Oneview-Ansible module for which you are encountering the issue] v5.1.2
Ansible Version: [Version of Ansible for which you are encountering the issue] 2.7.5
OneView Appliance Version: [Version of the OneView appliance you're interacting with] 4.10.04-0370820
OneView Client API Version: [API version listed in your configuration file or dictionary] 600
Python Version: [Version of Python in your environment] 2.7.15
python-hpOneView SDK Version: [Version of the python-hpOneView SDK in your environment] 4.7.1
Platform: [OS distribution and release version] Red Hat 7.6
Steps to Reproduce
[What are the complete steps needed to do in order to reproduce your problem?] Playbook includes:
hosts: all vars: config: "{{ playbook_dir }}/oneview_config.json"
os_custom_attributes_file_name: '{{ playbook_dir }}/vars/os_attributes.yaml' vars_files:
"{{ playbook_dir }}/vars/config.yml" tasks:
name: Gather facts about OS Deployment Plan oneview_os_deployment_plan_facts: config: "{{ config }}" name: "{{ os_deployment_plan_name }}" options:
name: "Export OS Custom Attributes to the file: {{ os_custom_attributes_file_name }}" copy: content="{{ os_deployment_plan_custom_attributes | to_nice_yaml }}" dest="{{ os_custom_attributes_file_name }}" when: os_custom_attributes_file_name is defined delegate_to: localhost
Resulting os_attributes.yaml file contains:
os_custom_attributes_for_server_profile:
All of the ManagementNIC properties are not populated correctly.
By comparison, I used the POSH-HPOneView library to dump out the same server profile template as above using the following command:
Get-HPOVServerProfileTemplate -Name "Windows Worker Node (single-frame) v1.0.1" -Export
I’ve attached the full output of the command, but here are the OS Custom Attributes dumped by this tool. I’ve highlighted in yellow the fields that are dumped by the POSH-HPOneView library and are incorrectly populated by the Ansible module:
"osCustomAttributes": [ { "name": "ManagementNIC.dhcp", "value": "false", "constraints": null, "type": null }, { "name": "ManagementNIC.ipv4disable", "value": "false", "constraints": null, "type": null }, { "name": "PowerPlan", "value": "High Performance", "constraints": "{\"options\":[\"Balanced\",\"High Performance\",\"Power Saver\"]}", "type": "option" }, { "name": "WindowsProductKey", "value": "69KD4-NMFPJ-H9HV9-DXH4X-K6CG4", "constraints": "{\"regex\":\"\",\"helpText\":\"\"}", "type": "string" }, { "name": "TimeZone", "value": "GMT Standard Time", "constraints": "{\"options\":[\"GMT Standard Time\",\"Arabian Standard Time\",\"AUS Eastern Standard Time\",\"Central Standard Time\",\"China Standard Time\",\"Eastern Standard Time\",\"India Standard Time\",\"Mountain Standard Time\",\"Singapore Standard Time\",\"Tokyo Standard Time\"]}", "type": "option" }, { "name": "RemoteDesktop", "value": "Allow", "constraints": "{\"options\":[\"Disallow\",\"Allow (Network Level Authentication)\",\"Allow\"]}", "type": "option" }, { "name": "ManagementNIC.dns1", "value": "10.10.173.1", "constraints": null, "type": "dns" }, { "name": "ManagementNIC.netmask", "value": "255.255.252.0", "constraints": null, "type": "subnetmask" }, { "name": "ManagementNIC.networkuri", "value": "/rest/ethernet-networks/c24d47fe-edc2-475d-9207-917293017be8", "constraints": null, "type": null }, { "name": "ManagementNIC.ipaddress", "value": "", "constraints": null, "type": "ipv4" }, { "name": "ManagementNIC.dns2", "value": "10.10.173.31", "constraints": null, "type": "dns" }, { "name": "ManagementNIC.connectionid", "value": "2", "constraints": null, "type": null }, { "name": "ProxyServerSkipForAddresses", "value": "localhost", "constraints": "{\"regex\":\"\",\"helpText\":\"\"}", "type": "string" }, { "name": "DisplayLanguage", "value": "English (United States)", "constraints": "{\"options\":[\"English (United States)\",\"French (France)\",\"German (Germany)\",\"Japanese (Japan)\",\"Arabic (Saudi Arabia)\",\"Chinese (PRC)\",\"Korean (Korea)\",\"Portuguese (Brazil)\",\"Russian (Russia)\"]}", "type": "option" }, { "name": "ProxyServerPort", "value": "8080", "constraints": "{\"increment\":\"1\"}", "type": "number" }, { "name": "ManagementNIC.gateway", "value": "10.10.172.1", "constraints": null, "type": "gateway" }, { "name": "Hostname", "value": "", "constraints": "{}", "type": "string" }, { "name": "ProxyServerAddress", "value": "proxy.am2.hpelabs.net", "constraints": "{\"regex\":\"\",\"helpText\":\"\"}", "type": "string" }, { "name": "KeyboardLayout", "value": "English (United States)", "constraints": "{\"options\":[\"English (United States)\",\"Arabic (101)\",\"Chinese (Traditional) - US Keyboard\",\"Japanese\",\"Korean\",\"United Kingdom Extended\",\"United States - Dvorak\"]}", "type": "option" }, { "name": "ManagementNIC.constraint", "value": "userspecified", "constraints": null, "type": null }, { "name": "Password", "value": null, "constraints": null, "type": "password" } ]
From the PowerShell output you can see all of the ManagementNIC values and how they should be populated. The custom key “WindowsProductKey” is also not getting populated.
Expected Result
Expected to create an SPT using the exported OS custom attributes.
Actual Result
SPT creation fails with:
HPOneViewTaskError: ConnectionId nic attribute is not defined in the OS Deployment settings.
Again, this is merely one of the NIC attributes that were not properly populated by the oneview_os_deployment_plan_facts call.