ovirt.ovirt_collection.ovirt_quota (1.0.2) — module

Module to manage datacenter quotas in oVirt/RHV

| "added in version" 1.0.0 of ovirt.ovirt_collection"

Authors: Ondra Machacek (@machacekondra), Martin Necas (@mnecas)

preview | supported by community

Install collection

Install with ansible-galaxy collection install ovirt.ovirt_collection:==1.0.2


Add to requirements.yml

  collections:
    - name: ovirt.ovirt_collection
      version: 1.0.2

Description

Module to manage datacenter quotas in oVirt/RHV


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Examples don't contain auth parameter for simplicity,
# look at ovirt_auth module to see how to reuse authentication:

# Add cluster quota to cluster cluster1 with memory limit 20GiB and CPU limit to 10:
- ovirt_quota:
    name: quota1
    data_center: dcX
    clusters:
        - name: cluster1
          memory: 20
          cpu: 10
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add cluster quota to all clusters with memory limit 30GiB and CPU limit to 15:
- ovirt_quota:
    name: quota2
    data_center: dcX
    clusters:
        - memory: 30
          cpu: 15
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add storage quota to storage data1 with size limit to 100GiB
- ovirt_quota:
    name: quota3
    data_center: dcX
    storage_grace: 40
    storage_threshold: 60
    storages:
        - name: data1
          size: 100
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove quota quota1 (Note the quota must not be assigned to any VM/disk):
- ovirt_quota:
    state: absent
    data_center: dcX
    name: quota1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Change Quota Name
- ovirt_quota:
    id: 00000000-0000-0000-0000-000000000000
    name: "new_quota_name"
    data_center: dcX

Inputs

    
id:
    description:
    - ID of the quota to manage.

auth:
    description:
    - 'Dictionary with values needed to create HTTP/HTTPS connection to oVirt:'
    required: true
    suboptions:
      ca_file:
        description:
        - A PEM file containing the trusted CA certificates.
        - The certificate presented by the server will be verified using these CA certificates.
        - If C(ca_file) parameter is not set, system wide CA certificate store is used.
        - Default value is set by C(OVIRT_CAFILE) environment variable.
        type: str
      headers:
        description:
        - Dictionary of HTTP headers to be added to each API call.
        type: dict
      hostname:
        description:
        - A string containing the hostname of the server, usually something like `I(server.example.com)`.
        - Default value is set by C(OVIRT_HOSTNAME) environment variable.
        - Either C(url) or C(hostname) is required.
        type: str
      insecure:
        description:
        - A boolean flag that indicates if the server TLS certificate and host name should
          be checked.
        type: bool
      kerberos:
        description:
        - A boolean flag indicating if Kerberos authentication should be used instead
          of the default basic authentication.
        type: bool
      password:
        description:
        - The password of the user.
        - Default value is set by C(OVIRT_PASSWORD) environment variable.
        required: true
        type: str
      token:
        description:
        - Token to be used instead of login with username/password.
        - Default value is set by C(OVIRT_TOKEN) environment variable.
        type: str
      url:
        description:
        - A string containing the API URL of the server, usually something like `I(https://server.example.com/ovirt-engine/api)`.
        - Default value is set by C(OVIRT_URL) environment variable.
        - Either C(url) or C(hostname) is required.
        type: str
      username:
        description:
        - The name of the user, something like I(admin@internal).
        - Default value is set by C(OVIRT_USERNAME) environment variable.
        required: true
        type: str
    type: dict

name:
    description:
    - Name of the quota to manage.
    required: true

wait:
    default: true
    description:
    - C(yes) if the module should wait for the entity to get into desired state.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Should the quota be present/absent.

timeout:
    default: 180
    description:
    - The amount of time in seconds the module should wait for the instance to get into
      desired state.
    type: int

clusters:
    description:
    - List of dictionary of cluster limits, which is valid to specific cluster.
    - 'If cluster isn''t specified it''s valid to all clusters in system:'
    suboptions:
      cluster:
        description:
        - Name of the cluster.
      cpu:
        description:
        - CPU limit.
      memory:
        description:
        - Memory limit (in GiB).

storages:
    description:
    - List of dictionary of storage limits, which is valid to specific storage.
    - 'If storage isn''t specified it''s valid to all storages in system:'
    suboptions:
      size:
        description:
        - Size limit (in GiB).
      storage:
        description:
        - Name of the storage.

data_center:
    description:
    - Name of the datacenter where quota should be managed.
    required: true

description:
    description:
    - Description of the quota to manage.

fetch_nested:
    description:
    - If I(True) the module will fetch additional data from the API.
    - It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch
      other attributes of the nested entities by specifying C(nested_attributes).
    type: bool

cluster_grace:
    aliases:
    - cluster_hard_limit
    description:
    - Cluster grace(hard limit) defined in percentage (1-100).

poll_interval:
    default: 3
    description:
    - Number of the seconds the module waits until another poll request on entity status
      is sent.
    type: int

storage_grace:
    aliases:
    - storage_hard_limit
    description:
    - Storage grace(hard limit) defined in percentage (1-100).

cluster_threshold:
    aliases:
    - cluster_soft_limit
    description:
    - Cluster threshold(soft limit) defined in percentage (0-100).

nested_attributes:
    description:
    - Specifies list of the attributes which should be fetched from the API.
    - This parameter apply only when C(fetch_nested) is I(true).
    type: list

storage_threshold:
    aliases:
    - storage_soft_limit
    description:
    - Storage threshold(soft limit) defined in percentage (0-100).

Outputs

id:
  description: ID of the quota which is managed
  returned: On success if quota is found.
  sample: 7de90f31-222c-436c-a1ca-7e655bd5b60c
  type: str
quota:
  description: 'Dictionary of all the quota attributes. Quota attributes can be found
    on your oVirt/RHV instance at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/quota.'
  returned: On success if quota is found.
  type: dict