{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8158","repository_url":"https://api.github.com/repos/ManageIQ/manageiq","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8158/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8158/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8158/events","html_url":"https://github.com/ManageIQ/manageiq/issues/8158","id":150131678,"number":8158,"title":"AMQP connection ignores user-specified AMQP address/port, uses keystone address","user":{"login":"infrahub","id":15850444,"avatar_url":"https://avatars.githubusercontent.com/u/15850444?v=3","gravatar_id":"","url":"https://api.github.com/users/infrahub","html_url":"https://github.com/infrahub","followers_url":"https://api.github.com/users/infrahub/followers","following_url":"https://api.github.com/users/infrahub/following{/other_user}","gists_url":"https://api.github.com/users/infrahub/gists{/gist_id}","starred_url":"https://api.github.com/users/infrahub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infrahub/subscriptions","organizations_url":"https://api.github.com/users/infrahub/orgs","repos_url":"https://api.github.com/users/infrahub/repos","events_url":"https://api.github.com/users/infrahub/events{/privacy}","received_events_url":"https://api.github.com/users/infrahub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"Ladas","id":1737058,"avatar_url":"https://avatars.githubusercontent.com/u/1737058?v=3","gravatar_id":"","url":"https://api.github.com/users/Ladas","html_url":"https://github.com/Ladas","followers_url":"https://api.github.com/users/Ladas/followers","following_url":"https://api.github.com/users/Ladas/following{/other_user}","gists_url":"https://api.github.com/users/Ladas/gists{/gist_id}","starred_url":"https://api.github.com/users/Ladas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ladas/subscriptions","organizations_url":"https://api.github.com/users/Ladas/orgs","repos_url":"https://api.github.com/users/Ladas/repos","events_url":"https://api.github.com/users/Ladas/events{/privacy}","received_events_url":"https://api.github.com/users/Ladas/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-04-21T16:54:33Z","updated_at":"2016-04-27T08:54:38Z","closed_at":null,"body":"The AMQP connection uses the OpenStack keystone hostname/address rather than what the \r\nuser entered in the AMQP tab when adding an OpenStack cloud provider. It also uses the port from configuration rather than what the user entered.\r\n\r\nAlthough this needs review by someone more knowledgeable, if I change event_monitor_options in \r\n/var/www/miq/vmdb/app/models/manageiq/providers/openstack/manager_mixin.rb \r\nand add the three lines below to the if statement, the problem is solved:\r\n\r\n      if self.has_authentication_type? :amqp\r\n        amqp_conn_config = self.connection_configuration_by_role(\"amqp\")\r\n        opts[:hostname] = amqp_conn_config.endpoint.hostname\r\n        opts[:port] = amqp_conn_config.endpoint.port\r\n\r\nRepro:\r\nEnter credentials on \"Default\" tab for keystone, validate, switch to AMQP tab, enter hostname, port, creds, click validate. Check /var/www/miq/vmdb/evm.log and note that the connection fails because it used the wrong address:\r\n\r\n[----] I, [2016-04-21T11:40:21.873313 #12119:987998]  INFO -- : MIQ(MiqQueue#delivered) Message id: [56], State: [ok], Delivered in [0.074782437] seconds\r\nW, [2016-04-21T11:40:28.370874 #12180]  WARN -- #<Bunny::Session:0x22270e8 a@10.99.65.51:5672, vhost=/, hosts=[10.99.65.51]>: Could not establish TCP connection to 10.99.65.51:5672:\r\n[----] I, [2016-04-21T11:40:28.371162 #12180:c1a070]  INFO -- : MIQ(OpenstackRabbitEventMonitor.test_connection) Failed testing rabbit amqp connection for 10.99.65.51.  The Openstack AMQP service may be using a different provider. Enable debug logging to see connection exception.\r\n\r\nPlease note that this bug is currently somewhat hidden because the GUI is currently reporting AMQP connection success even when it does not work. That bug is being filed as a separate issue which will be referenced in a comment."},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/215016644","html_url":"https://github.com/ManageIQ/manageiq/issues/8158#issuecomment-215016644","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8158","id":215016644,"user":{"login":"Ladas","id":1737058,"avatar_url":"https://avatars.githubusercontent.com/u/1737058?v=3","gravatar_id":"","url":"https://api.github.com/users/Ladas","html_url":"https://github.com/Ladas","followers_url":"https://api.github.com/users/Ladas/followers","following_url":"https://api.github.com/users/Ladas/following{/other_user}","gists_url":"https://api.github.com/users/Ladas/gists{/gist_id}","starred_url":"https://api.github.com/users/Ladas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ladas/subscriptions","organizations_url":"https://api.github.com/users/Ladas/orgs","repos_url":"https://api.github.com/users/Ladas/repos","events_url":"https://api.github.com/users/Ladas/events{/privacy}","received_events_url":"https://api.github.com/users/Ladas/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T08:54:38Z","updated_at":"2016-04-27T08:54:38Z","body":"this is the correct place that should be taking the options from AQMP endpoint https://github.com/manageiq/manageiq/blob/5bfab34e97dfd24bc671f210cdaa161cee4fa444/app/models/manageiq/providers/openstack/manager_mixin.rb#L68-68"}}