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¶
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.
- 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
-
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
connection (
Connection
) –Connection
orSession
.uuid (int) – Cluster UUID.
name (str) – Cluster display name.
members (list, optional) – List of cluster member UUIDs.
realtime_members (list, optional) – List of realtime market member UUIDs.
mode (
HeadroomMode
, optional) – Headroom calculation mode. (default:HeadroomMode.SEPARATE
)
-
mode
¶ Headroom calculation mode.
- Type
-
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
orSession
.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.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.
-
mode
¶ Headroom calculation mode.
- Type