dell / ansible-powerstore

Ansible Modules for Dell PowerStore
GNU General Public License v3.0
33 stars 24 forks source link

[BUG]: Volume size and host map cannot be completed in same call #62

Open zb-4W145 opened 2 days ago

zb-4W145 commented 2 days ago

Describe the bug Once I have created a volume that is mapped to a host group in a task using dellemc.powerstore.volume. Once this task is reran with a change to say the size increasing from 100GB to 150GB this causes Ansible to fail, with the output: "Volume modification and host mapping cannot be done in the same call". Nothing is changing when it comes to mapping just a size increase. While this looks like a error output that has been purposefully created, it is not referenced in the docs. Hopefully, the volume module should be able to manage all aspects of the volume in a single call, to save breaking out a single call to multiple with a data collection to validate what type of task you are completing then run multiple different smaller calls to the same module.

To Reproduce Steps to reproduce the behavior:

  1. Create a volume, snippet of my code:
- name: Manage volumes in powerstore - {{ volume.vol_name }}
  dellemc.powerstore.volume:
    array_ip: "{{ inventory_hostname }}"
    user: "{{ powerstore_username }}"
    password: "{{ powerstore_password }}"
    validate_certs: "{{ validate_certs }}"
    vol_name: "{{ volume.vol_name }}"
    cap_unit: "{{ volume.size[-2:] }}"
    size: "{{ volume.size[:-2] }}"
    host: "{{ volume.target_host | default(omit) }}"
    hostgroup: "{{ volume.target_host_group | default(omit) }}"
    mapping_state: "{{ 'mapped' if volume.target_host_group is defined or volume.target_host is defined else omit }}"
    vg_name: "{{ volume.volume_group | default(omit) }}"
    state: present
  when: not ansible_check_mode

Passed data:

volume:
   vol_name: test_vol
   size: 100GB
   hostgroup: test_hostgroup
  1. Increase volumes size:
volume:
   vol_name: test_vol
   size: 150GB
   hostgroup: test_hostgroup
  1. See error

Expected behaviour Ideally this should increase the size of the volumes as nothing is changing with the mapping then this should trigger any attempted change to map, then not issue in the eyes of the error that was outputted?

Screenshots

Logs

fatal: [host.place.com]: FAILED! => changed=false 
  invocation:
    module_args:
      app_type: null
      app_type_other: null
      appliance_id: null
      appliance_name: null
      array_ip: powerstoreArray1.place.com
      backup_snap_profile: null
      cap_unit: GB
      clone_volume: null
      create_backup_snap: null
      delete_remote_volume: null
      description: null
      end_metro_config: false
      hlu: null
      host: null
      hostgroup: test_hostgroup
      mapping_state: mapped
      new_name: null
      password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
      performance_policy: null
      port: null
      protection_policy: null
      remote_appliance_id: null
      remote_system: null
      size: 150.0
      source_snap: null
      source_volume: null
      state: present
      timeout: 120
      user: admin
      validate_certs: false
      vg_name: null
      vol_id: null
      vol_name: test_vol
  msg: Volume modification and host mapping cannot be done in the same call

System Information (please complete the following information):