Implement a common library for scaling groups

Registered by Zane Bitter

There are four types of scaling group in Heat: ResourceGroup, InstanceGroup, AWS AutoscalingGroup and Heat AutoscalingGroup. In each case, the implemenation of scaling is tightly bound into the resource. The latter three resource types share an unholy inheritance arrangement whereby the actual resource classes inherit from each other. They share no code at all with ResourceGroup, which is an entirely independent implementation.

The goal of this blueprint is to unify as much as possible of the generic scaling group code in a common library that can be called from these various resources, and to remove as much logic as possible from the Resource classes themselves.

Blueprint information

Status:
Started
Approver:
Steve Baker
Priority:
High
Drafter:
Zane Bitter
Direction:
Approved
Assignee:
Zane Bitter
Definition:
Approved
Series goal:
Accepted for future
Implementation:
Good progress
Milestone target:
milestone icon next
Started by
Zane Bitter

Related branches

Sprints

Whiteboard

Heat has migrated to StoryBoard, please add BPs to [1]
If you like to keep using exists BPs, please add it to [1]
You can find more detail in [2].

[1] https://storyboard.openstack.org/#!/project/989
[2] https://etherpad.openstack.org/p/Heat-StoryBoard-Migration-Info

Gerrit topic: https://review.openstack.org/#q,topic:scaling-library,n,z

Addressed by: https://review.openstack.org/213552
    Calculate ResourceGroup batch sizes using scaling library

Addressed by: https://review.openstack.org/217133
    Split out calculation of the next batch into a separate function

Addressed by: https://review.openstack.org/217134
    Respect rolling update params on the initial batch

Addressed by: https://review.openstack.org/213548
    Refactor InstanceGroup batch sizing logic

Addressed by: https://review.openstack.org/213551
    Invert logic of counting in InstanceGroup _get_batches()

Addressed by: https://review.openstack.org/217430
    Refactor ResourceGroup batched updates and add tests

Addressed by: https://review.openstack.org/217431
    Return the correct size for the ResourceGroup from _get_batches()

Addressed by: https://review.openstack.org/217432
    Don't do unnecessary updates in ResourceGroup rolling updates

Addressed by: https://review.openstack.org/217433
    Don't repeatedly overwrite definitions in RG rolling update

Addressed by: https://review.openstack.org/213553
    Clarify name of scaling resource_templates() function

Addressed by: https://review.openstack.org/213554
    Allow a custom new ID function for member_definitions()

Addressed by: https://review.openstack.org/213555
    Allow member_definitions() to customise each member that it defines

Addressed by: https://review.openstack.org/213556
    Use the member_definition library func in ResourceGroup rolling updates

Addressed by: https://review.openstack.org/218451
    Start scaling down in an InstanceGroup rolling update ASAP

Addressed by: https://review.openstack.org/218452
    Return max_upd from ResourceGroup._get_batches()

Addressed by: https://review.openstack.org/218453
    Add unit tests for ResourceGroup._assemble_for_rolling_update()

Addressed by: https://review.openstack.org/218454
    Refactor ResourceGroup._get_batches() to be much, much simpler

Addressed by: https://review.openstack.org/218459
    Don't return resource names from ResourceGroup._get_batches()

Addressed by: https://review.openstack.org/218957
    Handle scaling up in scaling library next_batch() function

Addressed by: https://review.openstack.org/218958
    Allow ResourceGroup rolling update to scale up

Addressed by: https://review.openstack.org/218959
    Allow ResourceGroup rolling update to scale down

The patches above landed for liberty-rc1, but mostly comprise refactoring and better testing. They should be considered a prerequisite for https://blueprints.launchpad.net/heat/+spec/resource-group-batching rather than the final product of this blueprint. I'm moving this to next (Mitaka) instead.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.