Closed frippe75 closed 1 year ago
Hi Fredrik,
Below is a working snippet for an spt with network set name passed in networkName field.
- name: Create a server profile template
oneview_server_profile_template:
config: "{{ config }}"
state: present
sessionID: "{{ session.ansible_facts.session }}"
data:
name: "{{ item.name }}"
serverHardwareTypeName: "{{ contents.server_profile_template.server_hardware_type_name }}"
enclosureGroupName: "{{ contents.server_profile_template.enclosure_group_name }}"
connectionSettings:
manageConnections: true
complianceControl: "Checked"
connections:
- id: 1
name: "mgmt"
functionType: "Ethernet"
portId: "Auto"
requestedMbps: 2000
networkName: "nwset_test"
# networkUri: '/rest/ethernet-networks/f5d68cb6-7766-4662-9774-af461436005d'
params:
force: "True" # Supported only for API version >= 600
delegate_to: localhost
with_items:
- { name: '{{ contents.server_profile_template.server_profile_template_name }}' }
Kindly run the above snippet alone and check if it works for you
Will try that today. But I somehow feel it's related to versions of Ansible/OneView-module/Oneview-API. In my demo env passing network sets for name->uri works just fine. So must be something else. Or maybe other part of the JSON contains errors and the error message is simply bougus.
Hi Fredrik,
Thanks for the update. We will wait for your response.
Started modifying the connections to using URI instead of names. Still got the same error and the realizing it's actually for the storagePaths section the Ansible modules fails to do URI -> Name conversion.
Snippet:
volumeAttachments:
storagePaths:
- isEnabled: true
connectionId: 1
networkName: FabricA
- isEnabled: true
connectionId: 2
networkName: FabricB
The customer is experience problems with how OneView picks paths using the Port Groups. Not getting an even "spread" of the load.
Hi Fredrik,
Thanks for your response. We are currently supporting networkName->networkUri conversion for connectionSettings only. We have added this to our backlog and will fix it on priority.
OneView API Ver: 4000 (7.0)
Error: 'The field named networkName is not a valid field in this JSON object'
I'm not sure but this function in the OneView client seems to handle it. Even though the code could handle checking for existance of [0] element.
Full stacktrace: