# Failed to create Volumes in HPE machine with redfish\_config

**URL:** <https://forum.ansible.com/t/failed-to-create-volumes-in-hpe-machine-with-redfish-config/11207>\
**Category:** Get Help\
**Created:** [November 28, 2024, 3:34pm UTC](https://forum.ansible.com/t/failed-to-create-volumes-in-hpe-machine-with-redfish-config/11207 "2024-11-28T15:34:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![colbacc8](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@colbacc8](https://forum.ansible.com/u/colbacc8)\
**Post date:** [November 28, 2024, 3:34pm UTC](https://forum.ansible.com/t/failed-to-create-volumes-in-hpe-machine-with-redfish-config/11207/1 "2024-11-28T15:34:59Z")

</div>

Hi there!

I’m trying to use ansible and redfish to configure HPE machines with ILO5 v3.0.9

I’m using the HP ilo ansible collection [GitHub - HewlettPackard/ilo-ansible-collection: Ansible Collection and Sample Playbooks for HPE iLO](https://github.com/HewlettPackard/ilo-ansible-collection)

Most of the commands worked, but I’m getting trouble with the volume creation that uses the community.general.redfish\_config module.  
This is the link to the documentation of the redfish\_config module: [community.general.redfish\_config module – Manages Out-Of-Band controllers using Redfish APIs — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections/community/general/redfish_config_module.html)

The following is an example of the code that I’m trying to execute to create a RAID0 volume on the disk number 2:

```auto
- name: Create vdi volumes RAID0
  community.general.redfish_config:
    category: Systems
    command: CreateVolume
    baseuri: "{{ inventory_hostname }}"
    username: "{{ ilo_username }}"
    password: "{{ ilo_password }}"
    storage_subsystem_id: "DE09B000"
    volume_details:
      Name: "Disk 2 NoRAID"
      RAIDType: "RAID0"
      Drives: 
        - "/redfish/v1/Systems/1/Storage/DE09B000/Drives/2"    

```

the first issue is that it asks me to specify the required parameter CapacityBytes which is not specified in any example.  
Even if I add the CapacityBytes parameter with the size of the disk converted from terabytes in bytes, I receive a HTTP 400 error on a POST request with a message: “The operation failed due to an internal error.”

Moreover, if I try to use the ilorest command line, everything works without the need of the CapacityBytes parameter.

---

<div class="post-metadata">

**Author:** ![AleksIsa](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@AleksIsa](https://forum.ansible.com/u/AleksIsa)\
**Post date:** [February 21, 2025, 5:12pm UTC](https://forum.ansible.com/t/failed-to-create-volumes-in-hpe-machine-with-redfish-config/11207/2 "2025-02-21T17:12:51Z")

</div>

I got the 400 reply when the volume is already created because the POST is forbidden or if the iLO is not displaying the drives (a reboot helps to recover).  
I also cannot find a way to create the volume without specifying the CapacityBytes, but if I specify them, the creation works.
