Removes the multiple use of the mixin, so that we don't
set metadata for both policy and group. Setting the cooldown
metadata only for group would suffice.
Change-Id: I241a32b52e0708264c80c3eca313a97534927415
Related-Bug: #1555748
Obtain the current group capacity, and the reference IDs for updating load
balancers (if any) over RPC from a GroupInspector and the nested stack
outputs. Fall back to grouputils (which loads the nested stack in memory)
only if the output containing the reference IDs is not available.
Change-Id: Ic6909e42edf709ba1cd99ba71f2d2f06570a615f
Closes-Bug: #1731349
The present way of comparing timestamp in metadata
+ cooldown with current timestamp can be wrong, if
the policy cooldown is updated in between scaling
activity.
Set metadata with the expected cooldown end timestmap
rather than the current timestamp when scaling is finished
and compare it with current timestamp.
Change-Id: I50ddba4c8da3c6ec8b34ebb4768017cb1a446f5f
Some resources do not work if their metadata is in
a wrong state, .e.g the metadata 'scaling_in_progress'
of scaling group/policy might be always True if engine
restarts while scaling.
This patch adds an interface 'handle_metadata_reset' for
resource, then the plugins can override it if needed.
We reset the metadata while marking resource healthy.
Change-Id: Ibd6c18acf6f3f24cf9bf16a524127850968062bc
Closes-Bug: #1651084
In some part in the code we import objects.
In the Openstack style guidelines they recommend to import only
modules.
We need to fix that.
Change-Id: I9c7481462ac7350bddae78c0a05af1e835a282e2
To avoid a race condition when updating a deleted stack, this catches the
NotFound exception specifically and ignores it. All other exceptions are
allowed to be raised.
Closes bug: 1582236
Change-Id: I23ddb71c806c0db1ed7ed4ee4ef831ca51605d65
Don't resize and send notifications when there is no
change in size i.e. max/min has been reached.
This also refactors some exception handling logic.
Change-Id: I1bb226b3067178dbdab2947609c53f3434aff9fe
Related-Bug: #1555748
Cooldown behavior changed in commit:
50cc71e33c
Restore the cooldown behavior so that when a group does not encounter
scaling activity, a cooldown period is not activated.
Closes-Bug: #1555748
Change-Id: Icf5df6a48afb9f56aa1c3f1622d33b9998aca39c
Handle the case where targ_capacity > curr_capacity.
Change-Id: I53d6f51a3ff0f7e813720e28f9decfc8ef118a89
Partially-Implements: blueprint scaling-group-common
This should be useful both for ResourceGroup, which does unspeakable things
to its member definitions in order to substitute in resource names, and for
distributing members across availability zones.
Change-Id: I541168ec947066f06a6a7813d52d1df4020eb4bb
Partially-Implements: blueprint scaling-group-common
Previously we always used a random short_id, and that is indeed what we
want for Autoscaling groups, but ResourceGroups generally use sequential
IDs, so pass a function that generates them instead of hard-coding it.
By happy accident, this makes the tests a bit nicer too.
Change-Id: I58ce67e4b58378f35d5690d653a113b03ee6e08e
Partially-Implements: blueprint scaling-group-common
The naming in this function dates from an earlier era, before we had the
ResourceDefinition class. This modifies the function name from
resource_templates() to member_definitions() and also modifies the
parameter/variable names to make their meanings clearer. The documentation
is also improved with a more thorough description of what the function
does.
Change-Id: Ie25a8de380ffc4a6eb4d5934118452b010c1872a
Partially-Implements: blueprint scaling-group-common
When the effective batch size is reduced due to a dwindling number of
resources we need to update, we may be able to reduce the size of the group
prior to the final batch without violating the minimum number of members we
are required to keep in service. This change ensures that any excess nodes
are removed as soon as possible.
Change-Id: Ic7b9544825a92b8720dcff15fe581038dff43582
Partially-Implements: blueprint scaling-group-common
Create a next_batch function in the scaling library that calculates only
what the next batch update should look like. For now, continue to call this
from the get_batches function so that we can verify there is no change in
behaviour. However, this will make it easier to add improvements in the
future, and to reconcile InstanceGroup with ResourceGroup.
Change-Id: I0fe25556de2a678ead14bc64f77c0466fe8f9e92
Partially-Implements: blueprint scaling-group-common
Use ResoruceDefinitionCore methods metadata and deletion_policy
instead of using ResourceDefinition as a dict.
Also, fix wrong ResourceDefinitionCore __repr__ method.
Change-Id: If7d4e77a72115aefc4878257508c1d6270db444f
There are cases where it takes a long time to create a new resource as
requested by the scaling operation on an ASG resource, for instance, a
nova server creation followed by a complex SoftwareDeployment. During
this process, additional alarms may come in but failed to be blocked
by the current cooldown checking mechanism because the very first
timestamp has yet to be generated. This is leading to unexpected size
adjustment to the ASG.
This patch augments the existing cooldown checking mechanism with a
scaling-in-progress test so that additional alarms arriving during
the very first scaling operation will be ignored.
Change-Id: Ib8aa83eed366df7097c9cbb9247eca866ae4b620
Closes-Bug: #1375156
When we moved parameters from the stack table to the template table
we did it in a "flexible" way, but this led to some difficult to
diagnose problems. So this patch totally removes "env" as an argument
to the Stack class to make absolutely sure that we are doing this
correctly. I came across these bugs when rebasing decouple-nested.
- env was not getting passed into instance group make_templates()
- template deepcopy was not working correctly (causing some problems
when deleting backup stacks)
Change-Id: I85cfb01c68ff5a44e2ff4f6e446870efb7205933
The lb_reload() logic is moved into a separate module of the scaling
library. A new test case is added to test this utility function.
Since the revised _lb_reload() method checks if LOAD_BALANCER_NAMES is
defined/provided or not, the OpenStack version of AutoScalingGroup
doesn't have to implement an empty _lb_reload() method now.
partial-blueprint: as-lib
partial-blueprint: reorg-asg-code
Change-Id: I7387d0f27c6121be29d9a035be4cca0b9bbdf441
CooldownMixin is a class that can be shared between OS and AWS
auto-scaling implementations. This patch moves it to a shared
subdirectory.
Implements: partial-blueprint reorg-asg-code
Change-Id: I40e470460e84944d317f5b1772fc562abf62896d
Instead of building nested templates for Autoscaling manually, use the
Template.add_resource() method to build them up programmatically.
Change-Id: Ie4d6a869355cf0ddb6fce0edc6c7d49b8a2b7e75
This introduces a new package for autoscaling code which is
intended for use outside of the Heat engine, and moves the
resource_templates function into a new module, heat.scaling.template.
The function hasn't been changed at all.
Change-Id: I78c420e7a188f2d14780a03b3ea220b9a5fbe86c
Implements: partial blueprint as-lib