ngine_io.cloudstack.internal_lb_vm module – Manages internal load balancer instances on Apache CloudStack based clouds.

Note

This module is part of the ngine_io.cloudstack collection (version 3.3.0).

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. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: ngine_io.cloudstack.internal_lb_vm.

New in ngine_io.cloudstack 3.3.0

Synopsis

  • Start and stop the InternalLbVm system instance which serves the internal load balancers of a VPC tier.

  • The instance itself can not be created or destroyed through this API family. CloudStack deploys it automatically once the first member is assigned to an internal load balancer, see ngine_io.cloudstack.lb_internal_member.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.6

  • cs >= 0.9.0

Parameters

Parameter

Comments

account

string

Account the internal load balancer instance is related to.

api_http_method

string

HTTP method used to query the API endpoint.

If not given, the CLOUDSTACK_METHOD env variable is considered.

Choices:

  • "get" ← (default)

  • "post"

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

HTTP timeout in seconds.

If not given, the CLOUDSTACK_TIMEOUT env variable is considered.

Default: 10

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.

domain

string

Domain the internal load balancer instance is related to.

force

boolean

Whether to force stop the instance.

Only considered on state=stopped.

Choices:

  • false ← (default)

  • true

name

string

Name of the internal load balancer instance, e.g. b-1234-VM.

Mutually sufficient with network and vpc, at least one of them is required.

network

string

Name of the VPC tier the internal load balancer instance serves.

poll_async

boolean

Poll async jobs until job has finished.

Choices:

  • false

  • true ← (default)

project

string

Name of the project the internal load balancer instance is related to.

state

string

State of the internal load balancer instance.

Choices:

  • "started" ← (default)

  • "stopped"

validate_certs

boolean

added in ngine_io.cloudstack 2.4.0

If false, SSL certificates will not be validated.

If not given, the CLOUDSTACK_DANGEROUS_NO_TLS_VERIFY env variable is considered.

This should only be used on personally controlled sites using self-signed certificates.

Choices:

  • false

  • true ← (default)

vpc

string

Name of the VPC the internal load balancer instance belongs to.

Also scopes the network lookup.

zone

string / required

Name of the zone the internal load balancer instance is in.

Notes

Note

  • This module uses admin only APIs. A regular user account gets an empty result from listInternalLoadBalancerVMs and the module will not find the instance.

  • There is no API to create or destroy an internal load balancer instance, so this module provides no state=present or state=absent.

  • When more than one instance matches, the module fails and asks for a more specific selection. Pass name to disambiguate.

  • A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.

  • This module supports check mode.

Examples

- name: Ensure the internal load balancer instance of a tier is running
  ngine_io.cloudstack.internal_lb_vm:
    vpc: my-vpc
    network: web-tier
    zone: zone01
    state: started

- name: Ensure a specific internal load balancer instance is stopped
  ngine_io.cloudstack.internal_lb_vm:
    name: b-1234-VM
    zone: zone01
    state: stopped

- name: Force stop the internal load balancer instance of a tier
  ngine_io.cloudstack.internal_lb_vm:
    vpc: my-vpc
    network: web-tier
    zone: zone01
    state: stopped
    force: true

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

account

string

Account the internal load balancer instance is related to.

Returned: when available

Sample: "example-account"

created

string

Date of the internal load balancer instance was created.

Returned: when available

Sample: "2026-02-08T11:26:24+0100"

domain

string

Domain the internal load balancer instance is related to.

Returned: when available

Sample: "ROOT"

guest_ip_address

string

Guest IP of the internal load balancer instance.

Returned: when available

Sample: "10.10.1.247"

host

string

Hostname of the host the internal load balancer instance is running on.

Returned: when available

Sample: "host01"

id

string

UUID of the internal load balancer instance.

Returned: success

Sample: "04589590-ac63-4ffc-93f5-b698b8ac38b6"

name

string

Name of the internal load balancer instance.

Returned: success

Sample: "b-1234-VM"

network_id

string

UUID of the guest network the internal load balancer instance serves.

Returned: when available

Sample: "e83f0010-4e08-493f-acc8-f5205d83b30d"

project

string

Name of project the internal load balancer instance is related to.

Returned: when available

Sample: "Production"

public_ip

string

Public IP of the internal load balancer instance.

Returned: when available

Sample: "10.10.1.247"

requires_upgrade

boolean

Whether the internal load balancer instance requires an upgrade.

Returned: when available

Sample: false

service_offering

string

Name of the service offering of the internal load balancer instance.

Returned: when available

Sample: "System Offering For Software Router"

state

string

State of the internal load balancer instance.

Returned: success

Sample: "Running"

template_version

string

Version of the system VM template.

Returned: when available

Sample: "CloudStack Release 4.20"

vpc_id

string

UUID of the VPC the internal load balancer instance belongs to.

Returned: when available

Sample: "87b1e0ce-4e01-11e4-bb66-0050569e64b8"

zone

string

Name of zone the internal load balancer instance is in.

Returned: success

Sample: "zone01"

Authors

  • Mitch Drage (@MitchDrage)