ngine_io.cloudstack.cs_service_offering module – Manages service offerings on Apache CloudStack based clouds.
Note
This module is part of the ngine_io.cloudstack collection (version 2.2.4).
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 ngine_io.cloudstack
.
To use it in a playbook, specify: ngine_io.cloudstack.cs_service_offering
.
New in version 0.1.0: of ngine_io.cloudstack
Synopsis
Create and delete service offerings for guest and system VMs.
Update display_text of existing service offering.
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.6
cs >= 0.9.0
Parameters
Parameter |
Comments |
---|---|
HTTP method used to query the API endpoint. If not given, the Choices:
|
|
API key of the CloudStack API. If not given, the |
|
Secret key of the CloudStack API. If not set, the |
|
HTTP timeout in seconds. If not given, the Default: 10 |
|
URL of the CloudStack API e.g. https://cloud.example.com/client/api. If not given, the |
|
Verify CA authority cert file. If not given, the |
|
The number of CPUs of the service offering. |
|
The CPU speed of the service offering in MHz. |
|
The deployment planner heuristics used to deploy a VM of this offering. If not set, the value of global config vm.deployment.planner is used. |
|
Bytes read rate of the disk offering. |
|
Bytes write rate of the disk offering. |
|
Max. iops of the compute offering. |
|
Min. iops of the compute offering. |
|
IO requests read rate of the disk offering. |
|
IO requests write rate of the disk offering. |
|
Display text of the service offering. If not set, name will be used as display_text while creating. |
|
Domain the service offering is related to. Public for all domains and subdomains if not set. |
|
The host tags for this service offering. |
|
Hypervisor snapshot reserve space as a percent of a volume. Only for managed storage using Xen or VMware. |
|
Whether the offering is customizable or not. Choices:
|
|
Whether compute offering iops is custom or not. Choices:
|
|
Whether it is a system VM offering or not. Choices:
|
|
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. Choices:
|
|
Restrict the CPU usage to committed service offering. Choices:
|
|
The total memory of the service offering in MB. |
|
Name of the service offering. |
|
Data transfer rate in Mb/s allowed. Supported only for non-system offering and system offerings having system_vm_type=domainrouter. |
|
Whether HA is set for the service offering. Choices:
|
|
Provisioning type used to create volumes. Choices:
|
|
Details for planner, used to store specific parameters. A list of dictionaries having keys |
|
State of the service offering. Choices:
|
|
The storage tags for this service offering. |
|
The storage type of the service offering. Choices:
|
|
The system VM type. Required if is_system=yes. Choices:
|
Notes
Note
A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.
This module supports check mode.
Examples
- name: Create a non-volatile compute service offering with local storage
ngine_io.cloudstack.cs_service_offering:
name: Micro
display_text: Micro 512mb 1cpu
cpu_number: 1
cpu_speed: 2198
memory: 512
host_tags: eco
storage_type: local
- name: Create a volatile compute service offering with shared storage
ngine_io.cloudstack.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
- name: Create or update a volatile compute service offering with shared storage
ngine_io.cloudstack.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
- name: Create or update a custom compute service offering
ngine_io.cloudstack.cs_service_offering:
name: custom
display_text: custom compute offer
is_customized: yes
storage_type: shared
host_tags: eco
storage_tags: eco
- name: Remove a compute service offering
ngine_io.cloudstack.cs_service_offering:
name: Tiny
state: absent
- name: Create or update a system offering for the console proxy
ngine_io.cloudstack.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
- name: Remove a system offering
ngine_io.cloudstack.cs_service_offering:
name: System Offering for Console Proxy 2GB
is_system: yes
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Number of CPUs in the service offering Returned: success Sample: 4 |
|
Speed of CPUs in MHz in the service offering Returned: success Sample: 2198 |
|
Date the offering was created Returned: success Sample: “2017-11-19T10:48:59+0000” |
|
Bytes read rate of the service offering Returned: success Sample: 1000 |
|
Bytes write rate of the service offering Returned: success Sample: 1000 |
|
Max iops of the disk offering Returned: success Sample: 1000 |
|
Min iops of the disk offering Returned: success Sample: 500 |
|
IO requests per second read rate of the service offering Returned: success Sample: 1000 |
|
IO requests per second write rate of the service offering Returned: success Sample: 1000 |
|
Display text of the offering Returned: success Sample: “Micro 512mb 1cpu” |
|
Domain the offering is into Returned: success Sample: “ROOT” |
|
List of host tags Returned: success Sample: [“eco”] |
|
UUID of the service offering Returned: success Sample: “a6f7a5fc-43f8-11e5-a151-feff819cdc9f” |
|
Whether the offering is customizable or not Returned: success Sample: false |
|
Whether the offering uses custom IOPS or not Returned: success Sample: false |
|
Whether the offering is for system VMs or not Returned: success Sample: false |
|
Whether the offering is volatile or not Returned: success Sample: false |
|
Whether the CPU usage is restricted to committed service offering Returned: success Sample: false |
|
Memory of the system offering Returned: success Sample: 512 |
|
Name of the system offering Returned: success Sample: “Micro” |
|
Data transfer rate in megabits per second allowed Returned: success Sample: 1000 |
|
Whether HA support is enabled in the offering or not Returned: success Sample: false |
|
Provisioning type used to create volumes Returned: success Sample: “thin” |
|
Additioanl service offering details Returned: success Sample: “{\u0027vgpuType\u0027: \u0027GRID K180Q\u0027,\u0027pciDevice\u0027:\u0027Group of NVIDIA Corporation GK107GL [GRID K1] GPUs\u0027}” |
|
List of storage tags Returned: success Sample: [“eco”] |
|
Storage type used to create volumes Returned: success Sample: “shared” |
|
System VM type of this offering Returned: success Sample: “consoleproxy” |
Authors
René Moser (@resmo)