Note
This plugin is part of the ngine_io.cloudstack collection.
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
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| api_http_method string |
| HTTP method used to query the API endpoint. If not given, the 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 get if not specified. |
| api_key string | API key of the CloudStack API. If not given, the CLOUDSTACK_KEY env variable is considered.As the last option, the value is taken from the ini config file, also see the notes. | |
| api_region string | Default: "cloudstack" | Name of the ini section in the cloustack.ini file.If not given, the CLOUDSTACK_REGION env variable is considered. |
| api_secret string | Secret key of the CloudStack API. If not set, the CLOUDSTACK_SECRET env variable is considered.As the last option, the value is taken from the ini config file, also see the notes. | |
| api_timeout integer | HTTP timeout in seconds. If not given, the 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. | |
| api_url string | URL of the CloudStack API e.g. https://cloud.example.com/client/api. If not given, the CLOUDSTACK_ENDPOINT env variable is considered.As the last option, the value is taken from the ini config file, also see the notes. | |
| api_verify_ssl_cert string | CA authority cert file. If not given, the CLOUDSTACK_VERIFY env variable is considered.As the last option, the value is taken from the ini config file, also see the notes. Fallback value is null if not specified. | |
| cpu_number integer | The number of CPUs of the service offering. | |
| cpu_speed integer | The CPU speed of the service offering in MHz. | |
| deployment_planner string | 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. | |
| disk_bytes_read_rate integer | Bytes read rate of the disk offering. aliases: bytes_read_rate | |
| disk_bytes_write_rate integer | Bytes write rate of the disk offering. aliases: bytes_write_rate | |
| disk_iops_max integer | Max. iops of the compute offering. | |
| disk_iops_min integer | Min. iops of the compute offering. | |
| disk_iops_read_rate integer | IO requests read rate of the disk offering. | |
| disk_iops_write_rate integer | IO requests write rate of the disk offering. | |
| display_text string | Display text of the service offering. If not set, name will be used as display_text while creating. | |
| domain string | Domain the service offering is related to. Public for all domains and subdomains if not set. | |
| host_tags list / elements=string | The host tags for this service offering. aliases: host_tag | |
| hypervisor_snapshot_reserve integer | Hypervisor snapshot reserve space as a percent of a volume. Only for managed storage using Xen or VMware. | |
| is_customized boolean |
| Whether the offering is customizable or not. |
| is_iops_customized boolean |
| Whether compute offering iops is custom or not. aliases: disk_iops_customized |
| is_system boolean |
| Whether it is a system VM offering or not. |
| is_volatile boolean |
| 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. |
| limit_cpu_usage boolean |
| Restrict the CPU usage to committed service offering. |
| memory integer | The total memory of the service offering in MB. | |
| name string / required | Name of the service offering. | |
| network_rate integer | Data transfer rate in Mb/s allowed. Supported only for non-system offering and system offerings having system_vm_type=domainrouter. | |
| offer_ha boolean |
| Whether HA is set for the service offering. |
| provisioning_type string |
| Provisioning type used to create volumes. |
| service_offering_details list / elements=dictionary | Details for planner, used to store specific parameters. A list of dictionaries having keys key and value. | |
| state string |
| State of the service offering. |
| storage_tags list / elements=string | The storage tags for this service offering. aliases: storage_tag | |
| storage_type string |
| The storage type of the service offering. |
| system_vm_type string |
| The system VM type. Required if is_system=yes. |
Note
cs library’s configuration method if credentials are not provided by the arguments api_url, api_key, api_secret. Configuration is read from several locations, in the following order. The CLOUDSTACK_ENDPOINT, CLOUDSTACK_KEY, CLOUDSTACK_SECRET and CLOUDSTACK_METHOD. CLOUDSTACK_TIMEOUT environment variables. A CLOUDSTACK_CONFIG environment variable pointing to an .ini file. A cloudstack.ini file in the current working directory. A .cloudstack.ini file in the users home directory. Optionally multiple credentials and endpoints can be specified using ini sections in cloudstack.ini. Use the argument api_region to select the section name, default section is cloudstack. See https://github.com/exoscale/cs for more information.- 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
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| cpu_number integer | success | Number of CPUs in the service offering Sample: 4 |
| cpu_speed integer | success | Speed of CPUs in MHz in the service offering Sample: 2198 |
| created string | success | Date the offering was created Sample: 2017-11-19T10:48:59+0000 |
| disk_bytes_read_rate integer | success | Bytes read rate of the service offering Sample: 1000 |
| disk_bytes_write_rate integer | success | Bytes write rate of the service offering Sample: 1000 |
| disk_iops_max integer | success | Max iops of the disk offering Sample: 1000 |
| disk_iops_min integer | success | Min iops of the disk offering Sample: 500 |
| disk_iops_read_rate integer | success | IO requests per second read rate of the service offering Sample: 1000 |
| disk_iops_write_rate integer | success | IO requests per second write rate of the service offering Sample: 1000 |
| display_text string | success | Display text of the offering Sample: Micro 512mb 1cpu |
| domain string | success | Domain the offering is into Sample: ROOT |
| host_tags list / elements=string | success | List of host tags Sample: ['eco'] |
| id string | success | UUID of the service offering Sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f |
| is_customized boolean | success | Whether the offering is customizable or not |
| is_iops_customized boolean | success | Whether the offering uses custom IOPS or not |
| is_system boolean | success | Whether the offering is for system VMs or not |
| is_volatile boolean | success | Whether the offering is volatile or not |
| limit_cpu_usage boolean | success | Whether the CPU usage is restricted to committed service offering |
| memory integer | success | Memory of the system offering Sample: 512 |
| name string | success | Name of the system offering Sample: Micro |
| network_rate integer | success | Data transfer rate in megabits per second allowed Sample: 1000 |
| offer_ha boolean | success | Whether HA support is enabled in the offering or not |
| provisioning_type string | success | Provisioning type used to create volumes Sample: thin |
| service_offering_details dictionary | success | Additioanl service offering details Sample: {'vgpuType': 'GRID K180Q','pciDevice':'Group of NVIDIA Corporation GK107GL [GRID K1] GPUs'} |
| storage_tags list / elements=string | success | List of storage tags Sample: ['eco'] |
| storage_type string | success | Storage type used to create volumes Sample: shared |
| system_vm_type string | success | System VM type of this offering Sample: consoleproxy |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/ngine_io/cloudstack/cs_service_offering_module.html