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

[BUG]: PxeDev3Interface: Read only attribute cannot be modified. #495

Open
mdn19866 opened this issue Apr 18, 2023 · 2 comments
Open

[BUG]: PxeDev3Interface: Read only attribute cannot be modified. #495

mdn19866 opened this issue Apr 18, 2023 · 2 comments
Labels
needs-triage Issue requires triage. type/bug Something isn't working

Comments

@mdn19866
Copy link

Bug Description

Hello everyone! We have Dell PowerEdge R640 and R840 in our landscape which were installed in BIOS boot mode in the past. We are now moving all the servers to UEFI boot mode and want to enable the PXE devices in order to boot from them. The code looks like the following. We set UEFI boot mode in a previous step as this is needed.

      - name: "Actually adjust settings"
      dellemc.openmanage.idrac_bios:
        idrac_ip: "{{ hostname }}"
        idrac_user: "{{ username }}"
        idrac_password: "{{ password }}"
        validate_certs: false
        attributes:
              IntegratedNetwork1: "Enabled"
              PxeDev1EnDis: "Enabled"
              PxeDev3EnDis: "Enabled"
              PxeDev1Interface: "NIC.Slot.2-1-1"
              PxeDev3Interface: "NIC.Slot.3-1-1"

The error message we get is: PxeDev3Interface: Read only attribute cannot be modified.. For whatever reason PxeDev1EnDis was already enabled for us and therefore we don't see the issue only with the third PXE interface.

I already tried to understand what is happening and found the cause of my issue here:

def validate_vs_registry(registry, attr_dict):
invalid = {}
for k, v in attr_dict.items():
if k in registry:
val_dict = registry.get(k)
if val_dict.get("ReadOnly"):
invalid[k] = "Read only attribute cannot be modified."
else:
type = val_dict.get("Type")
if type == "Enumeration":
found = False
for val in val_dict.get("Value", []):
if v == val.get("ValueName"):
found = True
break
if not found:
invalid[k] = "Invalid value for enumeration."
if type == "Integer":
try:
i = int(v)
except Exception:
invalid[k] = "Invalid integer."
else:
if not (val_dict.get("LowerBound") <= i <= val_dict.get("UpperBound")):
invalid[k] = "Integer not in a valid range."
else:
invalid[k] = "The attribute does not exist."
return invalid

So, the BiosRegistry resource reports a ReadOnly: true and prevents the module from executing the job doesn't matter if I set PxeDev3EnDis to Enabled in the same step.

{
                "AttributeName": "PxeDev3Interface",
                "CurrentValue": null,
                "DisplayName": "Interface",
                "DisplayOrder": 6700,
                "HelpText": "NIC interface used for this PXE device.",
                "Hidden": false,
                "Immutable": false,
                "MenuPath": "./NetworkSettingsRef/PxeDev3SettingsRef",
                "ReadOnly": true,
                "ResetRequired": true,
                "Type": "Enumeration",
                "Value": [
                    {
                    ...

There are several workarounds available:

  1. Run dellemc.openmanage.idrac_bios two times. First only to enable the PXE interfaces and the second time for the setting of the interface. Involves two reboots and extends duration of everything.
  2. Use the redfish config module: https://docs.ansible.com/ansible/latest/collections/community/general/redfish_config_module.html. With this we can send everything in one step as the BiosRegistryis not checked for ReadOnly in this module. But we have to handle the creation of the configuration job and reboot separately.

Would be good to see not so many reboots involved in the process as this consumes a lot of time. To be honest, I also won't run three separate tasks to achieve what I want.

What do you suggest?

Component or Module Name

idrac_bios

Ansible Version

ansible [core 2.12.5.post0]

Python Version

3.8.13

iDRAC/OME/OME-M version

iDRAC 6.10.30.00

Operating System

CentOS 8

Playbook Used

  - name: "Actually adjust settings"
  dellemc.openmanage.idrac_bios:
    idrac_ip: "{{ hostname }}"
    idrac_user: "{{ username }}"
    idrac_password: "{{ password }}"
    validate_certs: false
    attributes:
          IntegratedNetwork1: "Enabled"
          PxeDev1EnDis: "Enabled"
          PxeDev3EnDis: "Enabled"
          PxeDev1Interface: "NIC.Slot.2-1-1"
          PxeDev3Interface: "NIC.Slot.3-1-1"

Logs

fatal: [server -> localhost]: FAILED! => changed=false
invalid_attributes:
PxeDev3Interface: Read only attribute cannot be modified.
invocation:
module_args:
apply_time: Immediate
attributes:
IntegratedNetwork1: Enabled
PxeDev1EnDis: Enabled
PxeDev1Interface: NIC.Slot.2-1-1
PxeDev3EnDis: Enabled
PxeDev3Interface: NIC.Slot.3-1-1
boot_sources: null
ca_path: null
clear_pending: null
idrac_ip: server
idrac_password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
idrac_port: 443
idrac_user: support
job_wait: true
job_wait_timeout: 1200
maintenance_window: null
reset_bios: null
reset_type: graceful_restart
share_mnt: null
share_name: null
share_password: null
share_user: null
timeout: 30
validate_certs: false
status_msg: The values specified for the attributes are invalid.

Steps to Reproduce

UEFI boot mode is set. PxeDev3EnDis is disabled. Run the task mentioned above.

Expected Behavior

When I enable PxeDev3EnDis and want to configure PxeDev3Interface in one step it should work.

Actual Behavior

PxeDev3Interface is a read only attribute even if I set PxeDev3EnDis to enable in the same task.

Screenshots

No response

Additional Information

No response

@mdn19866 mdn19866 added needs-triage Issue requires triage. type/bug Something isn't working labels Apr 18, 2023
@jagadeeshnv
Copy link
Contributor

jagadeeshnv commented Jul 21, 2023

@mdn19866 Thanks for the details, will check if we can improvise to reduce the number of steps. will get back soon

@jagadeeshnv
Copy link
Contributor

@mdn19866 For your case do make the required changes. We will work on the permanent fix and update soon
if val_dict.get("_ReadOnly"): invalid[k] = "Read only attribute cannot be modified."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Issue requires triage. type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants