Bug 1392828

Summary: Composable roles deployment fails with KeyError: 'CountDefault' error message
Product: Red Hat OpenStack Reporter: Marius Cornea <mcornea>
Component: python-tripleoclientAssignee: James Slagle <jslagle>
Status: CLOSED ERRATA QA Contact: Omri Hochman <ohochman>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: dbecker, hbrock, jcoufal, jschluet, jslagle, mburns, morazi, rhel-osp-director-maint, rhos-flags, sasha, sclewis, scohen
Target Milestone: rcKeywords: Triaged
Target Release: 10.0 (Newton)Flags: scohen: needinfo+
scohen: needinfo+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tripleoclient-5.3.0-7.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-14 16:30: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:

Description Marius Cornea 2016-11-08 10:27:18 UTC
Description of problem:
Composable roles deployment fails with KeyError: 'CountDefault' error message

GET call to compute for http://192.168.0.1:8774/v2.1/os-hypervisors/statistics used request id req-454cc9e0-8765-4c84-aa58-f78e93ee5700
Checking nodes count
'CountDefault'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 387, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 59, in run
    return self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 1125, in take_action
    stack, parameters, parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 763, in _predeploy_verify_capabilities
    default_role_counts = self._get_default_role_counts(parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 730, in _get_default_role_counts
    r['CountDefault'])
KeyError: 'CountDefault'
clean_up DeployOvercloud: 'CountDefault'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 135, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 267, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 180, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 387, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 59, in run
    return self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 1125, in take_action
    stack, parameters, parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 763, in _predeploy_verify_capabilities
    default_role_counts = self._get_default_role_counts(parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 730, in _get_default_role_counts
    r['CountDefault'])
KeyError: 'CountDefault'

END return value: 1

Version-Release number of selected component (if applicable):
openstack-tripleo-heat-templates-5.0.0-1.3.el7ost.noarch
openstack-tripleo-common-5.3.0-3.el7ost.noarch
python-tripleoclient-5.3.0-5.el7ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. Deploy overcloud with composable roles, environment files and deploy command below:
http://paste.openstack.org/show/588354/

Actual results:
Deployment fails: KeyError: 'CountDefault'

Expected results:
Deployment succeeds.

Comment 1 Marius Cornea 2016-11-08 14:17:25 UTC
Workaround: add CountDefault: 0 to all roles in roles_data.yaml

Comment 2 Alexander Chuzhoy 2016-11-08 21:55:16 UTC
Reproduced the issue: after updating the undercloud to latest, tried to re-run the deployment command with --update-only arg.

Adding the patch resolved the issue:
curl -4 https://review.openstack.org/changes/394924/revisions/4f5be2b7d98347d5fd6ae40ce26fec52749007e9/patch?download |base64 -d |sudo patch  -d /usr/lib/python2.7/site-packages/tripleoclient/ -p2

Comment 7 errata-xmlrpc 2016-12-14 16:30:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-2948.html