resizing cluster failed for unexpected reason

Bug #1539454 reported by Yanyan Hu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
senlin
Fix Released
Undecided
Yanyan Hu

Bug Description

When adjustment parameters are not provided in action input when resizing cluster, current desired_capacity will be used to check size parameter:

http://git.openstack.org/cgit/openstack/senlin/tree/senlin/engine/service.py#n842

This is incorrect. Consider the following case:

cluster.min_size = 1, cluster.max_size = 3, cluster.desired_capacity = 2. If cluster is resized using the following input:
params = {
    'max_size': 0,
}

The check is expected to fail here:
http://git.openstack.org/cgit/openstack/senlin/tree/senlin/common/scaleutils.py#n141

However, the parameter check will actually fail for the following reason:
http://git.openstack.org/cgit/openstack/senlin/tree/senlin/common/scaleutils.py#n113
and the exception message will be:
'The target capacity (2) is greater than the specified max_size(0)'

We should set desired to None rather than current desired_capacity in this case:
http://git.openstack.org/cgit/openstack/senlin/tree/senlin/engine/service.py#n842

Yanyan Hu (yanyanhu)
Changed in senlin:
assignee: nobody → Yanyan Hu (yanyanhu)
description: updated
description: updated
Yanyan Hu (yanyanhu)
Changed in senlin:
milestone: none → mitaka-3
Revision history for this message
Qiming Teng (tengqim) wrote :

It would be difficult to do size checking if we set 'desired' to None on line 842.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to senlin (master)

Fix proposed to branch: master
Review: https://review.openstack.org/273988

Changed in senlin:
status: New → In Progress
Revision history for this message
Yanyan Hu (yanyanhu) wrote :

Hi, Qiming, currently, check_size_params util function has been able to cover that case correctly. So we only need to give it correct size parameters we want to check against.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to senlin (master)

Reviewed: https://review.openstack.org/273988
Committed: https://git.openstack.org/cgit/openstack/senlin/commit/?id=07c33fcb1b02c8dff06ea7d3c45e18847988b481
Submitter: Jenkins
Branch: master

commit 07c33fcb1b02c8dff06ea7d3c45e18847988b481
Author: yanyanhu <email address hidden>
Date: Fri Jan 29 03:36:24 2016 -0500

    Fix a bug in cluster_resize service routine

    This patch fixes a bug in cluster_resize service routine.

    Change-Id: Ib1677bcfab25a26b0d5a9a404261151f62ac2394
    Closes-Bug: #1539454

Changed in senlin:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/senlin 1.0.0.0b3

This issue was fixed in the openstack/senlin 1.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.