community.general.hwc_evs_disk (8.5.0) — module

Creates a resource of Evs/Disk in Huawei Cloud

| "added in version" 0.2.0 of community.general"

Authors: Huawei Inc. (@huaweicloud)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

block storage management.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# test create disk
- name: Create a disk
  community.general.hwc_evs_disk:
    availability_zone: "cn-north-1a"
    name: "ansible_evs_disk_test"
    volume_type: "SATA"
    size: 10

Inputs

    
id:
    description:
    - The ID of resource to be managed.
    type: str

name:
    description:
    - Specifies the disk name. The value can contain a maximum of 255 bytes.
    required: true
    type: str

size:
    description:
    - Specifies the disk size, in GB. Its values are as follows, System disk 1 GB to 1024
      GB, Data disk 10 GB to 32768 GB. This parameter is mandatory when you create an
      empty disk or use an image or a snapshot to create a disk. If you use an image or
      a snapshot to create a disk, the disk size must be greater than or equal to the
      image or snapshot size. This parameter is optional when you use a backup to create
      a disk. If this parameter is not specified, the disk size is equal to the backup
      size.
    required: false
    type: int

user:
    description:
    - The user name to login with.
    - Currently only user names are supported, and not user IDs.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the given object should exist in Huaweicloud Cloud.
    type: str

domain:
    description:
    - The name of the Domain to scope to (Identity v3).
    - Currently only domain names are supported, and not domain IDs.
    required: true
    type: str

region:
    description:
    - The region to which the project belongs.
    type: str

project:
    description:
    - The name of the Tenant (Identity v2) or Project (Identity v3).
    - Currently only project names are supported, and not project IDs.
    required: true
    type: str

image_id:
    description:
    - Specifies the image ID. If this parameter is specified, the disk is created from
      an image. BMS system disks cannot be created from BMS images.
    required: false
    type: str

password:
    description:
    - The password to login with.
    required: true
    type: str

timeouts:
    default: {}
    description:
    - The timeouts for each operations.
    suboptions:
      create:
        default: 30m
        description:
        - The timeouts for create operation.
        type: str
      delete:
        default: 30m
        description:
        - The timeouts for delete operation.
        type: str
      update:
        default: 30m
        description:
        - The timeouts for update operation.
        type: str
    type: dict

backup_id:
    description:
    - Specifies the ID of the backup that can be used to create a disk. This parameter
      is mandatory when you use a backup to create the disk.
    required: false
    type: str

description:
    description:
    - Specifies the disk description. The value can contain a maximum of 255 bytes.
    required: false
    type: str

enable_scsi:
    description:
    - If this parameter is set to True, the disk device type will be SCSI, which allows
      ECS OSs to directly access underlying storage media. SCSI reservation command is
      supported. If this parameter is set to False, the disk device type will be VBD,
      which supports only simple SCSI read/write commands.
    - If parameter enable_share is set to True and this parameter is not specified, shared
      SCSI disks are created. SCSI EVS disks cannot be created from backups, which means
      that this parameter cannot be True if backup_id has been specified.
    required: false
    type: bool

snapshot_id:
    description:
    - Specifies the snapshot ID. If this parameter is specified, the disk is created from
      a snapshot.
    required: false
    type: str

volume_type:
    description:
    - Specifies the disk type. Currently, the value can be SSD, SAS, or SATA.
    - SSD specifies the ultra-high I/O disk type.
    - SAS specifies the high I/O disk type.
    - SATA specifies the common I/O disk type.
    - If the specified disk type is not available in the AZ, the disk will fail to create.
      If the EVS disk is created from a snapshot, the volume_type field must be the same
      as that of the snapshot's source disk.
    required: true
    type: str

enable_share:
    description:
    - Specifies whether the disk is shareable. The default value is False.
    required: false
    type: bool

encryption_id:
    description:
    - Specifies the encryption ID. The length of it fixes at 36 bytes.
    required: false
    type: str

availability_zone:
    description:
    - Specifies the AZ where you want to create the disk.
    required: true
    type: str

enable_full_clone:
    description:
    - If the disk is created from a snapshot and linked cloning needs to be used, set
      this parameter to True.
    required: false
    type: bool

identity_endpoint:
    description:
    - The Identity authentication URL.
    required: true
    type: str

enterprise_project_id:
    description:
    - Specifies the enterprise project ID. This ID is associated with the disk during
      the disk creation. If it is not specified, the disk is bound to the default enterprise
      project.
    required: false
    type: str

Outputs

attachments:
  contains:
    attached_at:
      description:
      - Specifies the time when the disk was attached. Time format is 'UTC YYYY-MM-DDTHH:MM:SS'.
      returned: success
      type: str
    attachment_id:
      description:
      - Specifies the ID of the attachment information.
      returned: success
      type: str
    device:
      description:
      - Specifies the device name.
      returned: success
      type: str
    server_id:
      description:
      - Specifies the ID of the server to which the disk is attached.
      returned: success
      type: str
  description:
  - Specifies the disk attachment information.
  returned: success
  type: complex
availability_zone:
  description:
  - Specifies the AZ where you want to create the disk.
  returned: success
  type: str
backup_id:
  description:
  - Specifies the ID of the backup that can be used to create a disk. This parameter
    is mandatory when you use a backup to create the disk.
  returned: success
  type: str
backup_policy_id:
  description:
  - Specifies the backup policy ID.
  returned: success
  type: str
created_at:
  description:
  - Specifies the time when the disk was created. Time format is 'UTC YYYY-MM-DDTHH:MM:SS'.
  returned: success
  type: str
description:
  description:
  - Specifies the disk description. The value can contain a maximum of 255 bytes.
  returned: success
  type: str
enable_full_clone:
  description:
  - If the disk is created from a snapshot and linked cloning needs to be used, set
    this parameter to True.
  returned: success
  type: bool
enable_scsi:
  description:
  - If this parameter is set to True, the disk device type will be SCSI, which allows
    ECS OSs to directly access underlying storage media. SCSI reservation command
    is supported. If this parameter is set to False, the disk device type will be
    VBD, which supports only simple SCSI read/write commands.
  - If parameter enable_share is set to True and this parameter is not specified,
    shared SCSI disks are created. SCSI EVS disks cannot be created from backups,
    which means that this parameter cannot be True if backup_id has been specified.
  returned: success
  type: bool
enable_share:
  description:
  - Specifies whether the disk is shareable. The default value is False.
  returned: success
  type: bool
encryption_id:
  description:
  - Specifies the encryption ID. The length of it fixes at 36 bytes.
  returned: success
  type: str
enterprise_project_id:
  description:
  - Specifies the enterprise project ID. This ID is associated with the disk during
    the disk creation. If it is not specified, the disk is bound to the default enterprise
    project.
  returned: success
  type: str
image_id:
  description:
  - Specifies the image ID. If this parameter is specified, the disk is created from
    an image. BMS system disks cannot be created from BMS images.
  returned: success
  type: str
is_bootable:
  description:
  - Specifies whether the disk is bootable.
  returned: success
  type: bool
is_readonly:
  description:
  - Specifies whether the disk is read-only or read/write. True indicates that the
    disk is read-only. False indicates that the disk is read/write.
  returned: success
  type: bool
name:
  description:
  - Specifies the disk name. The value can contain a maximum of 255 bytes.
  returned: success
  type: str
size:
  description:
  - Specifies the disk size, in GB. Its values are as follows, System disk 1 GB to
    1024 GB, Data disk 10 GB to 32768 GB. This parameter is mandatory when you create
    an empty disk or use an image or a snapshot to create a disk. If you use an image
    or a snapshot to create a disk, the disk size must be greater than or equal to
    the image or snapshot size. This parameter is optional when you use a backup to
    create a disk. If this parameter is not specified, the disk size is equal to the
    backup size.
  returned: success
  type: int
snapshot_id:
  description:
  - Specifies the snapshot ID. If this parameter is specified, the disk is created
    from a snapshot.
  returned: success
  type: str
source_volume_id:
  description:
  - Specifies the source disk ID. This parameter has a value if the disk is created
    from a source disk.
  returned: success
  type: str
status:
  description:
  - Specifies the disk status.
  returned: success
  type: str
tags:
  description:
  - Specifies the disk tags.
  returned: success
  type: dict
volume_type:
  description:
  - Specifies the disk type. Currently, the value can be SSD, SAS, or SATA.
  - SSD specifies the ultra-high I/O disk type.
  - SAS specifies the high I/O disk type.
  - SATA specifies the common I/O disk type.
  - If the specified disk type is not available in the AZ, the disk will fail to create.
    If the EVS disk is created from a snapshot, the volume_type field must be the
    same as that of the snapshot's source disk.
  returned: success
  type: str