Bug 833019

Summary: Gear's 'size/profile' from the group is not changed when move a non-scalable app across districts of different profile
Product: OKD Reporter: Johnny Liu <jialiu>
Component: PodAssignee: Rajat Chopra <rchopra>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 2.xCC: mpatel, qgong
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-25 18:26:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Johnny Liu 2012-06-18 12:03:41 UTC
Description of problem:
Acctually this is a known issue, the following is email discussion from Rajat

<--snip-->
Changing the gear's size is supported by the code, though I have not personally tested this.
Changing districts will be smooth though.

The only disconnect I foresee is for scalable apps. The gear gets its 'size/profile' from the group that it belongs to. And while moving we change the gear's size, but we do not change the group's specification. So, if there is a scale-up/scale-down event, do not expect the new size to be remembered.
<--snip-->

In email it mainly talk about the risk for scalable app, but for non-scalable app, this issue is also existing, so I open this bug for tracking it.



Version-Release number of selected component (if applicable):
devenv_1850

How reproducible:
Always

Steps to Reproduce:
1. set up two distrcit, one is small, another is medium
2. create a non-scalable app of medium gear size
3. move this gear from medium district to small district.
  
Actual results:
Use rest api (gear_groups) to get gear size, it still is "medium".

Expected results:
Rest api should retrun "small".

Additional info:

Comment 1 Rajat Chopra 2012-06-18 18:17:22 UTC
Fixed with rev#b8f16b81b84fc756c338ec6e4ee257acc5e0805e in li.repo

Comment 2 Rony Gong 🔥 2012-06-19 06:57:23 UTC
This issue still exist on devenv_1857

Comment 3 Rajat Chopra 2012-06-19 14:24:56 UTC
Well, the gear's profile did change, but the app's profile did not. The behaviour is debatable. Soon, we will have nothing on the app saying its 'small'/'medium'. That REST call info should go away.

Anyhow, meanwhile, the required fix is in place. rev#bb4b082a5ed54337c806b3e94552a5a50aeea6b0

Comment 4 Johnny Liu 2012-06-20 08:00:52 UTC
Re-test this bug on devenv_1589, looks like still have some issues.

There are two endpoints that mentioned profile, one of them is fixed, but gear_groups endpoint is not fixed, still saying it is "small"

After move app from 'small' district to 'medium' district, run the following commands:

[jialiu@jialiu-laptop ~]$ rest_api_app phptest |grep profile
+ '[' X1 == X0 ']'
+ curl -k -X GET -H 'Accept: application/xml' --user jialiu:214214 https://ec2-23-22-247-24.compute-1.amazonaws.com/broker/rest/domains/jialiu/applications/phptest/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0      <gear-profile>medium</gear-profile>
100 10294    0 10294    0     0   5380      0 --:--:--  0:00:01 --:--:--  7722
+ set +x

[jialiu@jialiu-laptop ~]$ rest_api_app_resource phptest gear_groups|grep profile
+ curl -k -X GET -H 'Accept: application/xml' --user jialiu:214214 https://ec2-23-22-247-24.compute-1.amazonaws.com/broker/rest/domains/jialiu/applications/phptest/gear_groups
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   649    0   649    0     0    330      0 --:--:--  0:00:01 --:--:--   480
      <gear-profile>small</gear-profile>
+ set +x

Comment 5 Rajat Chopra 2012-06-20 15:44:33 UTC
the other endpoint is also fixed now. li.repo rev#06bb60c09d6e2408a9f77735ef5eee75db697859

Comment 6 Rony Gong 🔥 2012-06-21 05:12:35 UTC
fixed on devenv_stg220

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <type>gear_groups</type>
  <version>1.0</version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
  </supported-api-versions>
  <data>
    <gear-group>
      <name>@@app/cart-jbosseap-6.0/group-app-servers</name>
      <gear-profile>medium</gear-profile>
      <gears>
        <gear>
          <state>started</state>
          <id>b390390573b043b193fce238c5cbd83b</id>
        </gear>
      </gears>
      <cartridges>
        <cartridge>
          <name>jbosseap-6.0</name>
        </cartridge>
      </cartridges>
    </gear-group>
  </data>
  <status>ok</status>
  <messages/>
</response>