Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1359268

Summary: Cloudforms attempts to connect to he wrong tenant to reach an instance
Product: Red Hat CloudForms Management Engine Reporter: Felix Dewaleyne <fdewaley>
Component: ProvidersAssignee: Tzu-Mainn Chen <tzumainn>
Status: CLOSED CURRENTRELEASE QA Contact: Omri Hochman <ohochman>
Severity: high Docs Contact:
Priority: high    
Version: 5.6.0CC: cpelland, ealcaniz, fdewaley, gblomqui, jfrey, jhajyahy, jhardy, jocarter, obarenbo, opavlenk, rrasouli, simaishi, tzumainn
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0   
Hardware: All   
OS: All   
Whiteboard: openstack:tenant
Fixed In Version: 5.7.0.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1370207 1389392 (view as bug list) Environment:
Last Closed: 2017-01-11 20:16:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Openstack Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1370207, 1389392, 1391882    

Description Felix Dewaleyne 2016-07-22 16:11:07 UTC
Description of problem:
When attempting to open a console to an instance, cloudforms fails to connect because theinstance does not exist for that tenant - it attempts to use the wrong tenant

Version-Release number of selected component (if applicable):
reproduced in 5.4 and 5.6 

How reproducible:
very frequent in customer environment

Steps to Reproduce:
1. set up a multiple host openstack environment
2. set up multiple projects, some of which use the same names
3. connect cloudforms to the openstack environment
4. try to open a console to instances that are located on the different projects

Actual results:
[----] E, [2016-07-22T13:23:45.070974 #2448:10f5e8c] ERROR -- : excon.error     #<Excon::Errors::NotFound: Expected([200, 202]) <=> Actual(404 Not Found)
excon.error.response
  :body          => "{\"itemNotFound\": {\"message\": \"Instance fd53f617-8b5b-4814-b4c1-f3de1376946d could not be found.\", \"code\": 404}}"
  :headers       => {



Expected results:
the connection establishes


Additional info:
see attachments

Comment 7 Dave Johnson 2016-07-29 02:06:56 UTC
Ronnie, can you please reach out and work with Felix on reproducing this in house.

Comment 24 CFME Bot 2016-11-09 23:16:13 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/73d3f6b441df17df83712ee4e6e77b3930f0e007

commit 73d3f6b441df17df83712ee4e6e77b3930f0e007
Author:     Adam Grare <agrare@redhat.com>
AuthorDate: Wed Nov 9 11:34:47 2016 -0500
Commit:     Oleg Barenboim <chessbyte@gmail.com>
CommitDate: Wed Nov 9 18:14:13 2016 -0500

    Merge pull request #12486 from petrblaho/openstack-cloud-vm-use-correct-tenant
    
    Adds connection_options to OS Cloud VM
    (cherry picked from commit e5bf22a7b2f74f9b70a8c1c4950c63b2560d34e7)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1359268

 .../providers/openstack/cloud_manager/vm.rb        | 19 ++++++++
 .../providers/openstack/cloud_manager/vm_spec.rb   | 51 +++++++++++++++++-----
 2 files changed, 58 insertions(+), 12 deletions(-)

Comment 25 Ronnie Rasouli 2016-12-07 13:35:31 UTC
verifed with single tenant which is not admin

c7ac4662775349579fc1519a3f922b12 | test_project

in nova the api call looks right tenant 

fb98 exchange 'nova' topic 'consoleauth' _send /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:448
2016-12-07 13:30:59.476 113864 DEBUG oslo_messaging._drivers.amqpdriver [-] received reply msg_id: 9e972e3b15e543438ca2ecb07b12fb98 __call__ /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:296
2016-12-07 13:30:59.477 113864 INFO nova.osapi_compute.wsgi.server [req-4afe8451-58fc-412f-be26-250c57026df1 e710f864933843ed88220f7984fafb00 c7ac4662775349579fc1519a3f922b12 - default default] 172.17.1.17 "POST /v2.1/servers/b533dfbf-d886-406a-