Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Tenant ID when creating Provider using API #197

Closed
juliancheal opened this issue Jan 10, 2018 · 5 comments
Closed

Missing Tenant ID when creating Provider using API #197

juliancheal opened this issue Jan 10, 2018 · 5 comments
Assignees

Comments

@juliancheal
Copy link
Member

juliancheal commented Jan 10, 2018

When creating an Azure provider using the API which includes via Ansible,
the tenant_id doesn't get set. As we're actually storing Azure's tenant_id in uid_ems internally.

So it should be:

miq.providers.create({
         :type => type,
         :provider_region => region,
         :name => name,
         :uid_ems => tenant_id,
         :subscription => subscription,
         :credentials => {
           :userid => userid,
           :password => password
          }
        })

not

miq.providers.create({
         :type => type,
         :provider_region => region,
         :name => name,
         :tenant_id => tenant_id,
         :subscription => subscription,
         :credentials => {
           :userid => userid,
           :password => password
          }
        })

screen shot 2018-01-10 at 17 26 56

@juliancheal
Copy link
Member Author

@miq-bot assign juliancheal

@juliancheal
Copy link
Member Author

If you use:

miq.providers.create({
         :type => type,
         :provider_region => region,
         :name => name,
         :azure_tenant_id => azure_tenant_id,
         :subscription => subscription,
         :credentials => {
           :userid => userid,
           :password => password
          }
        })

Which one would assume would work being as azure_tenant_id is an attribute on Azure::CloudManager https://github.com/ManageIQ/manageiq-providers-azure/blob/master/app/models/manageiq/providers/azure/cloud_manager.rb#L21

however this results in this error:

manageiq-api-client-0.2.0/lib/manageiq/api/client/connection.rb:106:in `check_response': Could not create the new provider - Invalid Provider attributes azure_tenant_id specified (RuntimeError)

@juliancheal
Copy link
Member Author

This is being fixed via:

ManageIQ/manageiq-api#279
ManageIQ/manageiq#16802
#198

@djberg96
Copy link
Collaborator

As mentioned on gitter, a tenant_id is actually an association to the tenants table. The azure_tenant_id is a string used for Azure authentication.

@juliancheal
Copy link
Member Author

Fixed! 🍰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants