community.vmware.vmware_datastore_cluster (4.2.0) — module

Manage VMware vSphere datastore clusters

Authors: Abhijeet Kasurde (@Akasurde)

Install collection

Install with ansible-galaxy collection install community.vmware:==4.2.0


Add to requirements.yml

  collections:
    - name: community.vmware
      version: 4.2.0

Description

This module can be used to add and delete datastore cluster in given VMware environment.

All parameters and VMware object values are case sensitive.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create datastore cluster and enable SDRS
  community.vmware.vmware_datastore_cluster:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    datacenter_name: '{{ datacenter_name }}'
    datastore_cluster_name: '{{ datastore_cluster_name }}'
    enable_sdrs: true
    state: present
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create datastore cluster using folder
  community.vmware.vmware_datastore_cluster:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    folder: '/{{ datacenter_name }}/datastore/ds_folder'
    datastore_cluster_name: '{{ datastore_cluster_name }}'
    state: present
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete datastore cluster
  community.vmware.vmware_datastore_cluster:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    datacenter_name: '{{ datacenter_name }}'
    datastore_cluster_name: '{{ datastore_cluster_name }}'
    state: absent
  delegate_to: localhost

Inputs

    
port:
    default: 443
    description:
    - The port number of the vSphere vCenter or ESXi server.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_PORT)
      will be used instead.
    type: int

state:
    choices:
    - present
    - absent
    default: present
    description:
    - If the datastore cluster should be present or absent.
    type: str

folder:
    description:
    - Destination folder, absolute path to place datastore cluster in.
    - The folder should include the datacenter.
    - This parameter is case sensitive.
    - You must specify either a O(folder) or a O(datacenter_name).
    - 'Examples:'
    - '   folder: /datacenter1/datastore'
    - '   folder: datacenter1/datastore'
    - '   folder: /datacenter1/datastore/folder1'
    - '   folder: datacenter1/datastore/folder1'
    - '   folder: /folder1/datacenter1/datastore'
    - '   folder: folder1/datacenter1/datastore'
    - '   folder: /folder1/datacenter1/datastore/folder2'
    required: false
    type: str

hostname:
    description:
    - The hostname or IP address of the vSphere vCenter or ESXi server.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_HOST)
      will be used instead.
    type: str

password:
    aliases:
    - pass
    - pwd
    description:
    - The password of the vSphere vCenter or ESXi server.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_PASSWORD)
      will be used instead.
    type: str

username:
    aliases:
    - admin
    - user
    description:
    - The username of the vSphere vCenter or ESXi server.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_USER)
      will be used instead.
    type: str

proxy_host:
    description:
    - Address of a proxy that will receive all HTTPS requests and relay them.
    - The format is a hostname or a IP.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_PROXY_HOST)
      will be used instead.
    required: false
    type: str

proxy_port:
    description:
    - Port of the HTTP proxy that will receive all HTTPS requests and relay them.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_PROXY_PORT)
      will be used instead.
    required: false
    type: int

enable_sdrs:
    default: false
    description:
    - Whether or not storage DRS is enabled.
    required: false
    type: bool

validate_certs:
    default: true
    description:
    - Allows connection when SSL certificates are not valid. Set to V(false) when certificates
      are not trusted.
    - If the value is not specified in the task, the value of environment variable E(VMWARE_VALIDATE_CERTS)
      will be used instead.
    type: bool

datacenter_name:
    aliases:
    - datacenter
    description:
    - The name of the datacenter.
    - You must specify either a O(datacenter_name) or a O(folder).
    - Mutually exclusive with O(folder) parameter.
    required: false
    type: str

automation_level:
    choices:
    - automated
    - manual
    default: manual
    description:
    - Run SDRS automated or manually.
    required: false
    type: str

keep_vmdks_together:
    default: true
    description:
    - Specifies whether or not each VM in this datastore cluster should have its virtual
      disks on the same datastore by default.
    required: false
    type: bool

loadbalance_interval:
    default: 480
    description:
    - Specify the interval in minutes that storage DRS runs to load balance among datastores.
    required: false
    type: int

enable_io_loadbalance:
    default: false
    description:
    - Whether or not storage DRS takes into account storage I/O workload when making load
      balancing and initial placement recommendations.
    required: false
    type: bool

datastore_cluster_name:
    description:
    - The name of the datastore cluster.
    required: true
    type: str

Outputs

result:
  description: information about datastore cluster operation
  returned: always
  sample: Datastore cluster 'DSC2' created successfully.
  type: str