yadro.tatlin_uni.tatlin_sp_resource_block module – Create or modify a block resource

Note

This module is part of the yadro.tatlin_uni collection (version 1.0.0).

You might already have this collection installed if you are using the ansible package. 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 yadro.tatlin_uni.

To use it in a playbook, specify: yadro.tatlin_uni.tatlin_sp_resource_block.

New in version 1.0.0: of yadro.tatlin_uni

Synopsis

  • This module is intended to create new block resource/resources and change existing resource/resources

  • Multiple resources can be created at once with name_template

  • Supports check mode

Parameters

Parameter

Comments

connection

dictionary / required

connection describes Tatlin Storage Processor (SP) connection configuration.

Only session connection supported.

Authorization is executed automatically with corresponding endpoint. ‘auth/login’ by default.

Client receives x-auth-token and uses it for following requests.

base_url

string / required

Tatlin REST API entrypoint.

password

string

Tatlin user password.

timeout

integer

Tatlin REST API request timeout.

Default: 60

username

string

Tatlin username to login.

validate_certs

boolean

Responsible for SSL certificates validation.

If set to False certificates won’t validated.

Choices:

  • no

  • yes ← (default)

host_groups

list / elements=string

Names of the host groups for export resources

hosts

list / elements=string

Names of the hosts for export resources

name

string / required

Name of the resource

name_template

string

Template for bulk mode creation.

Possible formats - ‘1-3’, ‘1-3,4, 7-10’, ‘0-99’

Example - with name_template=’1-3’ and name=’res_’ 3 resources with names ‘res_1’, ‘res_2’, ‘res_3’ will be created

pool

string / required

Name of the pool that includes the resource

ports

list / elements=string

Names of the ports for export resources

read_cache

boolean

Cache reading

Required for creating a new resource

Choices:

  • no

  • yes

size

string

Resource volume

Required if new resource is creating

Can be presented as a string number with postfix For example ‘100 MiB’. Following postfixes are allowed - [B, KB, MB, GB, TB, PB, EB, ZB, YB, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB]

If no postfix is passed, ‘B’ (bytes) will be used

size_format

string

Sector size format

Required for creating a new resource

Choices:

  • 512e

  • 4kn

wait

boolean

Wait until resource or resources will be created

If false, there is no guarantee that task will be successfully completed

Irrelevant for bulk resources changing

Choices:

  • no

  • yes ← (default)

wait_timeout

integer

Number of seconds to wait when wait=true

Default: 300

warning_threshold

integer

Warning alert threshold percentage

write_cache

boolean

Cache writing

Required for creating a new resource

Choices:

  • no

  • yes

Notes

Note

  • Creating resources use bulk mode with asynchronous mode even for single resource. It is possible to wait until creating will be finished by using wait=True or ignore waiting by using wait=False

  • Changing resources in bulk mode is also possible but not in asynchronous mode. It means that at least one request will be send for changing each resource

Examples

---
- name: Create one resource
  yadro.tatlin_uni.tatlin_sp_resource_block:
    connection: "{{ connection }}"
    name: example_resource
    pool: example_pool
    size: 192MiB
    size_format: 512e
    read_cache: true
    write_cache: true
    warning_threshold: 90
    ports:
      - p00
      - p01
    hosts:
      - example_host1
      - example_host2
    host_groups:
      - example_host_group1
      - example_host_group2

- name: Create multiple resources
  yadro.tatlin_uni.tatlin_sp_resource_block:
    connection: "{{ connection }}"
    name: example_resource
    name_template: 1-3,5,7-8
    pool: example_pool
    size: 192MiB
    size_format: 512e
    read_cache: true
    write_cache: true
    warning_threshold: 90
    ports:
      - p00
      - p01
    hosts:
      - example_host1
      - example_host2
    host_groups:
      - example_host_group1
      - example_host_group2

- name: Change one resource
  yadro.tatlin_uni.tatlin_sp_resource_block:
    connection: "{{ connection }}"
    name: example_resource
    pool: example_pool
    size: 192MiB
    read_cache: false
    write_cache: false
    warning_threshold: 80
    ports:
      - p10
    hosts:
      - example_host2
      - example_host3
    host_groups:
      - example_host_group2
      - example_host_group3

- name: Change multiple resources
  yadro.tatlin_uni.tatlin_sp_resource_block:
    connection: "{{ connection }}"
    name: example_resource
    name_template: 1-100
    pool: example_pool
    size: 192MiB
    read_cache: False
    write_cache: False
    warning_threshold: 80
    ports:
      - p10
    hosts:
      - example_host2
      - example_host3
    host_groups:
      - example_host_group2
      - example_host_group3

Return Values

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

Key

Description

changed_resources

list / elements=string

Names of the changed resources

Returned: on success

created_resources

list / elements=string

Names of the created resources

Returned: on success

error

string

Error details if raised

Returned: on error

msg

string

Operation status message

Returned: always

Authors

  • Sergey Kovalev (@kvlvs)