| 1 | --- |
| 2 | - name: StoragePool V2 Operations |
| 3 | hosts: localhost |
| 4 | connection: local |
| 5 | gather_facts: false |
| 6 | vars: |
| 7 | hostname: "x.x.x.x" |
| 8 | username: "admin" |
| 9 | password: "Password" |
| 10 | validate_certs: false |
| 11 | |
| 12 | tasks: |
| 13 | - name: Create storagepool |
| 14 | dellemc.powerflex.storagepool_v2: |
| 15 | hostname: "{{ hostname }}" |
| 16 | username: "{{ username }}" |
| 17 | password: "{{ password }}" |
| 18 | validate_certs: "{{ validate_certs }}" |
| 19 | storage_pool_name: "{{ sp_name }}" |
| 20 | protection_domain_name: "{{ domain1 }}" |
| 21 | device_group_name: "{{ dg_name }}" |
| 22 | protection_scheme: "TwoPlusTwo" |
| 23 | compression_method: "Normal" |
| 24 | use_all_available_capacity: true |
| 25 | state: "present" |
| 26 | |
| 27 | - name: Create storagepool with specific capacity |
| 28 | dellemc.powerflex.storagepool_v2: |
| 29 | hostname: "{{ hostname }}" |
| 30 | username: "{{ username }}" |
| 31 | password: "{{ password }}" |
| 32 | validate_certs: "{{ validate_certs }}" |
| 33 | storage_pool_name: "{{ sp_name }}" |
| 34 | protection_domain_name: "{{ domain1 }}" |
| 35 | device_group_name: "{{ dg_name }}" |
| 36 | protection_scheme: "TwoPlusTwo" |
| 37 | compression_method: "Normal" |
| 38 | physical_size_gb: 4096 |
| 39 | state: "present" |
| 40 | |
| 41 | - name: Create storagepool with cap_alert_threshold |
| 42 | register: result |
| 43 | dellemc.powerflex.storagepool_v2: |
| 44 | hostname: "{{ hostname }}" |
| 45 | username: "{{ username }}" |
| 46 | password: "{{ password }}" |
| 47 | validate_certs: "{{ validate_certs }}" |
| 48 | storage_pool_name: "{{ storage_pool_name }}" |
| 49 | protection_domain_name: "{{ protection_domain_name }}" |
| 50 | device_group_name: "{{ device_group_name }}" |
| 51 | protection_scheme: "TwoPlusTwo" |
| 52 | compression_method: "Normal" |
| 53 | use_all_available_capacity: true |
| 54 | cap_alert_thresholds: |
| 55 | high_threshold: 80 |
| 56 | critical_threshold: 90 |
| 57 | over_provisioning_factor: 100 |
| 58 | state: "present" |
| 59 | |
| 60 | - name: Get storagepool details using storagepool id |
| 61 | dellemc.powerflex.storagepool_v2: |
| 62 | hostname: "{{ hostname }}" |
| 63 | username: "{{ username }}" |
| 64 | password: "{{ password }}" |
| 65 | validate_certs: "{{ validate_certs }}" |
| 66 | storage_pool_id: "{{ storage_pool_id }}" |
| 67 | state: "present" |
| 68 | |
| 69 | - name: Modify the physical_size_gb |
| 70 | dellemc.powerflex.storagepool_v2: |
| 71 | hostname: "{{ hostname }}" |
| 72 | username: "{{ username }}" |
| 73 | password: "{{ password }}" |
| 74 | validate_certs: "{{ validate_certs }}" |
| 75 | storage_pool_name: "{{ storage_pool_name }}" |
| 76 | protection_domain_name: "{{ protection_domain_name }}" |
| 77 | physical_size_gb: 6144 |
| 78 | state: "present" |
| 79 | |
| 80 | - name: Modify the cap_alert_thresholds |
| 81 | dellemc.powerflex.storagepool_v2: |
| 82 | hostname: "{{ hostname }}" |
| 83 | username: "{{ username }}" |
| 84 | password: "{{ password }}" |
| 85 | validate_certs: "{{ validate_certs }}" |
| 86 | storage_pool_name: "{{ storage_pool_name }}" |
| 87 | protection_domain_name: "{{ protection_domain_name }}" |
| 88 | cap_alert_thresholds: |
| 89 | high_threshold: 85 |
| 90 | critical_threshold: 95 |
| 91 | state: "present" |
| 92 | |
| 93 | - name: Rename storagepool |
| 94 | dellemc.powerflex.storagepool_v2: |
| 95 | hostname: "{{ hostname }}" |
| 96 | username: "{{ username }}" |
| 97 | password: "{{ password }}" |
| 98 | validate_certs: "{{ validate_certs }}" |
| 99 | storage_pool_id: "{{ storage_pool_id }}" |
| 100 | storage_pool_new_name: "{{ storage_pool_new_name }}" |
| 101 | state: "present" |
| 102 | |
| 103 | - name: Delete storagepool |
| 104 | dellemc.powerflex.storagepool_v2: |
| 105 | hostname: "{{ hostname }}" |
| 106 | username: "{{ username }}" |
| 107 | password: "{{ password }}" |
| 108 | validate_certs: "{{ validate_certs }}" |
| 109 | storage_pool_id: "{{ storage_pool_id }}" |
| 110 | state: "absent" |