dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
339 stars 163 forks source link

dellemc_idrac_storage_volume: 2nd VD request, schedules delete of existing VD on PERC controller. #147

Closed janr7 closed 4 years ago

janr7 commented 4 years ago

Hello

dellemc_idrac_storage_volume is used to create a RAID1 VD just fine. If dellemc_idrac_storage_volume is used to create a RAID5 VD this works as well.

However: If a second VD is added to the PERC controller, the 2nd request schedules a delete of the existing VD. No matter which type RAID1 or RAID2 were created first. Creating the 2nd VD manually is no problem. It stays there.

Please advise. Thanks so much.

Used: https://galaxy.ansible.com/download/dellemc-openmanage-2.1.1.tar.gz

Model | PowerEdge R740 BIOS Version | 2.8.1 iDRAC Firmware Version | 4.22.00.00 No OS installed on server.

- name: Create PERC Raid volume
  dellemc_idrac_storage_volume:
    idrac_ip:                  "{{ rmb_address }}"
    idrac_user:                "{{ rmb_username }}"
    idrac_password:            "{{ rmb_password }}"
    state:                     "create"
    raid_reset_config:         "True"
    controller_id:             "RAID.Slot.6-1"
    volumes:
     - name:                  "Virtual-Disk-R1"
       volume_type:           "RAID 1"
       disk_cache_policy:     "Default"
       write_cache_policy:    "WriteBack"
       read_cache_policy:     "ReadAhead"
       raid_init_operation:   "Fast"
       span_length: 2
       span_depth:  1
       number_dedicated_hot_spare: 0
       stripe_size: 131072
       drives:
         id: ["Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.6-1",
              "Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.6-1"]
  register: result_setup_raid
- debug:
    var: result_setup_raid

...

- name: Create PERC Raid volume
  dellemc_idrac_storage_volume:
    idrac_ip:                  "{{ rmb_address }}"
    idrac_user:                "{{ rmb_username }}"
    idrac_password:            "{{ rmb_password }}"
    state:                     "create"
    raid_reset_config:         "True"
    controller_id:             "RAID.Slot.6-1"
     volumes:
      - name:                  "Virtual-Disk-r50"
        volume_type:           "RAID 5"
        disk_cache_policy:     "Default"
        write_cache_policy:    "WriteBack"
        read_cache_policy:     "ReadAhead"
        raid_init_operation:   "Fast"
        span_length: 4
        span_depth:  1
        number_dedicated_hot_spare: 0
        stripe_size: 131072
        drives:
         id: ["Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.6-1",
              "Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.6-1",
              "Disk.Bay.4:Enclosure.Internal.0-1:RAID.Slot.6-1",
              "Disk.Bay.5:Enclosure.Internal.0-1:RAID.Slot.6-1"]
  register: result_setup_raid
- debug:
    var: result_setup_raid

...

View - inventory.

{ "result": { "changed": false, "failed": false, "msg": "Successfully completed the view storage volume operation", "storage_status": { "Message": { "Controller": { "AHCI.Embedded.1-1": { "ControllerSensor": { "AHCI.Embedded.1-1": {} } }, "AHCI.Embedded.2-1": { "ControllerSensor": { "AHCI.Embedded.2-1": {} } }, "RAID.Slot.6-1": { "ControllerSensor": { "RAID.Slot.6-1": { "ControllerBattery": [ "Battery.Integrated.1:RAID.Slot.6-1" ] } }, "Enclosure": { "Enclosure.Internal.0-1:RAID.Slot.6-1": { "EnclosureSensor": { "Enclosure.Internal.0-1:RAID.Slot.6-1": {} }, "PhysicalDisk": [ "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.6-1", "Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.6-1", "Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.6-1", "Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.6-1", "Disk.Bay.4:Enclosure.Internal.0-1:RAID.Slot.6-1", "Disk.Bay.5:Enclosure.Internal.0-1:RAID.Slot.6-1", "Disk.Bay.6:Enclosure.Internal.0-1:RAID.Slot.6-1" ] } } } } }, "Status": "Success" } } }

=========

ansible --version ansible 2.9.11 config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /global/instserv/ansible/ansible_venv/lib/python3.7/site-packages/ansible executable location = /global/instserv/ansible/ansible_venv/bin/ansible python version = 3.7.8 (default, Jul 27 2020, 10:06:38) [GCC 4.8.5]

-- python --version Python 3.7.8

-- pip freeze ansible==2.9.11 certifi==2020.6.20 cffi==1.14.1 chardet==3.0.4 cryptography==3.0 enum34==1.1.10 future==0.18.2 idna==2.10 ipaddress==1.0.23 Jinja2==2.11.2 MarkupSafe==1.1.1 omsdk==1.2.445 ply==3.11 pyasn1==0.4.8 pycparser==2.20 pycryptodomex==3.9.8 pysmi==0.3.4 pysnmp==4.4.12 pysnmp-mibs==0.1.6 python-version==0.0.2 pyvmomi==7.0 PyYAML==5.3.1 requests==2.24.0 six==1.15.0 urllib3==1.25.10

anupamaloke commented 4 years ago

@janr7, one workaround would be to create both RAID 1 and RAID 5 volumes using a single task. That way, both the volumes will created in one shot.

- name: Create PERC Raid volume
  dellemc_idrac_storage_volume:
    idrac_ip:                  "{{ rmb_address }}"
    idrac_user:                "{{ rmb_username }}"
    idrac_password:            "{{ rmb_password }}"
    state:                     "create"
    raid_reset_config:         "True"
    controller_id:             "RAID.Slot.6-1"
    volumes:
     - name:                  "Virtual-Disk-R1"
       volume_type:           "RAID 1"
       disk_cache_policy:     "Default"
       write_cache_policy:    "WriteBack"
       read_cache_policy:     "ReadAhead"
       raid_init_operation:   "Fast"
       span_length: 2
       span_depth:  1
       number_dedicated_hot_spare: 0
       stripe_size: 131072
       drives:
         id: ["Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.6-1",
              "Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.6-1"]
      - name:                  "Virtual-Disk-r50"
        volume_type:           "RAID 5"
        disk_cache_policy:     "Default"
        write_cache_policy:    "WriteBack"
        read_cache_policy:     "ReadAhead"
        raid_init_operation:   "Fast"
        span_length: 4
        span_depth:  1
        number_dedicated_hot_spare: 0
        stripe_size: 131072
        drives:
         id: ["Disk.Bay.2:Enclosure.Internal.0-1:RAID.Slot.6-1",
              "Disk.Bay.3:Enclosure.Internal.0-1:RAID.Slot.6-1",
              "Disk.Bay.4:Enclosure.Internal.0-1:RAID.Slot.6-1",
              "Disk.Bay.5:Enclosure.Internal.0-1:RAID.Slot.6-1"]
janr7 commented 4 years ago

Hi anupamaloke

Thanks so much, should have done this, will try.

Jan

janr7 commented 4 years ago

Hi anupamaloke

This worked as expected, thanks so much. Appreciated.