f5.multi_device.cluster

Module contents

The classes within define the management of a cluster of BIG_IP devices.

Definitions:

Cluster: The manager of the TrustDomain and DeviceGroup objects. TrustDomain: a group of BIG-IP® devices that have exchanged certificates

and trust one another
DeviceGroup: a group of BIG-IP® device that sync configuration data and
failover connections.

Clustering is broken down into three component parts: a cluster manager, a trust domain, and a device group. The cluster manager presents the external interface to a user for operations like create, teardown etc....

To create a device service group (aka cluster) of devices, those devices must trust one another. This is coordinated by the TrustDomain class. Once those devices trust one another, a device group is created and each is added to the group. After this step, a cluster exists.

Currently the only supported type of cluster is a ‘sync-failover’ cluster. The number of devices supported officially is currently two, for an active-standby cluster, but the code below can accommodate a four-member cluster.

Methods:

  • create – creates a cluster based on kwargs given by user
  • teardown – tears down an existing cluster

Examples:

There are two major use-cases here:

  • Manage an existing cluster:

    list_of_bigips = [ManagementRoot(...), ManagementRoot(...)] cluster_mgr = ClusterManager(

    devices=list_of_bigips, device_group_name=’my_cluster’, device_group_type=’sync-failover’, device_group_partition=’Common’

    )

    assert cluster_mgr.cluster.devices == list_of_bigips

  • Create a new cluster and manage it:

    list_of_bigips = [ManagementRoot(...), ManagementRoot(...)] cluster_mgr = ClusterManager() cluster_mgr.create(

    devices=list_of_bigips, device_group_name=’my_cluster’, device_group_type=’sync-failover’, device_group_partition=’Common

    )

    assert cluster_mgr.cluster.devices == list_of_bigips

class f5.multi_device.cluster.Cluster(device_group_name, device_group_type, device_group_partition, devices)

Bases: tuple

count(value) → integer -- return number of occurrences of value
device_group_name

Alias for field number 0

device_group_partition

Alias for field number 2

device_group_type

Alias for field number 1

devices

Alias for field number 3

index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

class f5.multi_device.cluster.ClusterManager(**kwargs)[source]

Bases: object

Manage a cluster of BIG-IP® devices.

This is accomplished with REST URI calls only, but some operations are only permitted via tmsh commands (such as adding cm/trust-domain peers). We get around this issue by deploying iApps (sys/application).

manage_extant(**kwargs)[source]

Manage an existing cluster

Parameters:kwargs – dict – keyword args in dict
create(**kwargs)[source]

Create a cluster of BIG-IP® devices.

Parameters:kwargs – dict – keyword arguments for cluster manager
teardown()[source]

Teardown the cluster of BIG-IP® devices.

f5.multi_device.cluster The classes within define the management of a cluster of BIG_IP devices.