Bug 1387224 - unable to provision a new host using Azure as compute resource
Summary: unable to provision a new host using Azure as compute resource
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Compute Resources - Azure
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
high
high vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Kedar Bidarkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-20 11:40 UTC by Kedar Bidarkar
Modified: 2019-04-01 20:27 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-05 13:58:17 UTC
Target Upstream Version:


Attachments (Terms of Use)
the message seen when we submit the New host form (79.23 KB, image/png)
2016-10-20 11:40 UTC, Kedar Bidarkar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17043 0 None None None 2016-12-05 16:10:12 UTC

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


Note You need to log in before you can comment on or make changes to this bug.