headroom

The headroom processor provides cluster headroom post-processing analytic parity for Turbonomic’s native headroom calculations, while enabling extended headroom customization through custom template mappings.

Enumerations

class vmtplanner.processors.headroom.HeadroomMode(value)

Headroom Calculation Modes

AVERAGE = 2

Split evenly amongst all templates in a group, i.e. average all templates

SEPARATE = 1

Per-template headroom

SUM = 3

Combined templates in a group, i.e. summed

Classes

class vmtplanner.processors.headroom.HeadroomEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)

Headroom results encoder for JSON output

Example

with open(OUTFILE, 'w') as fp:
    json.dump(plan.headroom(), fp, indent=2, cls=HeadroomEncoder)
class vmtplanner.processors.headroom.Group(name=None, uuid=None)

Headroom group

Groups provide partitioning within a cluster, and are not required if no subdivision of the cluster is necessary, as each cluster has a default group for all ungrouped members.. Groups need not be created per cluster either, as all entities will be partitioned on cluster boundaries before being assigned to their respective groups. Groups cannot be used to create super clusters.

Parameters
  • name (str) – Group name. One of name or uuid is required.

  • uuid (str) – Group UUID.

name

Group display name.

Type

str

uuid

Group UUID.

Type

str

type

Trubonomic “groupType” of the group:

Type

str

members

List of group real-time market members.

Type

list

Raises

ValueError – If both name and uuid are None.

Notes

One of name or uuid is required to lookup the group, if both are provided uuid will override.

class vmtplanner.processors.headroom.Template(name=None, uuid=None, targets=None, clusters=None)

Headroom template

Templates may be linked to both groups and clusters, and will apply to all members at the level applied respecitvely. Because groups can span across clusters, you may want to assign specific templates to specific cluster group combinations. You can specify a cluster or clusters to lock a template to, which will cause the template to only be applied to group members of the listed clusters.

Parameters
  • name (str) – Template name. One of name or uuid is required.

  • uuid (str) – Template UUID.

  • targets (list) – List of groups and/or clusters to apply the template to.

  • clusters (list, optional) – List of clusters to limit the template to.

name

Template display name.

Type

str

uuid

Template UUID.

Type

str

targets

List of group names or UUIDs to apply the template to.

Type

list

clusters

List of clusters to limit the template to.

Type

list

cpu

Template CPU value.

Type

Decimal

cpu_provisioned

Template CPU provisioned value.

Type

Decimal

mem

Template memory value.

Type

Decimal

mem_provisioned

Template memory provisioned value.

Type

Decimal

storage_amount

Template storage value.

Type

Decimal

storage_provisioned

Template storage provisioned value.

Type

Decimal

Raises
  • TypeError – If the retrieved template is not a VirtualMachine template.

  • ValueError – If both name and uuid are None; or no targets provided.

Notes

One of name or uuid is required to lookup the template, if both are provided uuid will override.

class vmtplanner.processors.headroom.Cluster(connection, uuid, name, members=None, realtime_members=None, mode=<HeadroomMode.SEPARATE: 1>)

Headroom cluster

Individual cluster objects, used by a ClusterHeadroom plan.

Parameters
name

Cluser display name.

Type

str

datacenter

Datacenter the cluster belongs to.

Type

str

groups

Dictionary of cluster groups for headroom analysis.

Type

dict

growth

Cluster growth.

Type

float

members

List of cluster member UUIDs.

Type

list

mode

Headroom calculation mode.

Type

HeadroomMode

realtime_members

List of realtime market member UUIDs.

Type

list

uuid

Cluster UUID.

Type

str

class vmtplanner.processors.headroom.ClusterHeadroom(connection, spec=None, market='Market', scope=None, groups=None, templates=None, growth_lookback=7, mode=<HeadroomMode.SEPARATE: 1>)

Cluster headroom plan

In basic form, this provides cluster headroom parity with Turbonomics native 10 Day average templates. When combined with groups and templates, ClusterHeadroom provides highly customizable headroom analysis.

Parameters
  • connection (Connection) – Connection or Session.

  • spec (PlanSpec, optional) – Settings override to apply to the market. Default behavior is to run a balance plan first.

  • market (str, optional) – Base market UUID to apply the settings to. (default: Market)

  • scope (list, optional) – Scope of the plan market. If None, then a list of all clusters in the given market will be used.

  • groups (list) – List of Group objects.

  • templates (list) – List of :py:class`Template` objects.

  • growth_lookback (int) – Number of days to use for growth calcuation.

  • mode (HeadroomMode, optional) – Headroom calculation mode.

commodities

Commodities to calculate for headroom.

Type

list

clusters

List of clusters in the plan.

Type

list

groups

List of Group objects.

Type

list

growth_lookback

VM growth period in days.

Type

int

mode

Headroom calculation mode.

Type

HeadroomMode

templates

List of :py:class`Template` objects.

Type

list

tempalte_commodity

Dictionary map of commodities to template attributes.

Type

dict