community.general.cs_service_offering (0.1.1) — module

Manages service offerings on Apache CloudStack based clouds.

Authors: René Moser (@resmo)

preview | supported by community

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Create and delete service offerings for guest and system VMs.

Update display_text of existing service offering.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a non-volatile compute service offering with local storage
  cs_service_offering:
    name: Micro
    display_text: Micro 512mb 1cpu
    cpu_number: 1
    cpu_speed: 2198
    memory: 512
    host_tags: eco
    storage_type: local
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a volatile compute service offering with shared storage
  cs_service_offering:
    name: Tiny
    display_text: Tiny 1gb 1cpu
    cpu_number: 1
    cpu_speed: 2198
    memory: 1024
    storage_type: shared
    is_volatile: yes
    host_tags: eco
    storage_tags: eco
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create or update a volatile compute service offering with shared storage
  cs_service_offering:
    name: Tiny
    display_text: Tiny 1gb 1cpu
    cpu_number: 1
    cpu_speed: 2198
    memory: 1024
    storage_type: shared
    is_volatile: yes
    host_tags: eco
    storage_tags: eco
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create or update a custom compute service offering
  cs_service_offering:
    name: custom
    display_text: custom compute offer
    is_customized: yes
    storage_type: shared
    host_tags: eco
    storage_tags: eco
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a compute service offering
  cs_service_offering:
    name: Tiny
    state: absent
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create or update a system offering for the console proxy
  cs_service_offering:
    name: System Offering for Console Proxy 2GB
    display_text: System Offering for Console Proxy 2GB RAM
    is_system: yes
    system_vm_type: consoleproxy
    cpu_number: 1
    cpu_speed: 2198
    memory: 2048
    storage_type: shared
    storage_tags: perf
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a system offering
  cs_service_offering:
    name: System Offering for Console Proxy 2GB
    is_system: yes
    state: absent
  delegate_to: localhost

Inputs

    
name:
    description:
    - Name of the service offering.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the service offering.
    type: str

domain:
    description:
    - Domain the service offering is related to.
    - Public for all domains and subdomains if not set.
    type: str

memory:
    description:
    - The total memory of the service offering in MB.
    type: int

api_key:
    description:
    - API key of the CloudStack API.
    - If not given, the C(CLOUDSTACK_KEY) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

api_url:
    description:
    - URL of the CloudStack API e.g. https://cloud.example.com/client/api.
    - If not given, the C(CLOUDSTACK_ENDPOINT) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

offer_ha:
    default: false
    description:
    - Whether HA is set for the service offering.
    type: bool

cpu_speed:
    description:
    - The CPU speed of the service offering in MHz.
    type: int

host_tags:
    aliases:
    - host_tag
    description:
    - The host tags for this service offering.
    type: list

is_system:
    default: false
    description:
    - Whether it is a system VM offering or not.
    type: bool

api_region:
    default: cloudstack
    description:
    - Name of the ini section in the C(cloustack.ini) file.
    - If not given, the C(CLOUDSTACK_REGION) env variable is considered.
    type: str

api_secret:
    description:
    - Secret key of the CloudStack API.
    - If not set, the C(CLOUDSTACK_SECRET) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

cpu_number:
    description:
    - The number of CPUs of the service offering.
    type: int

api_timeout:
    description:
    - HTTP timeout in seconds.
    - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    - Fallback value is 10 seconds if not specified.
    type: int

is_volatile:
    description:
    - Whether the virtual machine needs to be volatile or not.
    - Every reboot of VM the root disk is detached then destroyed and a fresh root disk
      is created and attached to VM.
    type: bool

display_text:
    description:
    - Display text of the service offering.
    - If not set, I(name) will be used as I(display_text) while creating.
    type: str

network_rate:
    description:
    - Data transfer rate in Mb/s allowed.
    - Supported only for non-system offering and system offerings having I(system_vm_type=domainrouter).
    type: int

storage_tags:
    aliases:
    - storage_tag
    description:
    - The storage tags for this service offering.
    type: list

storage_type:
    choices:
    - local
    - shared
    description:
    - The storage type of the service offering.
    type: str

disk_iops_max:
    description:
    - Max. iops of the compute offering.
    type: int

disk_iops_min:
    description:
    - Min. iops of the compute offering.
    type: int

is_customized:
    description:
    - Whether the offering is customizable or not.
    type: bool

system_vm_type:
    choices:
    - domainrouter
    - consoleproxy
    - secondarystoragevm
    description:
    - The system VM type.
    - Required if I(is_system=yes).
    type: str

api_http_method:
    choices:
    - get
    - post
    description:
    - HTTP method used to query the API endpoint.
    - If not given, the C(CLOUDSTACK_METHOD) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    - Fallback value is C(get) if not specified.
    type: str

limit_cpu_usage:
    description:
    - Restrict the CPU usage to committed service offering.
    type: bool

provisioning_type:
    choices:
    - thin
    - sparse
    - fat
    description:
    - Provisioning type used to create volumes.
    type: str

deployment_planner:
    description:
    - The deployment planner heuristics used to deploy a VM of this offering.
    - If not set, the value of global config I(vm.deployment.planner) is used.
    type: str

is_iops_customized:
    aliases:
    - disk_iops_customized
    description:
    - Whether compute offering iops is custom or not.
    type: bool

disk_iops_read_rate:
    description:
    - IO requests read rate of the disk offering.
    type: int

disk_bytes_read_rate:
    aliases:
    - bytes_read_rate
    description:
    - Bytes read rate of the disk offering.
    type: int

disk_iops_write_rate:
    description:
    - IO requests write rate of the disk offering.
    type: int

disk_bytes_write_rate:
    aliases:
    - bytes_write_rate
    description:
    - Bytes write rate of the disk offering.
    type: int

service_offering_details:
    description:
    - Details for planner, used to store specific parameters.
    - A list of dictionaries having keys C(key) and C(value).
    type: list

hypervisor_snapshot_reserve:
    description:
    - Hypervisor snapshot reserve space as a percent of a volume.
    - Only for managed storage using Xen or VMware.
    type: int

Outputs

cpu_number:
  description: Number of CPUs in the service offering
  returned: success
  sample: 4
  type: int
cpu_speed:
  description: Speed of CPUs in MHz in the service offering
  returned: success
  sample: 2198
  type: int
created:
  description: Date the offering was created
  returned: success
  sample: 2017-11-19T10:48:59+0000
  type: str
disk_bytes_read_rate:
  description: Bytes read rate of the service offering
  returned: success
  sample: 1000
  type: int
disk_bytes_write_rate:
  description: Bytes write rate of the service offering
  returned: success
  sample: 1000
  type: int
disk_iops_max:
  description: Max iops of the disk offering
  returned: success
  sample: 1000
  type: int
disk_iops_min:
  description: Min iops of the disk offering
  returned: success
  sample: 500
  type: int
disk_iops_read_rate:
  description: IO requests per second read rate of the service offering
  returned: success
  sample: 1000
  type: int
disk_iops_write_rate:
  description: IO requests per second write rate of the service offering
  returned: success
  sample: 1000
  type: int
display_text:
  description: Display text of the offering
  returned: success
  sample: Micro 512mb 1cpu
  type: str
domain:
  description: Domain the offering is into
  returned: success
  sample: ROOT
  type: str
host_tags:
  description: List of host tags
  returned: success
  sample:
  - eco
  type: list
id:
  description: UUID of the service offering
  returned: success
  sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f
  type: str
is_customized:
  description: Whether the offering is customizable or not
  returned: success
  sample: false
  type: bool
  version_added: '2.8'
  version_added_collection: community.general
is_iops_customized:
  description: Whether the offering uses custom IOPS or not
  returned: success
  sample: false
  type: bool
is_system:
  description: Whether the offering is for system VMs or not
  returned: success
  sample: false
  type: bool
is_volatile:
  description: Whether the offering is volatile or not
  returned: success
  sample: false
  type: bool
limit_cpu_usage:
  description: Whether the CPU usage is restricted to committed service offering
  returned: success
  sample: false
  type: bool
memory:
  description: Memory of the system offering
  returned: success
  sample: 512
  type: int
name:
  description: Name of the system offering
  returned: success
  sample: Micro
  type: str
network_rate:
  description: Data transfer rate in megabits per second allowed
  returned: success
  sample: 1000
  type: int
offer_ha:
  description: Whether HA support is enabled in the offering or not
  returned: success
  sample: false
  type: bool
provisioning_type:
  description: Provisioning type used to create volumes
  returned: success
  sample: thin
  type: str
service_offering_details:
  description: Additioanl service offering details
  returned: success
  sample: '{''vgpuType'': ''GRID K180Q'',''pciDevice'':''Group of NVIDIA Corporation
    GK107GL [GRID K1] GPUs''}'
  type: dict
storage_tags:
  description: List of storage tags
  returned: success
  sample:
  - eco
  type: list
storage_type:
  description: Storage type used to create volumes
  returned: success
  sample: shared
  type: str
system_vm_type:
  description: System VM type of this offering
  returned: success
  sample: consoleproxy
  type: str