ngine_io.cloudstack.cs_service_offering – Manages service offerings on Apache CloudStack based clouds.

From Get docs
Ansible/docs/2.11/collections/ngine io/cloudstack/cs service offering module


ngine_io.cloudstack.cs_service_offering – Manages service offerings on Apache CloudStack based clouds.

Note

This plugin is part of the ngine_io.cloudstack collection (version 2.0.0).

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 Choices/Defaults Comments

api_http_method

string

  • get

  • post

HTTP method used to query the API endpoint.

If not given, the CLOUDSTACK_METHOD env variable is considered.

api_key

string / required

API key of the CloudStack API.

If not given, the CLOUDSTACK_KEY env variable is considered.

api_secret

string / required

Secret key of the CloudStack API.

If not set, the CLOUDSTACK_SECRET env variable is considered.

api_timeout

integer

Default:

10

HTTP timeout in seconds.

If not given, the CLOUDSTACK_TIMEOUT env variable is considered.

api_url

string / required

URL of the CloudStack API e.g. https://cloud.example.com/client/api.

If not given, the CLOUDSTACK_ENDPOINT env variable is considered.

api_verify_ssl_cert

string

Verify CA authority cert file.

If not given, the CLOUDSTACK_VERIFY env variable is considered.

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

  • no
  • yes

Whether the offering is customizable or not.

is_iops_customized

boolean

  • no
  • yes

Whether compute offering iops is custom or not.


aliases: disk_iops_customized

is_system

boolean

  • no

  • yes

Whether it is a system VM offering or not.

is_volatile

boolean

  • no
  • yes

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

  • no
  • yes

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

  • no
  • yes

Whether HA is set for the service offering.

provisioning_type

string

  • thin
  • sparse
  • fat

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

  • present

  • absent

State of the service offering.

storage_tags

list / elements=string

The storage tags for this service offering.


aliases: storage_tag

storage_type

string

  • local
  • shared

The storage type of the service offering.

system_vm_type

string

  • domainrouter
  • consoleproxy
  • secondarystoragevm

The system VM type.

Required if is_system=yes.



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 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




Authors

  • René Moser (@resmo)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/ngine_io/cloudstack/cs_service_offering_module.html