Bug 1506667 - [REGRESSION][AZURE]Can't provision VM from private image
Summary: [REGRESSION][AZURE]Can't provision VM from private image
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: GA
: 5.10.0
Assignee: Nick LaMuro
QA Contact: Dave Johnson
URL:
Whiteboard: azure:provision:regression
Depends On:
Blocks: 1509389 1509391
TreeView+ depends on / blocked
 
Reported: 2017-10-26 14:08 UTC by Leo Khomenko
Modified: 2018-06-21 20:53 UTC (History)
7 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1509389 1509391 (view as bug list)
Environment:
Last Closed: 2018-06-21 20:53:35 UTC
Category: Bug
Cloudforms Team: Azure
Target Upstream Version:
Embargoed:
lkhomenk: automate_bug+


Attachments (Terms of Use)

Description Leo Khomenko 2017-10-26 14:08:42 UTC
Description of problem: Unable to provision VM from private image (e.g. Microsoft.Compute/Images/lkhomenk/tmpl-osDisk)

[----] I, [2017-10-26T07:22:57.735373 #12388:37512c]  INFO -- : Q-task_id([miq_provision_2]) MIQ(ManageIQ::Providers::Azure::CloudManager#with_provider_connection) Connecting through ManageI
Q::Providers::Azure::CloudManager: [azure]
[----] I, [2017-10-26T07:22:59.552636 #12388:37512c]  INFO -- : Q-task_id([miq_provision_2]) Starting Phase <provision_error>
[----] E, [2017-10-26T07:22:59.569150 #12388:37512c] ERROR -- : Q-task_id([miq_provision_2]) MIQ(ManageIQ::Providers::Azure::CloudManager::Provision#provision_error) [[ArgumentError]: wrong 
number of arguments (given 2, expected 0..1)] encountered during phase [prepare_provision]
[----] E, [2017-10-26T07:22:59.569289 #12388:37512c] ERROR -- : Q-task_id([miq_provision_2]) /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/storage_account_service.rb:21:in `
list'
/opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/storage_account_service.rb:190:in `list_private_images'
/opt/rh/cfme-gemset/bundler/gems/manageiq-providers-azure-9f0acf6b3e0f/app/models/manageiq/providers/azure/cloud_manager/provision/cloning.rb:27:in `gather_storage_account_properties'
/opt/rh/cfme-gemset/bundler/gems/manageiq-providers-azure-9f0acf6b3e0f/app/models/manageiq/providers/azure/cloud_manager/provision/cloning.rb:63:in `prepare_for_clone_task'
/var/www/miq/vmdb/app/models/miq_provision/state_machine.rb:14:in `prepare_provision'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:21:in `signal'
/var/www/miq/vmdb/app/models/manageiq/providers/cloud_manager/provision/state_machine.rb:17:in `prepare_volumes'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:21:in `signal'
/var/www/miq/vmdb/app/models/manageiq/providers/cloud_manager/provision/state_machine.rb:9:in `determine_placement'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:21:in `signal'
/var/www/miq/vmdb/app/models/manageiq/providers/cloud_manager/provision/state_machine.rb:3:in `create_destination'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:21:in `signal'
/var/www/miq/vmdb/app/models/miq_provision/state_machine.rb:4:in `run_provision'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:21:in `signal'
/var/www/miq/vmdb/app/models/miq_provision_task.rb:14:in `do_request'
/var/www/miq/vmdb/app/models/miq_request_task.rb:194:in `execute'
/var/www/miq/vmdb/app/models/miq_queue.rb:452:in `block in dispatch_method'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:91:in `block in timeout'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `block in catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:106:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:451:in `dispatch_method'
/var/www/miq/vmdb/app/models/miq_queue.rb:428:in `block in deliver'
/var/www/miq/vmdb/app/models/user.rb:252:in `with_user_group'
/var/www/miq/vmdb/app/models/miq_queue.rb:428:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:105:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:134:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:152:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:328:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:328:in `do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:155:in `run'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:129:in `start'



Version-Release number of selected component (if applicable):5.9.0.4


How reproducible:100%


Steps to Reproduce:
1.Provision VM using tamplate/vhd in storage account


Actual results: Provision failure


Expected results: Should be fine

Comment 2 Bronagh Sorota 2017-10-26 19:19:05 UTC
Hi Nick

Looks like this bug crept in with PR https://github.com/ManageIQ/azure-armrest/pull/319
See line: 
https://github.com/ManageIQ/azure-armrest/blob/master/lib/azure/armrest/storage_account_service.rb#L190

A second argument is being passed to the "list" method but that method only takes 1.
Can this boolean just be removed? So the line above would become:

   storage_accounts = list(group)

Comment 3 Nick LaMuro 2017-10-26 19:48:34 UTC
Yes, removing the boolean would have been one option, since we were just targeting the `list_all_private_images` in the PR mentioned.

That said, the code for updating that method to support the savings from #319 was not that hard to do, and I did just that:

https://github.com/ManageIQ/azure-armrest/pull/345

We can choose either solution, really, just this one moves us closer to using this mechanism in more places.

Comment 4 Bronagh Sorota 2017-10-26 19:50:07 UTC
Hi Nick
Assigning to you since you already fixed it.

Bronagh

Comment 5 Nick LaMuro 2017-10-27 15:04:15 UTC
https://github.com/ManageIQ/azure-armrest/pull/345 merged, waiting for it to be merged into a gem release and shipped in a MIQ/CFME build.

Comment 6 Bronagh Sorota 2017-11-02 13:46:28 UTC
Fixed in version 0.9.2 of the azure-armrest gem

Comment 7 Satoe Imaishi 2017-11-03 16:48:47 UTC
PR to bump azure-armrest version: https://github.com/ManageIQ/manageiq-providers-azure/pull/154


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