Closed harishkalyanpur closed 3 years ago
@harishkalyanpur, We are looking into this issue and will update you with the solution as soon as possible.
@harishkalyanpur, I could reproduce the error with the given playbook and noticed that settingType was given as localAccounts instead of "LocalAccounts".
Here is the working playbook, please let us know if this helps.
mpSettings:
- settingType: "LocalAccounts"
args:
localAccounts:
- userName: "testuser"
displayName: "iLO user"
password: "testuser123"
userConfigPriv: true
remoteConsolePriv: true
virtualMediaPriv: true
virtualPowerAndResetPriv: true
iLOConfigPriv: true
Issue still persists. Below is the complete list of ILO settings. without the LocalAccounts block, the rest of the settings are working fine, but when i add the LocalAccounts i get syntax errors that i reported.
Can you test again?
mpSettings:
Looks like the issues is only when you want to update the existing server profile template. When creating a new SPT it is working fine.
@harishkalyanpur, We have retested the playbook with create and update operations on Server Profile Template with LocalAccounts. Its working fine in our environment, could you please try with this working playbook?
- hosts: all
vars:
config: "{{ playbook_dir }}/oneview_config.json"
server_profile_template: Test_Local_settings
server_hardware_type: SY 480 Gen9 2
enclosure_group: EG
tasks:
- name: Create a server profile template
oneview_server_profile_template:
config: "{{ config }}"
state: present
data:
name: "{{ server_profile_template }}"
serverHardwareTypeName: "{{ server_hardware_type }}"
enclosureGroupName: "{{ enclosure_group }}"
connectionSettings:
manageConnections: true
connections:
- id: 1
name: network2
functionType: Ethernet
portId: Auto
requestedMbps: 2600
networkName: "mgmt_untagged"
managementProcessor:
manageMp: true
mpSettings:
- settingType: LocalAccounts
args:
localAccounts:
- userName: "OneViewAdminUpdate11"
displayName: "One View Administrator"
password: "testuser1234"
userConfigPriv: true
remoteConsolePriv: true
virtualMediaPriv: true
virtualPowerAndResetPriv: true
iLOConfigPriv: true
- settingType: Directory
args:
directoryAuthentication: defaultSchema
directoryGenericLDAP: true
directoryServerAddress: ldap.xyz.com
directoryServerPort: 636
directoryUserContext:
- "XXXXXXX"
- "XXXXXXX"
iloObjectDistinguishedName: "XXXXXXXXX-YYYYYYYYY"
kerberosAuthentication: false
password: "password1234"
delegate_to: localhost
I am getting below error when i use -vvv switch. This is happening only when we are updating the existing profile. If the same code when it runs to create a new SPT, we dont get this error. Also this is specific to the ILO settings.
hpeOneView.exceptions.HPEOneViewTaskError: The iLO settings are invalid: Argument "deleteAdministratorAccount" is not recognized for iLO setting "Manage local accounts". Argument "password" is not recognized for iLO setting "Manage local accounts". Argument "localAccounts" is not recognized for iLO setting "Manage administrator account".
fatal: [localhost -> localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1608103895.3504324-72181544990486/AnsiballZ_oneview_server_profile_template.py\", line 113, in
@harishkalyanpur, Just to confirm, did you copy the playbook provided above and got the same error? Because I haven't provided 'deleteAdministratorAccount' type above. If this works fine, please provide the entire playbook you are trying.
@yuvirani, It worked with few modifications, like network name, enclosure name and hardware type also the update worked. I will send the entire playbook with few data masking.
@yuvirani, here is the entire playbook.
- hosts: all
vars:
config: "{{ playbook_dir }}/oneview_config.json"
server_profile_template_name: TestProfile
server_hardware_type_name: SY 480 Gen10 1
enclosure_group_name: Demo
tasks:
- name: Crate and Update server profile template
oneview_server_profile_template:
config: "{{ config }}"
state: present
data:
name: "{{ server_profile_template_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
description: "Test Server Profile Template created using Ansible Playbook"
boot:
manageBoot: true
order:
- HardDisk
bootMode:
manageMode: true
mode: UEFIOptimized
pxeBootPolicy: Auto
secureBoot: Enabled
affinity: BayAndServer
bios:
manageBios: true
overriddenSettings:
- id: WorkloadProfile
value: Virtualization-MaxPerformance
- id: MinProcIdlePower
value: NoCStates
- id: IntelUpiPowerManagement
value: Disabled
- id: AdvancedMemProtection
value: FastFaultTolerantADDDC
- id: MinProcIdlePkgState
value: NoState
- id: EnergyPerfBias
value: MaxPerf
- id: UncoreFreqScaling
value: Maximum
- id: AsrStatus
value: Disabled
- id: TimeZone
value: UtcP10
- id: PowerRegulator
value: StaticHighPerf
- id: EnergyEfficientTurbo
value: Disabled
- id: NumaGroupSizeOpt
value: Clustered
- id: SubNumaClustering
value: Enabled
- id: CollabPowerControl
value: Disabled
firmware:
firmwareActivationType: Immediate
firmwareBaselineUri: /rest/firmware-drivers/Synergy_Custom_SPP_2020_07_02_Z7550-97031
firmwareInstallType: FirmwareOnlyOfflineMode
forceInstallFirmware: false
manageFirmware: true
serverProfileDescription: "Test Server Profile"
serialNumberType: "Physical"
wwnType: Virtual
connectionSettings:
connections:
- boot:
bootVlanId: null
priority: NotBootable
functionType: Ethernet
id: 1
isolatedTrunk: false
lagName: null
managed: true
name: Host Management
networkName: null
networkUri: /rest/ethernet-networks/682b97be-7577-4c94-b4b5-sfadsfasdfsa
portId: abcd 3:1-x
requestedMbps: 2500
requestedVFs: 0
- boot:
bootVlanId: null
priority: NotBootable
functionType: FibreChannel
id: 2
isolatedTrunk: false
lagName: null
managed: true
name: SAN X
networkName: null
networkUri: /rest/fc-networks/57a6865f-ec8e-4a74-81fe-adfdasfasdfsda
portId: abcd 3:1-y
requestedMbps: 2500
requestedVFs: null
- boot:
bootVlanId: null
priority: NotBootable
functionType: FibreChannel
id: 3
isolatedTrunk: false
lagName: null
managed: true
name: SAN Y
networkName: null
networkUri: /rest/fc-networks/5a77bf06-8981-4238-98e5-sdfadsfadfsadf
portId: abcd 3:2-y
requestedMbps: 2500
requestedVFs: null
- boot:
bootVlanId: null
priority: NotBootable
functionType: Ethernet
id: 4
isolatedTrunk: false
lagName: null
managed: true
name: Host Mgmt Set
networkName: null
networkUri: /rest/ethernet-networks/682b97be-7577-4c94-b4b5-adfsdfasdfsa
portId: abcd 3:2-x
requestedMbps: 2500
requestedVFs: 0
manageConnections: true
managementProcessor:
manageMp: true
mpSettings:
- settingType: "LocalAccounts"
args:
localAccounts:
- userName: "OneViewAdmin"
displayName: "One View Administrator"
password: "{{ oneview_profile_account_pw }}"
userConfigPriv: true
remoteConsolePriv: true
virtualMediaPriv: true
virtualPowerAndResetPriv: true
iLOConfigPriv: true
- settingType: AdministratorAccount
args:
deleteAdministratorAccount: false
password: "{{ oneview_profile_account_pw }}"
- settingType: Directory
args:
directoryAuthentication: defaultSchema
directoryGenericLDAP: true
directoryServerAddress: ldap.xyz.com
directoryServerPort: 636
directoryUserContext:
- "XXXXXX"
- "XXXXXX"
iloObjectDistinguishedName: "XXXXXXXXX\YYYYYYYYY"
kerberosAuthentication: false
password: "{{ oneview_profile_account_pw }}"
- settingType: DirectoryGroups
args:
directoryGroupAccounts:
- groupDN: " XXXXXX "
groupSID: ""
iLOConfigPriv: true
remoteConsolePriv: true
userConfigPriv: true
virtualMediaPriv: true
virtualPowerAndResetPriv: true
- groupDN: " XXXXXX "
groupSID: ""
iLOConfigPriv: true
remoteConsolePriv: true
userConfigPriv: false
virtualMediaPriv: true
virtualPowerAndResetPriv: true
- settingType: Hostname
args:
hostName: "{serverProfileName}-ilo"
params:
force: True # Supprted only for API version >= 600
delegate_to: localhost
@yuvirani, sorry not sure how to preserve the yaml formatting.
@harishkalyanpur, The above playbook also works fine with create and update operations on SPT. Hence, closing this issue.
Scenario/Intent
Creating Server Profile Template with localAccounts is reporting syntax error.
Environment Details
Steps to Reproduce
When i add below to the yaml code to update the server profile template, i get syntax error.
Expected Result
To accept the localAccounts block of code and update the server profile template.
Actual Result
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: hpeOneView.exceptions.HPEOneViewException: ('Invalid JSON data type.', {'errorCode': 'INVALID_JSON_DATA_TYPE', 'message': 'Invalid JSON data type.', 'details': 'The JSON sent in the request contained a unknown type where a different unknown type is required on line 1 near column 3,662.', 'messageParameters': [], 'recommendedActions': ['Correct the content of the JSON and retry the request.'], 'errorSource': None, 'nestedErrors': [], 'data': {}})