Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1387224

Summary: unable to provision a new host using Azure as compute resource
Product: Red Hat Satellite Reporter: Kedar Bidarkar <kbidarka>
Component: Compute Resources - AzureAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: bbuckingham, bkearney, dlobatog, ehelms, kbidarka, ktordeur
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-05 13:58:17 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:
Attachments:
Description Flags
the message seen when we submit the New host form none

Description Kedar Bidarkar 2016-10-20 11:40:08 UTC
Created attachment 1212472 [details]
the message seen when we submit the New host form

Description of problem:

2016-10-20 03:21:05 b14ad3cf [app] [W] Failed to create a compute azure_provider_cr (Azure) instance karin-sadoski.redhat.com: [[31m[[1mFailed to create virtual machine : [[31m[[1mBadRequest : The hosted service name is invalid.^[[0m^[[0m^[[0m^[[0m | | RuntimeError: [[31m[[1mFailed to create virtual machine : [[31m[[1mBadRequest : The hosted service name is invalid.^[[0m^[[0m^[[0m^[[0m | /opt/theforeman/tfm/root/usr/share/gems/gems/azure-core-0.1.1/lib/azure/core/utility.rb:122:in `error_with_exit' | /opt/theforeman/tfm/root/usr/share/gems/gems/azure-0.7.5/lib/azure/virtual_machine_management/virtual_machine_management_service.rb:137:in `rescue in create_virtual_machine' | /opt/theforeman/tfm/root/usr/share/gems/gems/azure-0.7.5/lib/azure/virtual_machine_management/virtual_machine_management_service.rb:96:in `create_virtual_machine' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-azure-0.0.2/lib/fog/azure/requests/compute/create_virtual_machine.rb:27:in `create_virtual_machine' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-azure-0.0.2/lib/fog/azure/models/compute/server.rb:182:in `save' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-core-1.42.0/lib/fog/core/collection.rb:51:in `create' | /usr/share/foreman/app/models/compute_resource.rb:182:in `create_vm' | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_azure-1.0.2/app/models/foreman_azure/azure.rb:45:in `create_vm' | /usr/share/foreman/app/models/concerns/orchestration/compute.rb:82:in `setCompute' | /usr/share/foreman/app/models/concerns/orchestration.rb:191:in `execute' | /usr/share/foreman/app/models/concerns/orchestration.rb:131:in `block in process' | /usr/share/foreman/app/models/concerns/orchestration.rb:123:in `each' | /usr/share/foreman/app/models/concerns/orchestration.rb:123:in `process' | /usr/share/foreman/app/models/concerns/orchestration.rb:35:in `around_save_orchestration'
Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. populate all values for Azure Compute Resource
2. and submit the form, which fails with the below message.
3.

Actual results:
Unable to save
Failed to create a compute azure_provider_cr (Azure) instance karin-sadoski.redhat.com: [31m[1mFailed to create virtual machine : [31m[1mBadRequest : The hosted service name is invalid.[0m[0m[0m[0m 

Expected results:

We should be able to create an azure instance successfully.


Additional info:

Comment 2 Kedar Bidarkar 2016-10-20 11:47:50 UTC
Have also created an upstream issue, http://projects.theforeman.org/issues/17043

Comment 5 Ivan Necas 2016-10-27 12:21:49 UTC
Partial notes on findings. It seems there are two issues:

The original issue is passing though some empty strings to the azure API
that causes the error: after applying this patch https://github.com/adamruzicka/foreman_azure/commit/4b363330082d67406b9e4d2d610a4788484bbe14.patch the error goes away

There was additional issue after applying it, where we don't validate the image user at our side, while azure doesn't accept some of them, such as "root", so different user is needed. https://azure.microsoft.com/cs-cz/documentation/articles/virtual-machines-linux-use-root-privileges/

In order to continue successfully, we would probably need to know what is the user on image.

Comment 9 Daniel Lobato Garcia 2016-11-12 10:04:07 UTC
Upstream issue is closed - setting this to POST