Application is ruby-1.8 scaling. After a few times of setting scales_to/scales_from back and forth I start getting the error: "Could not completely distribute scales_from to all groups. Value constrained to 2" - 164 In this case I was attempting to set scales_from/scales_to to 3 (which worked originally). User in mongo: { "_id": "user_with_scaled_app", "apps": [ { "categories": [ ], "license": "unknown", "start_order": [ "@@app\/comp-proxy\/cart-ruby-1.8", "@@app\/comp-proxy\/cart-haproxy-1.4", "@@app\/comp-proxy", "@@app\/comp-web\/cart-ruby-1.8", "@@app\/comp-web" ], "group_instances": [ { "supported_max": -1, "addtl_fs_gb": 0, "group_name": "default", "name": "@@app\/comp-web\/cart-ruby-1.8", "reused_by": [ "@@app\/comp-web\/cart-ruby-1.8", "@@app\/group-web" ], "node_profile": "small", "max": 1, "profile_name": "default", "supported_min": 1, "min": 1, "cart_name": "ruby-1.8", "gears": [ { "configured_components": [ "@@app\/comp-web\/cart-ruby-1.8" ], "name": "d9ce313db9", "group_instance_name": "@@app\/group-web", "node_profile": "small", "server_identity": "ip-10-116-202-62", "uid": null, "uuid": "d9ce313db9ec4e749d87cb2d7de86290" } ], "component_instances": [ "@@app\/comp-web\/cart-ruby-1.8", "@@app\/comp-web" ], "uuid": "63603803cca34a8b9df045fe28919bf2" }, { "supported_max": 1, "addtl_fs_gb": 0, "group_name": "default", "name": "@@app\/comp-proxy\/cart-haproxy-1.4", "reused_by": [ "@@app\/group-proxy", "@@app\/comp-proxy\/cart-ruby-1.8", "@@app\/comp-proxy\/cart-haproxy-1.4" ], "node_profile": "small", "max": 1, "profile_name": "default", "supported_min": 1, "min": 1, "cart_name": "haproxy-1.4", "gears": [ { "configured_components": [ "@@app\/comp-proxy\/cart-ruby-1.8", "@@app\/comp-proxy\/cart-haproxy-1.4" ], "name": "scaled", "group_instance_name": "@@app\/comp-proxy\/cart-ruby-1.8", "node_profile": "small", "server_identity": "ip-10-116-202-62", "uid": null, "uuid": "cfd96c8ec7554da8bcc49c981c8584e6" } ], "component_instances": [ "@@app\/comp-proxy", "@@app\/comp-proxy\/cart-ruby-1.8", "@@app\/comp-proxy\/cart-haproxy-1.4" ], "uuid": "d9e87abd4944446c93d9948546a366b7" } ], "vendor": "unknown", "description": "", "version": "0.0", "conn_endpoints_list": [ { "from_comp_inst": "@@app\/comp-web\/cart-ruby-1.8", "to_comp_inst": "@@app\/comp-proxy\/cart-haproxy-1.4", "to_connector": { "type": "NET_TCP:gear-endpoint-info", "name": "set-gear-endpoints", "required": false }, "from_connector": { "type": "NET_TCP:gear-endpoint-info", "name": "publish-gear-endpoint", "required": false } }, { "from_comp_inst": "@@app\/comp-web\/cart-ruby-1.8", "to_comp_inst": "@@app\/comp-proxy\/cart-haproxy-1.4", "to_connector": { "type": "NET_TCP:httpd-proxy-info", "name": "set-proxy", "required": false }, "from_connector": { "type": "NET_TCP:httpd-proxy-info", "name": "publish-http-url", "required": false } } ], "suggests_feature": [ ], "comp_instances": [ { "cart_data": [ null ], "addtl_fs_gb": 0, "name": "@@app\/comp-web\/cart-ruby-1.8", "group_instance_name": "@@app\/comp-web\/cart-ruby-1.8", "parent_cart_name": "ruby-1.8", "dependencies": [ ], "cart_properties": [ ], "parent_cart_profile": "default", "exec_order": [ ], "parent_component_name": "default", "parent_cart_group": "default" }, { "cart_data": [ null ], "addtl_fs_gb": 0, "name": "@@app\/comp-proxy\/cart-ruby-1.8", "group_instance_name": "@@app\/comp-proxy\/cart-ruby-1.8", "parent_cart_name": "ruby-1.8", "dependencies": [ ], "cart_properties": [ ], "parent_cart_profile": "default", "exec_order": [ ], "parent_component_name": "default", "parent_cart_group": "default" }, { "cart_data": [ ], "addtl_fs_gb": 0, "name": "@@app\/comp-proxy", "group_instance_name": "@@app\/group-proxy", "parent_cart_name": "scaled", "dependencies": [ "@@app\/comp-proxy\/cart-ruby-1.8", "@@app\/comp-proxy\/cart-haproxy-1.4" ], "cart_properties": [ ], "parent_cart_profile": "default", "exec_order": [ "@@app\/comp-proxy\/cart-ruby-1.8", "@@app\/comp-proxy\/cart-haproxy-1.4" ], "parent_component_name": "proxy", "parent_cart_group": "proxy" }, { "cart_data": [ ], "addtl_fs_gb": 0, "name": "@@app\/comp-web", "group_instance_name": "@@app\/group-web", "parent_cart_name": "scaled", "dependencies": [ "@@app\/comp-web\/cart-ruby-1.8" ], "cart_properties": [ ], "parent_cart_profile": "default", "exec_order": [ "@@app\/comp-web\/cart-ruby-1.8" ], "parent_component_name": "web", "parent_cart_group": "web" }, { "cart_data": [ "" ], "addtl_fs_gb": 0, "name": "@@app\/comp-proxy\/cart-haproxy-1.4", "group_instance_name": "@@app\/comp-proxy\/cart-haproxy-1.4", "parent_cart_name": "haproxy-1.4", "dependencies": [ ], "cart_properties": [ ], "parent_cart_profile": "default", "exec_order": [ ], "parent_component_name": "default", "parent_cart_group": "default" } ], "name": "scaled", "conflicts_feature": [ ], "configure_order": [ "@@app\/comp-proxy\/cart-ruby-1.8", "@@app\/comp-proxy\/cart-haproxy-1.4", "@@app\/comp-proxy", "@@app\/comp-web\/cart-ruby-1.8", "@@app\/comp-web" ], "website": "", "node_profile": "small", "ssh_keys": { "haproxy": "AAAAB3NzaC1yc2EAAAABIwAAAQEAycKVO8uun43m6YHpiAt7uDgo9ef+NzmmXm4zctwdfGuS\/9YZLf3aZ2eMX\/NZVc6STF2LLZAHPTvl\/ciD5spwdHDmGyCwSVWl4TuehBo1cJqG88ZVkEuL0enyYTxICkwtx9+ItRLFZwgk9yeh31oeem8f09LXSZsNzU7TVqIt\/f0gCXG6VDVqpkUrP2u35Z7iFBoBOhulHhLlCQc\/vXCeoasxc1LVCiRnz070HzHX5DMzadpz6aRArLElqAEr6DavGjZuDPKeI2fi8ngOEO\/21ekBZhR4rcr9Xa2hEaXdo08WFZ56XNoDr4ebDPuL6jDBiHkQ2IgamfuSt+NwZHoQHw==" }, "display_name": "scaled-0.0-noarch", "default_profile": "default", "domain": { "namespace": "1350317915e5bf06", "uuid": "f1d5b17dd7134609b11098b141c978cd" }, "help_topics": [ ], "profiles": [ { "group_overrides": [ [ "proxy", "proxy\/haproxy-1.4" ], [ "proxy", "proxy\/ruby-1.8" ], [ "web", "web\/ruby-1.8" ] ], "start_order": [ ], "connections": [ { "components": [ "proxy\/haproxy-1.4", "web\/ruby-1.8" ], "name": "auto-scale" }, { "components": [ "proxy\/ruby-1.8", "web\/ruby-1.8" ], "name": "proxy-web" } ], "components": [ { "subscribes": [ ], "publishes": [ ], "name": "proxy", "depends_service": [ ], "generated": false, "depends": [ "ruby-1.8", "haproxy-1.4" ] }, { "subscribes": [ ], "publishes": [ ], "name": "web", "depends_service": [ ], "generated": false, "depends": [ "ruby-1.8" ] } ], "stop_order": [ ], "name": "default", "configure_order": [ "proxy\/ruby-1.8", "proxy\/haproxy-1.4" ], "generated": true, "groups": [ { "name": "proxy", "component_refs": [ { "name": "proxy", "component": "proxy" } ], "generated": false, "scaling": { "max": -1, "min": 1 } }, { "name": "web", "component_refs": [ { "name": "web", "component": "web" } ], "generated": false, "scaling": { "max": -1, "min": 1 } } ], "provides": [ ] } ], "requires": [ ], "requires_feature": [ ], "proxy_cartridge": "haproxy-1.4", "cart_data_def": [ ], "provides_feature": [ ], "architecture": "noarch", "uuid": "cfd96c8ec7554da8bcc49c981c8584e6", "creation_time": "2012-10-15T12:18:40-04:00", "scalable": true, "license_url": "" } ], "capabilities": { "gear_sizes": [ "small" ] }, "consumed_gears": 2, "domains": [ { "namespace": "1350317915e5bf06", "uuid": "f1d5b17dd7134609b11098b141c978cd" } ], "env_vars": null, "login": "user_with_scaled_app", "max_gears": 3, "parent_user_login": null, "ssh_keys": [ ], "system_ssh_keys": null, "usage_records": [ { "event": "begin", "sync_time": null, "usage_type": "GEAR_USAGE", "gear_uuid": "d9ce313db9ec4e749d87cb2d7de86290", "uuid": "1160c5518f2e4133a67e62aced21b9ae", "time": ISODate("2012-10-15T16:18:43.32Z"), "gear_size": "small" }, { "event": "begin", "sync_time": null, "usage_type": "GEAR_USAGE", "gear_uuid": "cfd96c8ec7554da8bcc49c981c8584e6", "uuid": "66601a38e56940d0a60a2412c00a8e60", "time": ISODate("2012-10-15T16:18:50.316Z"), "gear_size": "small" } ], "uuid": "45adef91ebe640c595d094354f6088ed" }
The problem is that the current scales_to is smaller than the scales_from being set (irrespective of the fact that a scales_to is being set too). The two factors are not independent of each other and setting one needs to consult how the other is distributed in different groups. Anyhow - the messaging has been improved now. Instead of the current 'algorithmic' complaint - the message will look like : Invalid scales_from factor 3 provided. Value out of allowed range ( 2 : 2 ). ... indicating that the given scales_from is more than the current scales_to (2). Or shall we disallow both to be set together?
fixed with rev#2b9db98fb91fc323efcf setting 3:3 from 2:2 is now allowed.
I was able to scale_up/scale_down between 2:2 and 3:3 forth and back without any issues.