Description of problem: Return message <Fault xmlns="https://yellowstone.usersys.redhat.com/api/vms"> <error> <kind>internal_server_error</kind> <klass>NoMethodError</klass> <message>undefined method `datacenter_name' for #<ManageIQ::Providers::Vmware::InfraManager::Vm:0x00000006e0d700></message> </error> </Fault> Evm.log error [----] I, [2016-06-21T14:29:00.141415 #3518:114b990] INFO -- : <AutomationEngine> Followed Relationship [miqaedb:/unknown/VM/Provisioning/Profile/EvmGroup-super_administrator#get_dialog_name] [----] I, [2016-06-21T14:29:00.141784 #3518:114b990] INFO -- : <AutomationEngine> Followed Relationship [miqaedb:/System/Request/UI_PROVISION_INFO#create] [----] I, [2016-06-21T14:29:00.142270 #3518:114b990] INFO -- : MIQ(MiqProvisionVirtWorkflow#get_dialogs) Loading dialogs <miq_provision_dialogs> for user <admin> [----] I, [2016-06-21T14:29:00.325133 #3518:114b990] INFO -- : MIQ(MiqProvisionVirtWorkflow#ws_template_fields) data:<{:guid=>"ab76030c-328c-11e6-a956-001a4aa47711", :request_type=>"clone_to_vm"}> [----] I, [2016-06-21T14:29:00.325256 #3518:114b990] INFO -- : MIQ(MiqProvisionVirtWorkflow#ws_template_fields) VM Passed: <> <ab76030c-328c-11e6-a956-001a4aa47711> <> Datacenters:<nil> [----] I, [2016-06-21T14:29:00.330538 #3518:114b990] INFO -- : MIQ(MiqProvisionVirtWorkflow#source_vm_rbac_filter) Checking for allowed templates for User: <admin> Role: <EvmRole-super_administrator> Group: <EvmGroup-super_administrator> VM Filter: <nil> Passing ini tal template IDs: <[12000000001703]> [----] E, [2016-06-21T14:29:00.344133 #3518:114b990] ERROR -- : MIQ(MiqProvisionVirtWorkflow.from_ws_ver_1_x) <undefined method `datacenter_name' for #<ManageIQ::Providers::Vmware::InfraManager::Vm:0x00000006b6b150>> [----] E, [2016-06-21T14:29:00.345825 #3518:114b990] ERROR -- : <API> MIQ(ApiController.api_error) API Error [----] E, [2016-06-21T14:29:00.345954 #3518:114b990] ERROR -- : <API> MIQ(ApiController.api_error) NoMethodError: undefined method `datacenter_name' for #<ManageIQ::Providers::Vmware::InfraManager::Vm:0x00000006b6b150> [----] E, [2016-06-21T14:29:00.346154 #3518:114b990] ERROR -- : <API> MIQ(ApiController.api_error) API Error [----] E, [2016-06-21T14:29:00.346934 #3518:114b990] ERROR -- : <API> MIQ(ApiController.api_error) [----] E, [2016-06-21T14:29:00.347028 #3518:114b990] ERROR -- : <API> MIQ(ApiController.api_error) Provision_requests { "version" : "1.1", "template_fields" : { "guid" : "ab76030c-328c-11e6-a956-001a4aa47711", "request_type" : "clone_to_vm" }, "vm_fields" : { "number_of_cpus" : 1, "vm_name" : "aab_rest_vm1", "vm_memory" : "1024", "vlan" : "rhevm" }, "requester" : { "user_name" : "admin", "owner_first_name" : "John", "owner_last_name" : "Doe", "owner_email" : "jdoe", "auto_approve" : true }, "tags" : { "network_location" : "Internal", "cc" : "001" }, "additional_values" : { "request_id" : "1001" }, "ems_custom_attributes" : { }, "miq_custom_attributes" : { } } Version-Release number of selected component (if applicable): 5.5 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Josh - Is this a result of http://talk.manageiq.org/t/how-to-clone-vm-not-template-via-rest-api/1545 ? The description is missing some details. Is the idea here that the user is the template_fields guid referencing a template or VM?
https://github.com/ManageIQ/manageiq/pull/9557
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/4faf4c231cad146bd8dc6e2ef96ac80f2e31fc1f commit 4faf4c231cad146bd8dc6e2ef96ac80f2e31fc1f Author: Drew Bomhof <dbomhof> AuthorDate: Thu Jun 30 14:01:21 2016 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Thu Jun 30 15:04:27 2016 -0400 clone_to_vm provision requests no longer fail https://bugzilla.redhat.com/show_bug.cgi?id=1348681 Using the :clone_to_vm request_type was causing a failure when looking up the datacenter name and failing while attempting to run the dialog method :allowed_templates. This PR moves up setting the hash key :src_vm_id into the init_options hash, while returning a miq_hash_struct from the ws_find_template_or_vm method if it returns an RBAC object. app/models/miq_provision_virt_workflow.rb | 8 +++++--- spec/models/miq_provision_virt_workflow_spec.rb | 23 +++++++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-)
Fixed. Verified in 5.7.0.0.20160906172503_12f65cb