summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/powerflex/playbooks/modules/storagepool.yml
blob: 7d407b610470ae76a896eefd8cea3c440c03d206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
- name: Storage Pool Module Operations on PowerFlex
  hosts: localhost
  connection: local
  vars:
    hostname: 'x.x.x.x'
    username: 'admin'
    password: 'Password'
    validate_certs: false
    pool_name: "ansible_test_pool6"
    protection_domain_name: "domain1"

  tasks:
    - name: Create a new Storage pool
      register: result
      dellemc.powerflex.storagepool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        storage_pool_name: "{{ pool_name }}"
        protection_domain_name: "{{ protection_domain_name }}"
        cap_alert_thresholds:
          high_threshold: 30
          critical_threshold: 50
        media_type: "TRANSITIONAL"
        enable_zero_padding: true
        rep_cap_max_ratio: 40
        rmcache_write_handling_mode: "Passthrough"
        spare_percentage: 80
        enable_rebalance: false
        enable_fragmentation: false
        enable_rebuild: false
        use_rmcache: true
        use_rfcache: true
        parallel_rebuild_rebalance_limit: 3
        protected_maintenance_mode_io_priority_policy:
          policy: "unlimited"
        rebalance_io_priority_policy:
          policy: "unlimited"
        vtree_migration_io_priority_policy:
          policy: "limitNumOfConcurrentIos"
          concurrent_ios_per_device: 10
        persistent_checksum:
          enable: false
        state: "present"

    - name: Set pool id
      ansible.builtin.set_fact:
        pool_id: "{{ result.storage_pool_details.id }}"

    - name: Rename Storage pool by id
      dellemc.powerflex.storagepool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        storage_pool_id: "{{ pool_id }}"
        storage_pool_new_name: "new_ansible_pool"
        state: "present"

    - name: Restore the name of Storage pool by id
      dellemc.powerflex.storagepool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        storage_pool_id: "{{ pool_id }}"
        storage_pool_new_name: "{{ pool_name }}"
        state: "present"

    - name: Modify a Storage pool by name
      dellemc.powerflex.storagepool:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        storage_pool_name: "{{ pool_name }}"
        protection_domain_name: "{{ protection_domain_name }}"
        storage_pool_new_name: "pool_name_new"
        cap_alert_thresholds:
          high_threshold: 50
          critical_threshold: 70
        enable_zero_padding: false
        rep_cap_max_ratio: 60
        rmcache_write_handling_mode: "Passthrough"
        spare_percentage: 90
        enable_rebalance: true
        enable_fragmentation: true
        enable_rebuild: true
        use_rmcache: true
        use_rfcache: true
        parallel_rebuild_rebalance_limit: 6
        protected_maintenance_mode_io_priority_policy:
          policy: "limitNumOfConcurrentIos"
          concurrent_ios_per_device: 4
        rebalance_io_priority_policy:
          policy: "favorAppIos"
          concurrent_ios_per_device: 10
          bw_limit_per_device: 4096
        vtree_migration_io_priority_policy:
          policy: "limitNumOfConcurrentIos"
          concurrent_ios_per_device: 10
        persistent_checksum:
          enable: true
          validate_on_read: true
          builder_limit: 1024
        state: "present"