huawei.enterprise.hw_enterprise_smart_qos module – Smart qos operations for Huawei Enterprise Storage

Note

This module is part of the huawei.enterprise collection (version 2.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install huawei.enterprise.

To use it in a playbook, specify: huawei.enterprise.hw_enterprise_smart_qos.

Synopsis

  • Supports the provisioning operations on a Smart qos such as create, modify, activate, deactivate, associate, disassociate, delete and get the details of a smart qos.

Parameters

Parameter

Comments

associate_obj_id_list

list / elements=string

Object id, Required for associate and disassociate operation.

associate_obj_type

string

Object type, Required for associate and disassociate operation.

Choices:

  • "host"

  • "lun_group"

  • "smart_qos"

burst_bandwidth

string

Maximum burst bandwidth, Optional parameters for create and modify operation.

The value is an integer ranging from 1 to 999,999,999, expressed in MB/s.

burst_iops

string

Maximum burst IOPS, Optional parameters for create and modify operation.

The value is an integer ranging from 100 to 999,999,999.

burst_time

string

Burst time, Optional parameters for create and modify operation.

The value is an integer ranging from 1 to 999,999,999 (unit:second).

When either one of the burst_bandwidth and burst_iops is delivered, this field must be delivered.

cycle_set

list / elements=integer

Cycle period of a SmartQoS policy, Optional parameters for create and modify operation.

The value is an int array.The cycle period is expressed in days when schedule_policy is set to weekly. 0 to 6 map to Sunday to Saturday.

This field is mandatory when schedule_policy is set to weekly.

description

string

Smart qos description.

duration

string

Validity period of SmartQoS policy settings, Required for create operation, Optional parameters for modify operation.

The value is smaller than 24 hours.

filter

list / elements=string

Parameter required for all query operations.

The response will include the storage parameters that match the indicate filter criteria.

Choices:

  • "id"

  • "name"

  • "vstore_name"

  • "vstore_id"

  • "health_status"

  • "running_status"

  • "max_bandwidth"

  • "max_iops"

  • "min_bandwidth"

  • "min_iops"

  • "class_type"

  • "parent_policy_name"

  • "schedule_policy"

  • "schedule_start_time"

  • "start_time"

  • "duration"

  • "description"

  • "lun_list"

  • "priority"

  • "cycle_set"

  • "burst_bandwidth"

  • "burst_iops"

  • "burst_time"

  • "latency"

  • "fs_list"

  • "enable_status"

  • "max_read_bandwidth"

  • "max_write_bandwidth"

  • "max_read_iops"

  • "max_write_iops"

fs_list

list / elements=string

List of file system ids in a SmartQoS policy, Optional parameters for create and modify operation.

This field contains a maximum of 512 file system IDs and is mutually exclusive with lun_list.

File systems and LUNs/LUN snapshots cannot coexist in one SmartQoS policy.

host_list

list / elements=string

list of host ids in a smart qos policy, Optional parameters for create operation.

id

string

Smart qos unique id, Mutually exclusive with name, Priority is higher than name.

io_type

string

I/O property information in a SmartQoS policy, Optional parameters for create and modify operation.

Choices:

  • "read_and_write"

  • "read_or_write"

latency

integer

I/O latency, Optional parameters for create and modify operation.

The value can be “500” or “1500”.

lun_list

list / elements=string

list of lun ids in a smart qos policy, Optional parameters for create and modify operation.

max_bandwidth

integer

Maximum bandwidth of a smart qos policy, Optional parameters for create and modify operation.

The value is an integer ranging from 1 to 999,999,999, expressed in MB/s.

max_iops

integer

Maximum IOPS of a SmartQoS policy, Optional parameters for create and modify operation.

The value is an integer ranging from 100 to 999,999,999.

max_read_bandwidth

integer

Maximum read I/O bandwidth for a SmartQoS policy, Optional parameters for create and modify operation.

The value is an integer ranging from 100 to 999,999,999.

max_read_iops

integer

Maximum IOPS of read I/Os for a SmartQoS policy, Optional parameters for create and modify operation.

The value is an integer ranging from 100 to 999,999,999.

max_write_bandwidth

integer

Maximum read I/O bandwidth for a SmartQoS policy, Optional parameters for create and modify operation.

The value is an integer ranging from 100 to 999,999,999.

max_write_iops

integer

Maximum IOPS of write I/Os for a SmartQoS policy, Optional parameters for create and modify operation.

The value is an integer ranging from 100 to 999,999,999.

min_bandwidth

integer

Minimum bandwidth, Optional parameters for create and modify operation.

The value is an integer ranging from 1 to 999,999,999, expressed in MB/s.

min_iops

integer

Minimum IOPS, Optional parameters for create and modify operation.

The value is an integer ranging from 100 to 999,999,999.

name

string

Smart qos unique name, Required for create operation. Mutually exclusive with id.

new_name

string

Smart qos unique new name, optional parameters for modify operation.

operation

string

Required for activate, associate, deactivate, disassociate operation.

Choices:

  • "activate"

  • "associate"

  • "deactivate"

  • "disassociate"

policy_type

string

Policy type, Optional parameters for create operation.

Choices:

  • "normal"

  • "hierarchical"

priority

string

Priority of a SmartQoS policy, Optional parameters for create and modify operation.

When the priority of a SmartQoS policy is set to high, the performance objective of the SmartQoS policy is ensured first.

The default value is normal.

Choices:

  • "normal"

  • "high"

schedule_policy

string

Scheduling policy, Required for create operation, Optional parameters for modify operation.

Choices:

  • "once"

  • "daily"

  • "weekly"

schedule_start_time

string

Date (UTC) for SmartQoS policy settings to take effect, Required for create operation, Optional parameters for modify operation.

The hour, minute, and second are ignored, and only the values of the year, month, and day are effective (UTC time).

start_time

string

Time for SmartQoS policy settings to take effect, Required for create operation, Optional parameters for modify operation.

The time is returned in the hh:mm format.

state

string / required

Define whether the smart qos should exist or not.

Choices:

  • "absent"

  • "present"

vstore_id

string

id of storage vstore.

It defaults to 0:SystemVstore if not specified.

Notes

Note

  • The check_mode is not supported.

  • One of the max_bandwidth, max_iops, min_bandwidth, min_iops, latency must be set.

  • The duration should be greater than or equal to 30 minutes.

  • When io_type is set to read_or_write, at least one of max_read_iops, max_read_bandwidth, max_write_iops and max_write_bandwidth must be set.

Examples

---
  tasks:
    - name: Create SmartQos
      register: create_smart_qos_info
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< smart_qos_name >"
        schedule_policy: "< once | daily | weekly >"
        schedule_start_time: "< schedule_start_time >"
        start_time: "< start_time >"
        duration: "< duration >"
        vstore_id: "< vstore_id >"
        description: "< description >"
        io_type: "< read_and_write | read_or_write >"
        lun_list:
          - "< lun_id1 >"
          - "< lun_id2 >"
        max_bandwidth: "< max_bandwidth_value >"
        max_iops: "< max_iops_value >"
        priority: "< normal | high >"
        cycle_set:
          - "< 0 >"
          - "< 1 >"
          - "< 2 >"
          - "< 3 >"
          - "< 4 >"
          - "< 5 >"
          - "< 6 >"
        policy_type: "< normal | hierarchical >"
        burst_bandwidth: "< burst_bandwidth_value >"
        burst_iops: "< burst_iops_value >"
        burst_time: "< burst_time >"
        host_list:
          - "< host_id1 >"
          - "< host_id2 >"
        min_bandwidth: "< min_bandwidth_value >"
        min_iops: "< min_iops_value >"
        latency: "< 500 | 1500 >"
        fs_list:
          - "< fs_id1 >"
          - "< fs_id2 >"
        max_read_bandwidth: "< max_read_bandwidth_value >"
        max_write_bandwidth: "< max_write_bandwidth_value >"
        max_read_iops: "< max_read_iops_value >"
        max_write_iops: "< max_write_iops_value >"
        state: "present"

    - name: Modify SmartQos By Id
      register: modify_smart_qos_info
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_smart_qos_info.smart_qos_detail.id }}"
        new_name: "< smart_qos_new_name >"
        schedule_policy: "< once | daily | weekly >"
        schedule_start_time: "< schedule_start_time >"
        start_time: "< start_time >"
        duration: "< duration >"
        description: "< description >"
        io_type: "< read_and_write | read_or_write >"
        lun_list:
          - "< lun_id1 >"
          - "< lun_id2 >"
        max_bandwidth: "< max_bandwidth_value >"
        max_iops: "< max_iops_value >"
        priority: "< normal | high >"
        cycle_set:
          - "< 0 >"
          - "< 1 >"
          - "< 2 >"
          - "< 3 >"
          - "< 4 >"
          - "< 5 >"
          - "< 6 >"
        burst_bandwidth: "< burst_bandwidth_value >"
        burst_iops: "< burst_iops_value >"
        burst_time: "< burst_time >"
        min_bandwidth: "< min_bandwidth_value >"
        min_iops: "< min_iops_value >"
        latency: "< 500 | 1500 >"
        fs_list:
          - "< fs_id1 >"
          - "< fs_id2 >"
        max_read_bandwidth: "< max_read_bandwidth_value >"
        max_write_bandwidth: "< max_write_bandwidth_value >"
        max_read_iops: "< max_read_iops_value >"
        max_write_iops: "< max_write_iops_value >"
        state: "present"

    - name: Modify SmartQos By Name
      register: modify_smart_qos_info
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< smart_qos_name >"
        new_name: "< smart_qos_new_name >"
        schedule_policy: "< once | daily | weekly >"
        schedule_start_time: "< schedule_start_time >"
        start_time: "< start_time >"
        duration: "< duration >"
        vstore_id: "< vstore_id >"
        description: "< description >"
        io_type: "< read_and_write | read_or_write >"
        lun_list:
          - "< lun_id1 >"
          - "< lun_id2 >"
        max_bandwidth: "< max_bandwidth_value >"
        max_iops: "< max_iops_value >"
        priority: "< normal | high >"
        cycle_set:
          - "< 0 >"
          - "< 1 >"
          - "< 2 >"
          - "< 3 >"
          - "< 4 >"
          - "< 5 >"
          - "< 6 >"
        burst_bandwidth: "< burst_bandwidth_value >"
        burst_iops: "< burst_iops_value >"
        burst_time: "< burst_time >"
        min_bandwidth: "< min_bandwidth_value >"
        min_iops: "< min_iops_value >"
        latency: "< 500 | 1500 >"
        fs_list:
          - "< fs_id1 >"
          - "< fs_id2 >"
        max_read_bandwidth: "< max_read_bandwidth_value >"
        max_write_bandwidth: "< max_write_bandwidth_value >"
        max_read_iops: "< max_read_iops_value >"
        max_write_iops: "< max_write_iops_value >"
        state: "present"

    - name: Query SmartQos Detail By Name
      register: query_smart_qos_info
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< smart_qos_name >"
        vstore_id: "< vstore_id >"
        filter:
          - id
          - name
          - vstore_name
          - vstore_id
          - health_status
          - running_status
          - max_bandwidth
          - max_iops
          - min_bandwidth
          - min_iops
          - class_type
          - parent_policy_name
          - schedule_policy
          - schedule_start_time
          - start_time
          - duration
          - description
          - lun_list
          - priority
          - cycle_set
          - burst_bandwidth
          - burst_iops
          - burst_time
          - latency
          - fs_list
          - enable_status
          - io_type
          - max_read_bandwidth
          - max_write_bandwidth
          - max_read_iops
          - max_write_iops
        state: "present"

    - name: Query SmartQos Detail By Id
      register: query_smart_qos_info
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_smart_qos_info.smart_qos_detail.id }}"
        filter:
          - id
          - name
          - vstore_name
          - vstore_id
          - health_status
          - running_status
          - max_bandwidth
          - max_iops
          - min_bandwidth
          - min_iops
          - class_type
          - parent_policy_name
          - schedule_policy
          - schedule_start_time
          - start_time
          - duration
          - description
          - lun_list
          - priority
          - cycle_set
          - burst_bandwidth
          - burst_iops
          - burst_time
          - latency
          - fs_list
          - enable_status
          - io_type
          - max_read_bandwidth
          - max_write_bandwidth
          - max_read_iops
          - max_write_iops
        state: "present"

    - name: Query All SmartQos Detail
      register: all_smart_qos_info
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        vstore_id: "< vstore_id >"
        filter:
          - id
          - name
          - vstore_name
          - vstore_id
          - health_status
          - running_status
          - max_bandwidth
          - max_iops
          - min_bandwidth
          - min_iops
          - class_type
          - parent_policy_name
          - schedule_policy
          - schedule_start_time
          - start_time
          - duration
          - description
          - lun_list
          - priority
          - cycle_set
          - burst_bandwidth
          - burst_iops
          - burst_time
          - latency
          - fs_list
          - enable_status
          - io_type
          - max_read_bandwidth
          - max_write_bandwidth
          - max_read_iops
          - max_write_iops
        state: "present"

    - name: Delete SmartQos By Name
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< smart_qos_name >"
        vstore_id: "< vstore_id >"
        state: "absent"

    - name: Delete SmartQos By Id
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_smart_qos_info.smart_qos_detail.id }}"
        state: "absent"

    - name: Activate SmartQos By Name
      register: activate_smart_qos_by_name
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< smart_qos_name >"
        operation: "activate"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Activate SmartQos By Id
      register: activate_smart_qos_by_id
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_smart_qos_info.smart_qos_detail.id }}"
        operation: "activate"
        state: "present"

    - name: DeActivate SmartQos By Name
      register: deactivate_smart_qos_by_name
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< smart_qos_name >"
        operation: "deactivate"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: DeActivate SmartQos By Id
      register: deactivate_smart_qos_by_id
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_smart_qos_info.smart_qos_detail.id }}"
        operation: "deactivate"
        state: "present"

    - name: Create SmartQos Associate By Name
      register: create_smart_qos_associate
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< smart_qos_name >"
        operation: "associate"
        associate_obj_id_list:
          - "< object_id1 >"
          - "< object_id2 >"
        associate_obj_type: "< host | smart_qos | lun_group >"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Create SmartQos Associate By Id
      register: create_smart_qos_associate
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_smart_qos_info.smart_qos_detail.id }}"
        operation: "associate"
        associate_obj_id_list:
          - "< object_id1 >"
          - "< object_id2 >"
        associate_obj_type: "< host | smart_qos | lun_group >"
        state: "present"

    - name: Remove SmartQos Associate By Name
      register: remove_smart_qos_associate
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< smart_qos_name >"
        operation: "disassociate"
        associate_obj_id_list:
          - "< object_id1 >"
          - "< object_id2 >"
        associate_obj_type: "< host | smart_qos | lun_group >"
        vstore_id: "< vstore_id >"
        state: "present"

    - name: Remove SmartQos Associate By Id
      register: remove_smart_qos_associate
      huawei.enterprise.hw_enterprise_smart_qos:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        id: "{{ query_smart_qos_info.smart_qos_detail.id }}"
        operation: "disassociate"
        associate_obj_id_list:
          - "< object_id1 >"
          - "< object_id2 >"
        associate_obj_type: "< host | smart_qos | lun_group >"
        state: "present"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

actions

list / elements=string

playbook action lists

Returned: always

Sample: ["create"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

remark

string

task execute remark

Returned: always

Sample: "Smart qos sample_smart_qos create successfully"

smart_qos_detail

complex

Details of the smart qos.

Returned: When smart qos exists

Sample: {"health_status": "normal", "id": "1", "max_bandwidth": "10(MB/s)", "max_iops": "5", "min_bandwidth": "15(MB/s)", "min_iops": "5", "name": "sample_smart_qos", "running_status": "running", "vstore_id": 1, "vstore_name": "vstore_name"}

health_status

string

Health status.

Returned: always

id

string

The system generated ID given to the smart qos.

Returned: always

max_bandwidth

string

Max bandwidth.

Returned: always

max_iops

string

Max iops.

Returned: always

min_bandwidth

string

Min bandwidth.

Returned: always

min_iops

string

Min iops.

Returned: always

name

string

Name of the smart qos.

Returned: always

running_status

string

Running status.

Returned: always

vstore_id

string

Vstore id.

Returned: always

vstore_name

string

Vstore name.

Returned: always

Authors

  • Huawei eSDK Ansible Team