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

CapacityBytes should not be a required parameters to create a volume with Redfish #8955

Closed
1 task done
pyfontan opened this issue Oct 1, 2024 · 2 comments · Fixed by #8956
Closed
1 task done

CapacityBytes should not be a required parameters to create a volume with Redfish #8955

pyfontan opened this issue Oct 1, 2024 · 2 comments · Fixed by #8956
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type)

Comments

@pyfontan
Copy link
Contributor

pyfontan commented Oct 1, 2024

Summary

For the CreateVolume command of the redfish_config module, the documentation doesn't mention the fact that CapacityBytes is a required parameter of the command.
But it is effectively required on the line #L3732 of redfish_utils.py.
https://github.com/ansible-collections/community.general/blob/9.4.0/plugins/module_utils/redfish_utils.py#L3732

So when i try to use this command without CapacityBytes, my task fail with :

"msg": "['RAIDType', 'Drives', 'CapacityBytes'] are required parameter to create a volume"

This parameter is not really needed and i can create a volume with curl without CapacityBytes

Issue Type

Bug Report

Component Name

redfish_config

Ansible Version

$ ansible --version
ansible [core 2.15.3]
  ...
  python version = 3.11.0rc1 (main, Aug 12 2022, 10:02:14) [GCC 11.2.0] 
  jinja version = 3.1.2

Community.general Version

$ ansible-galaxy collection list community.general
# /home/pyfontan/Dev/gitlab/ansible/ccin2p3/sysadmin_tools/.collections/ansible_collections
Collection        Version
----------------- -------
community.general 9.4.0

Configuration

$ ansible-config dump --only-changed

OS / Environment

Not relevant

Steps to Reproduce

- name: Create Volume
  community.general.redfish_config:
    category: Systems
    command: CreateVolume
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"
    storage_subsystem_id: "DE07A000"
    volume_details:
      Name: "SYSTEM"
      RAIDType: "RAID1"
      Drives:
        - "/redfish/v1/Systems/1/Storage/DE07A000/Drives/36"
        - "/redfish/v1/Systems/1/Storage/DE07A000/Drives/37"

Expected Results

I expected the creation of the volume SYSTEM and the changed value of :

{                                                                                                          
    "changed": true,                                                                                                                                           
    "invocation": {                                                                                                                                            
        "module_args": {                                                       
            "auth_token": null,                                                
            "baseuri": "X.X.X.X",                                        
            "bios_attributes": {},                                             
            "boot_order": [],                                                  
            "category": "Systems",                                             
            "ciphers": null,                                                   
            "command": [                                                       
                "CreateVolume"                                                 
            ],                                                                 
            "hostinterface_config": {},                                        
            "hostinterface_id": null,                                          
            "network_protocols": {},                                           
            "nic_addr": "null",                                                
            "nic_config": {},                                                  
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",                                                                                                 
            "resource_id": null,                                               
            "secure_boot_enable": true,                                        
            "service_id": null,                                                
            "sessions_config": {},                                             
            "storage_subsystem_id": "DE07A000",                                                                                                                
            "strip_etag_quotes": false,                                        
            "timeout": 60,                                                     
            "username": "XXX",                                                                                                                       
            "volume_details": {                                                
                "Links": {                                                     
                    "Drives": [                                                
                        {                                                      
                            "@odata.id": "/redfish/v1/Systems/1/Storage/DE07A000/Drives/36"
                        },                                                     
                        {                                                      
                            "@odata.id": "/redfish/v1/Systems/1/Storage/DE07A000/Drives/37"
                        }                                                      
                    ]                                                          
                },                                                             
                "Name": "SYSTEM",                                              
                "RAIDType": "RAID1"                                            
            },                                                                 
            "volume_ids": []                                                   
        }                                                                      
    },                                                                         
    "msg": "Volume Created"                                                    
}    

Actual Results

{                                                                                                   
    "changed": false,                                                                                                                                          
    "invocation": {                                                                                                                                            
        "module_args": {                                                                                                                                       
            "auth_token": null,                                                                                                                                
            "baseuri": "X.X.X.X",                                                                                                                        
            "bios_attributes": {},                                                                                                                             
            "boot_order": [],                                                                                                                                  
            "category": "Systems",                                                                                                                             
            "ciphers": null,                                                                                                                                   
            "command": [                                                                                                                                       
                "CreateVolume"                                                                                                                                 
            ],                                                                                                                                                 
            "hostinterface_config": {},                                                                                                                        
            "hostinterface_id": null,                                                                                                                          
            "network_protocols": {},                                                                                                                           
            "nic_addr": "null",                                                                                                                                
            "nic_config": {},                                                                                                                                  
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",                                                                                                 
            "resource_id": null,                                                                                                                               
            "secure_boot_enable": true,                                                                                                                        
            "service_id": null,                                                                                                                                
            "sessions_config": {},                                                                                                                             
            "storage_subsystem_id": "DE07A000",                                                                                                                
            "strip_etag_quotes": false,                                                                                                                        
            "timeout": 60,                                                                                                                                     
            "username": "XXX",                                                                                                                       
            "volume_details": {                                                                                                                                
                "Drives": [                                                                                                                                    
                    "/redfish/v1/Systems/1/Storage/DE07A000/Drives/36",                                                                                        
                    "/redfish/v1/Systems/1/Storage/DE07A000/Drives/37"                                                                                         
                ],                                                                                                                                             
                "Name": "SYSTEM",                                                                                                                              
                "RAIDType": "Mirrored"                                                                                                                         
            },                                                                                                                                                 
            "volume_ids": []                                                                                                                                   
        }                                                                                                                                                      
    },                                                                                                                                                         
    "msg": "['RAIDType', 'Drives', 'CapacityBytes'] are required parameter to create a volume"                                                                 
}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants