Module contents

Submodule List

device_group Class for managing a DeviceGroup for a set of BIG-IP® devices
exceptions These exceptions for clustering, devicegroup, and trustdomain.
trust_domain Class to manage a TrustDomain for a set of BIG-IP® devices.



Class for managing a DeviceGroup for a set of BIG-IP® devices

Managing a device group for clustering is an event-driven process. Please use the methods here to control that process. The fundamental idea is that any action should have an observable outcome. Adding a device to the device group should have a consequence for each member of the device group, including the newly added member.


There are two major use-cases here:

  • Manage an existing device group:

    list_of_bigips = [ManagementRoot(…), ManagementRoot(…)] device_group = DeviceGroup(

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



  • Create a new device group and manage it:

    list_of_bigips = [ManagementRoot(…), ManagementRoot(…)] device_group = DeviceGroup() device_group.create(

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




  • create – create a device group from a list of devices
  • teardown – teardown a device group, but leave the trust domain intact
  • validate – ensure a device group is in the proper state based on inputs
  • manage_extant – manage an existing device group
class f5.multi_device.device_group.DeviceGroup(**kwargs)[source]

Bases: object

Class to manage device service group

For the non-public methods, there are a few flavors of behavior: get, check, and ensure. A ‘get’ retrieves some info from the device without any assumptions about that info. A ‘check’ will assert a device’s info is as expected. An ‘ensure’ method often does one or more of the above and also may take some other action to enforce the expected state, such as syncing config.

The pollster is used heavliy here for ‘check’ and ‘get’ methods, since we are often waiting for the device or devices to respond to some action.


  • dg = self._get_device_group()
  • self._check_all_devices_in_sync()
  • self.ensure_all_devices_in_sync()

Validate device group state among given devices.

Parameters:kwargs – dict – keyword args of device group information
Raises:UnexpectedDeviceGroupType, UnexpectedDeviceGroupDevices

Create the device service cluster group and add devices to it.


Teardown device service cluster group.


Ensure all devices have ‘In Sync’ status are sync is done.


These exceptions for clustering, devicegroup, and trustdomain.

exception f5.multi_device.exceptions.ClusterError(*args, **kwargs)[source]

Bases: f5.sdk_exception.F5SDKError

exception f5.multi_device.exceptions.DeviceGroupError(*args, **kwargs)[source]

Bases: f5.sdk_exception.F5SDKError

exception f5.multi_device.exceptions.TrustDomainError(*args, **kwargs)[source]

Bases: f5.sdk_exception.F5SDKError

exception f5.multi_device.exceptions.AlreadyManagingCluster(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.ClusterError

exception f5.multi_device.exceptions.ClusterNotSupported(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.ClusterError

exception f5.multi_device.exceptions.ClusterOperationNotSupported(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.ClusterError

exception f5.multi_device.exceptions.DeviceAlreadyInTrustDomain(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.TrustDomainError

exception f5.multi_device.exceptions.MissingRequiredDeviceGroupParameter(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.ClusterError

exception f5.multi_device.exceptions.NoClusterToManage(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.ClusterError

exception f5.multi_device.exceptions.DeviceGroupNotSupported(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.DeviceGroupError

exception f5.multi_device.exceptions.DeviceGroupOperationNotSupported(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.DeviceGroupError

exception f5.multi_device.exceptions.DeviceNotTrusted(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.TrustDomainError

exception f5.multi_device.exceptions.TrusteeNotInTrustDomain(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.TrustDomainError

exception f5.multi_device.exceptions.UnexpectedDeviceGroupState(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.DeviceGroupError

exception f5.multi_device.exceptions.UnexpectedDeviceGroupDevices(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.DeviceGroupError

exception f5.multi_device.exceptions.UnexpectedDeviceGroupType(*args, **kwargs)[source]

Bases: f5.multi_device.exceptions.DeviceGroupError


Class to manage a TrustDomain for a set of BIG-IP® devices.

A trust domain defines a group of devices that have signed and exchanged certificates. Establishing a trust domain is prerequisite for device service clustering. Once devices are part of a trust domain, they can synchronize configuration and act as failovers for one another. This class manages that trust domain.


devices = [ManagementRoot(‘x’, ‘un’, ‘pw’), ManagementRoot(‘x’, ‘un’, ‘pw’)

  • Existing domain:
    dg = DeviceGroup(devices=devices, partition=’Common’)
  • New domain:
    dg = DeviceGroup() dg.create(devices=devices, partition=’Common’)


  • validate – ensure devices are a part of the same trust domain
  • create – create a trust domain amongst two or more devices
  • teardown – teardown a trust domain by traversing each member and
    removing all other devices from its local trust besides itself.
class f5.multi_device.trust_domain.TrustDomain(**kwargs)[source]

Bases: object

Manages the trust domain of a BIG-IP® device.


Validate that devices are each trusted by one another

Parameters:kwargs – dict – keyword args for devices and partition

Add trusted peers to the root bigip device.

When adding a trusted device to a device, the trust is reflexive. That is, the truster trusts the trustee and the trustee trusts the truster. So we only need to add the trusted devices to one device.

Parameters:kwargs – dict – devices and partition

Teardown trust domain by removing trusted devices.



Wraps the poll to get attempts and interval applicable for cluster.

Parameters:callable – callable – callable to pass into poll

Get device information about a specific BigIP device.

Parameters:bigip – ManagementRoot object — device to inspect
Returns:ManagementRoot object

Map a list of devices to their hostnames.

Parameters:devices – list – list of ManagementRoot objects
Returns:dict – mapping of hostnames to ManagementRoot objects