Hide Forgot
Description of problem: folder_path will return Japanese if "Folder Name" left empty when provisioning VMs. This will cause the provisioning failed. Version-Release number of selected component (if applicable): CFME 5.6.1 VMware vsphere with Japanese language setting How reproducible: 100% Steps to Reproduce: 1. Set the VMware vsphere's language to Japanese 2. Leave "Folder Name" empty when provisioning a VM Actual results: The provisioning will fail. Expected results: The provisioning should succeed Additional info: This issue didn't happen in CloudForms 3.1 according to the customer. Currently the customer is using the following workaround. vmdb/app/models/manageiq/providers/vmware/infra_manager/provision/cloning.rb def find_folder(folder_path, datacenter) EmsFolder.where(:name => File.basename(folder_path)).detect do |f| f.folder_path.sub(/^データセンター\//, 'Datacenters/') == folder_path && f.parent_datacenter == datacenter end end
*** This bug has been marked as a duplicate of bug 1368137 ***
Hi Chen, Not sure if this appliance is still available - If it is - is there anyway I can get the folder_path before the .sub method modifies it? e.g. f.folder_path.sub(/^データセンター\//, 'Datacenters/') == folder_path Or - I can take a look if the appliance itself is available to me and/or it is running in English. Thanks! ~Drew
Hi Drew, That's my customer's environment and I'm not sure the customer could cooperate with us. But I'll try to ask the value of folder_path. So you want the value of f.folder_path am I right ? Best Regards, Chen
Hi Chen, Yes - f.folder_path would be perfect. Thanks! ~Drew
Hi Drew, Here is the reply from the customer: データセンター/DataCenter01/vm Best Regards, Chen
Hi Drew, Sorry for reopening the bug. The project will be online shortly so they can not wait for 5.6.2's release. Could you please help me to create a hotfix ? Best Regards, Chen
Hi Drew, The customer reported that after applying the cloning.rb, they can not do the following any more. Provision VM Clone this VM Publish this VM to a Template The error message is the same for the above operations: [----] E, [2016-09-14T14:53:03.448821 #2896:955998] ERROR -- : Q-task_id([miq_provision_136]) MIQ(ManageIQ::Providers::Vmware::InfraManager::Provision#provision_error) [[NoMethodError]: undefined method `ems_ref' for #<HostStorage:0x0000000d0fcd70>] encountered during phase [start_clone_task] [----] E, [2016-09-14T14:53:03.448958 #2896:955998] ERROR -- : Q-task_id([miq_provision_136]) /opt/rh/cfme-gemset/gems/activemodel-5.0.0/lib/active_model/attribute_methods.rb:433:in `method_missing' I uploaded the logs to the collaboration-shell. collab-shell.usersys.redhat.com:/cases/01690311/01690311-20160915.zip/01690311-20160915 I can see in https://bugzilla.redhat.com/show_bug.cgi?id=1368137 we are modifying another file ? In addition, as the customer's project has to be online next week, do you think the workaround which the customer provides is good enough ? Best Regards, Chen
Created attachment 1202614 [details] dest_folder method, find_folder method Take the 2 (dest_folder, find_folder) methods in this attachment and replace each of the corresponding methods in app/models/manageiq/providers/vmware/infra_manager/provision/cloning.rb Replacing only those methods in the existing cloning.rb will solve the problem currently handled by the regex for the Japanese characters.
Hi Drew, I can see the those two methods are the same as version 5.6.1.2. Does it mean if update to 5.6.1.2 the problem will be gone ? What I am using: 5.6.1.2-20160810181333_8ba817b And looking back to the first cloning.rb (attachment #1200269 [details]), it seems that only two places were modified compared to 5.6.1.2. Maybe the customer was not using the newest 5.6.1.2. I'm afraid the following changes are the ones you wanted the customer to make ? # diff cloning.rb cloning.rb.bak 68c68 < vm_folder = "#{host_dc.folder_path}/vm" --- > vm_folder = "Datacenters/#{host_dc.name}/vm" 73c73 < EmsFolder.where(:name => File.basename(folder_path), :ems_id => source.ems_id).detect do |f| --- > EmsFolder.where(:name => File.basename(folder_path)).detect do |f| Best Regards, Chen
Hi Drew, I found that I misunderstood the patch. I've already provided new patch to the customer and waiting for their feedback. Best Regards, Chen
Hi Drew, The customer said the new hotfix is not working in their environment and the provisioning is failing. >[----] E, [2016-09-26T12:27:48.875503 #2870:1021998] ERROR -- : Q-task_id([miq_provision_151]) MIQ(ManageIQ::Providers::Vmware::InfraManager::Provision#provision_error) [[NoMethodError]: undefined method `name' for nil:NilClass] encountered during phase [start_clone_task] >[----] E, [2016-09-26T12:27:48.875637 #2870:1021998] ERROR -- : Q-task_id([miq_provision_151]) /var/www/miq/vmdb/app/models/manageiq/providers/vmware/infra_manager/provision/cloning.rb:84:in `log_clone_options' But in my test environment there is no such a problem. Best Regards, Chen
Created attachment 1205011 [details] evm.log
Clearing NEEDINFO comment for me. ~Drew