Bug 1488313 - [NoMethodError]: undefined method `root_disk_size' for nil:NilClass')] when provisioning VM using service catalog
Summary: [NoMethodError]: undefined method `root_disk_size' for nil:NilClass')] when p...
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: GA
: cfme-future
Assignee: Greg McCullough
QA Contact: Dave Johnson
Depends On:
Blocks: 1465087
TreeView+ depends on / blocked
Reported: 2017-09-05 06:43 UTC by Sachin
Modified: 2017-11-17 21:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-09-05 14:48:18 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:

Attachments (Terms of Use)
dialog (2.52 KB, text/x-vhdl)
2017-09-05 06:43 UTC, Sachin
no flags Details

Description Sachin 2017-09-05 06:43:46 UTC
Created attachment 1322074 [details]

Description of problem:

When service dialog as 'instance_type' has one of the field the provision fails throwing error
[----] I, [2017-09-04T11:53:09.309923 #15662:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) Starting Phase <provision_error>
[----] E, [2017-09-04T11:53:09.330479 #15662:9e9134] ERROR -- : Q-task_id([miq_provision_78000000000013]) MIQ(ManageIQ::Providers::Openstack::CloudManager::Provision#provision_error) [[NoMethodError]: undefined 
method `root_disk_size' for nil:NilClass] encountered during phase [prepare_volumes]
[----] E, [2017-09-04T11:53:09.330592 #15662:9e9134] ERROR -- : Q-task_id([miq_provision_78000000000013]) /var/www/miq/vmdb/app/models/manageiq/providers/openstack/cloud_manager/provision/volume_attachment.rb:38
:in `default_volume_attributes'
/var/www/miq/vmdb/app/models/manageiq/providers/openstack/cloud_manager/provision/volume_attachment.rb:3:in `create_requested_volumes'
/var/www/miq/vmdb/app/models/manageiq/providers/cloud_manager/provision/state_machine.rb:14:in `prepare_volumes'

This error is then caught by AE's miq_provision.message when lead to automation failure

[----] I, [2017-09-04T11:54:12.780168 #15654:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> Method exited with rc=MIQ_OK
[----] I, [2017-09-04T11:54:12.780715 #15654:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> Followed  Relationship [miqaedb:/Cloud/VM/Provisioning/StateMachines/Methods/CheckProv
[----] I, [2017-09-04T11:54:12.780871 #15654:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> Processed  State=[CheckProvisioned] with Result=[error]
[----] W, [2017-09-04T11:54:12.781035 #15654:9e9134]  WARN -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> Error in State=[CheckProvisioned]
[----] I, [2017-09-04T11:54:12.781300 #15654:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> In State=[CheckProvisioned], invoking [on_error] method=[update_provision_status(statu
s => '[NoMethodError]: undefined method `root_disk_size' for nil:NilClass')]
[----] I, [2017-09-04T11:54:13.169452 #15654:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> Updated namespace [Cloud/VM/Provisioning/StateMachines/VMProvision_vm/update_provision
_status  ManageIQ/Cloud/VM/Provisioning/StateMachines]
[----] I, [2017-09-04T11:54:13.182414 #15654:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> Invoking [inline] method [/ManageIQ/Cloud/VM/Provisioning/StateMachines/VMProvision_VM
/update_provision_status] with inputs [{"status"=>"[NoMethodError]: undefined method `root_disk_size"}]
[----] I, [2017-09-04T11:54:13.183281 #15654:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> <AEMethod [/ManageIQ/Cloud/VM/Provisioning/StateMachines/VMProvision_VM/update_provisi
on_status]> Starting 
[----] I, [2017-09-04T11:54:13.295651 #15662:9e9134]  INFO -- : MIQ(AuthUseridPassword#validation_successful) [ExtManagementSystem] [78000000000003], previously valid/invalid on: [2017-09-04 15:53:53 UTC]/[], pr
evious status: [Valid]
[----] I, [2017-09-04T11:54:13.311464 #15662:9e9134]  INFO -- : MIQ(MiqQueue.put) Message id: [78000000006167],  id: [], Zone: [default], Role: [], Server: [], Ident: [generic], Target id: [], Instance id: [], T
ask id: [], Command: [MiqEvent.raise_evm_event], Timeout: [600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: [["ManageIQ::Providers::Openstack::CloudManager", 78000000000003], "ems_auth_vali
d", {}]
[----] I, [2017-09-04T11:54:13.311777 #15662:9e9134]  INFO -- : MIQ(MiqQueue#delivered) Message id: [78000000006137], State: [ok], Delivered in [1.068428702] seconds
[----] I, [2017-09-04T11:54:13.324619 #15662:9e9134]  INFO -- : MIQ(MiqGenericWorker::Runner#get_message_via_drb) Message id: [78000000006138], MiqWorker id: [78000000000002], Zone: [default], Role: [ems_operati
ons], Server: [], Ident: [generic], Target id: [], Instance id: [78000000000004], Task id: [], Command: [ExtManagementSystem.authentication_check_types], Timeout: [600], Priority: [100], State: [dequeue], Delive
r On: [2017-09-04 15:54:07 UTC], Data: [], Args: [[], {:attempt=>1}], Dequeued in: [65.351350225] seconds
[----] I, [2017-09-04T11:54:13.324766 #15662:9e9134]  INFO -- : MIQ(MiqQueue#deliver) Message id: [78000000006138], Delivering...
[----] I, [2017-09-04T11:54:13.333349 #15662:9e9134]  INFO -- : MIQ(ManageIQ::Providers::Openstack::CloudManager#with_provider_connection) Connecting through ManageIQ::Providers::Openstack::CloudManager: [rhosp1
[----] I, [2017-09-04T11:54:13.762503 #15654:9db174]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> Validating Notification type: automate_user_error
[----] I, [2017-09-04T11:54:13.763836 #15654:9db174]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> Calling Create Notification type: automate_user_error subject type: MiqRequest id: 780
00000000006 options: {:message=>"VM Provision Error: [EVM] VM [changeme] Step [CheckProvisioned] Status [[NoMethodError]: undefined method `root_disk_size] Message [[NoMethodError]: undefined method `root_disk_s
ize' for nil:NilClass] "}
[----] I, [2017-09-04T11:54:13.811391 #15654:9e9134]  INFO -- : Q-task_id([miq_provision_78000000000013]) <AutomationEngine> <AEMethod [/ManageIQ/Cloud/VM/Provisioning/StateMachines/VMProvision_VM/update_provisi
on_status]> Ending

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

How reproducible:

Steps to Reproduce:
1. Create a service catalog of type openstack using attached service dialog
2. Try to order catalog

Actual results:
Provision fails with error

Expected results:
Should be able to provision VM from service dialog with field 'instance_type'

Additional info:
Service dialog attached

Comment 3 Dave Johnson 2017-09-05 06:45:18 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set it to Low/Low.

Comment 4 Sachin 2017-09-05 06:53:33 UTC
Set severity to medium, but this bug blocks testing of BZ#1481446

Comment 5 Greg McCullough 2017-09-05 14:48:18 UTC
The dialog is setting the instance_type field to a string when it needs to reference the id object instance_type (flavor) in the database.  

I would recommend creating a dynamic field to collect these values or if you want to use this static dialog field you will need to modify the automate to translate this value into the proper database id value.

Field type definition from the attached dialog:
      - name: instance_type
        description: Flavor
        data_type: string
        display: edit
        display_method_options: {}
        required: true
        required_method_options: {}
        - - 
          - "<Choose>"
        - - m1.tiny
          - m1.tiny
        - - m1.small
          - m1.small
        - - m1.medium
          - m1.medium

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