Bug 1716858 - [RFE] Expose move_into_folder(folder) ruby method to Automate Explorer
Summary: [RFE] Expose move_into_folder(folder) ruby method to Automate Explorer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.10.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.11.0
Assignee: drew uhlmann
QA Contact: Ganesh Hubale
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-04 10:03 UTC by Khushbu Borole
Modified: 2023-03-24 14:53 UTC (History)
12 users (show)

Fixed In Version: 5.11.0.19
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-12 13:36:27 UTC
Category: Feature
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:4199 0 None None None 2019-12-12 13:36:39 UTC

Description Khushbu Borole 2019-06-04 10:03:12 UTC
Description of problem:
To move VMWare VMs to folders ruby method move_into_folder(folder) can be used.
While this method is not exposed to Automate Explorer hence can't use $evm.vmdb.
Could this be exposed to Automate Explorer ?

Version-Release number of selected component (if applicable):
Red Hat CloudForms 5.10

How reproducible:
Always

Steps to move VM to a folder using a Ruby Method, but can not be done using Automate:
1. login to the appliance
2. `vmdb`
3. rails c
4. irb(main):004:0> vm = Vm.find_by_name('<vm_name>')
5. irb(main):013:0> folder = EmsFolder.find_by(:name => '<folder_name>')
6. irb(main):014:0> vm.move_into_folder(folder) unless folder.nil?

Actual results:
Not exposed to Automate Explorer hence can't use $evm.vmdb

Expected results:
This ruby method should be exposed to automate.

Additional info:
Does CloudForms plan to work on this in future?

Comment 2 drew uhlmann 2019-06-10 12:29:55 UTC
Hey Dennis, could I get you to mark this as a 5.11 only RFE please? 

The code to do it is already on master, so technically it can be closed as current release. 

I believe this is VMWare only, there's a question about what else might support this.

Comment 3 dmetzger 2019-06-11 12:33:38 UTC
Has documentation been made aware of this change?

Comment 4 drew uhlmann 2019-06-11 12:41:40 UTC
Since the functionality was technically originally introduced in March of '17 I should sure hope so but who even knows? 

https://github.com/ManageIQ/manageiq/pull/14465
and https://github.com/ManageIQ/manageiq-automation_engine/pull/308

Comment 5 drew uhlmann 2019-07-09 14:22:03 UTC
Hey Suyog, I don't know if the docs team is aware of this.

Comment 7 drew uhlmann 2019-07-10 12:19:09 UTC
Hey Suyog, that I think looks good, except it's a bit more complicated. I've no idea what the right way of addressing this is, actually, because with https://github.com/ManageIQ/manageiq/pull/14465 move_into_folder is merely one of a bunch of methods that are now dynamically exposed on the Automate Service models (see https://github.com/ManageIQ/manageiq/pull/14465#issue-112112165).

Comment 8 drew uhlmann 2019-07-17 16:44:24 UTC
This is needed for Monday, and the work's done, and I'd like to move it to post, but we have this unresolved docs question and I'm not sure what the next step with this but it's not actionable on my part.

Comment 10 drew uhlmann 2019-07-22 15:56:44 UTC
Hey Tina, per comments 8 and 9 and 2, this is needed soon -- today -- and it's not actionable for me at the moment, could you please look at it?

Comment 12 Tina Fitzgerald 2019-07-22 17:56:59 UTC
Hi Dennis,

The work for this is complete. There is likely more to be done documentation wise, but I'd like to see if this can move to POST for dev complete. Can we discuss?

Thanks,
Tina

Comment 13 Tina Fitzgerald 2019-07-22 20:13:04 UTC
Hi Dennis,
 
After further review, I think this ticket can be moved to POST, and another ticket opened for the dynamically created service models.

Setting to POST.

Thanks,
Tina

Comment 14 Tina Fitzgerald 2019-07-22 20:54:26 UTC
Hi Suyog,

The method documentation looks good. 

I opened this new ticket for the additional documentation required to explain the dynamic service model generation. 
https://bugzilla.redhat.com/show_bug.cgi?id=1732169

Let me know if you have any questions.

Thanks,
Tina

Comment 15 Suyog Sainkar 2019-07-22 21:31:18 UTC
Thanks, Tina. I'll address dynamic service model generation documentation via bug 1732169 in a separate PR.

Comment 17 Ganesh Hubale 2019-07-31 12:29:20 UTC
Hi Satoe,

I have checked this RFE on latest version of 5.10.8.0 and 5.10.11.17 but I am getting error while using 'move_into_folder'.

Please let me know, In which version we are adding this RFE. 

Fixed in version is not available.

Thanks,
Ganesh

Comment 19 drew uhlmann 2019-07-31 12:51:59 UTC
Hey Ganesh, please put the error in the ticket with the backtrace. Thanks.

Comment 20 drew uhlmann 2019-07-31 13:15:18 UTC
And a reproducer, please!

Comment 23 drew uhlmann 2019-07-31 15:06:23 UTC
Thanks for the information, Ganesh. 

The method in question is part of a vm relocation though, I wouldn't expect the lines you ran to work. 

It looks like, per https://github.com/ManageIQ/manageiq/commit/6ec2e3f6d3aa6c96bcf08b60c5208de9ccdb99b5, we're using that method as part of the LifeCycle/Migrate VM code, so I'm going to go ahead and tag Lucy on this, maybe she can tell you how to best test this.

Comment 24 Lucy Fu 2019-07-31 15:45:03 UTC
Ganesh's testing seems good to me. The issue is move_to_folder method is not exposed to automate.

[----] E, [2019-07-31T10:56:02.775518 #12289:44a5a5c] ERROR -- : <AEMethod test_method>   DRb::DRbRemoteError: undefined method `move_into_folder' for #<MiqAeMethodService::MiqAeServiceManageIQ_Providers_Vmware_InfraManager_Vm:0x0000000003420f60> (NoMethodError)

The method should be added into MiqAeServiceManageIQ_Providers_Vmware_InfraManager_Vm since it is VMware specific.

Comment 25 Ganesh Hubale 2019-07-31 16:11:12 UTC
Thanks Lucy for your information. 

As per comment 24 'move_into_folder' is not exposed to automate.

Hence failing this BZ.

Comment 28 CFME Bot 2019-08-12 16:20:48 UTC
New commit detected on ManageIQ/manageiq/ivanchuk:

https://github.com/ManageIQ/manageiq/commit/95cbe8eba21b5f2c55d08a61335118ee72f933ae
commit 95cbe8eba21b5f2c55d08a61335118ee72f933ae
Author:     Greg McCullough <gmccullo>
AuthorDate: Mon Aug 12 11:30:35 2019 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Mon Aug 12 11:30:35 2019 -0400

    Merge pull request #19086 from d-m-u/allow_move_into_folder_to_take_ems_ref

    Allow move_into_folder to optionally take string arg for automate engine exposure

    (cherry picked from commit e088fad7b7349ec960588498dc5d854b12486845)

    https://bugzilla.redhat.com/show_bug.cgi?id=1716858

 app/models/vm_or_template/operations/relocation.rb | 19 +-
 spec/models/vm_migrate_task_spec.rb | 27 +-
 2 files changed, 44 insertions(+), 2 deletions(-)

Comment 29 CFME Bot 2019-08-12 16:22:25 UTC
New commit detected on ManageIQ/manageiq-automation_engine/ivanchuk:

https://github.com/ManageIQ/manageiq-automation_engine/commit/960830d3f106cd728319a3a677802659d43dc716
commit 960830d3f106cd728319a3a677802659d43dc716
Author:     Greg McCullough <gmccullo>
AuthorDate: Mon Aug 12 12:05:25 2019 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Mon Aug 12 12:05:25 2019 -0400

    Merge pull request #344 from d-m-u/expose_move_into_folder

    Expose move_into_folder on the engine

    (cherry picked from commit 445f6a0505eb025638853be5a59f41832cb1fa85)

    https://bugzilla.redhat.com/show_bug.cgi?id=1716858

 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm.rb | 6 +
 spec/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm_spec.rb | 16 +-
 2 files changed, 20 insertions(+), 2 deletions(-)

Comment 31 Ganesh Hubale 2019-08-21 13:51:52 UTC
Fixed!

I can able to VMWare vm to custom VM folder using exposed automate method - move_into_folder

Verified on version: 5.11.0.19.20190813184334_ed72c9f

Comment 33 errata-xmlrpc 2019-12-12 13:36:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:4199


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