Created attachment 1418733 [details] dro error message Description of problem: When creating a dro, I am not able to delte any dros nor the generic object class Version-Release number of selected component (if applicable): 5.9.2.0.20180320210136_355c506 How reproducible: 100% Steps to Reproduce: 1. Create a dro class 2. create an object 3. try to delete the class Actual results: see attachment Expected results: dro and class should be deleted Additional info:
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 the severity to Low.
irb(main):012:0> $evm.vmdb('generic_object_definition').find_by(:name => 'f5bigip') PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0 PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0 PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0 PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0 => #<MiqAeServiceGenericObjectDefinition:0x62c5384 @object=#<GenericObjectDefinition id: 99000000000001, name: "f5bigip", description: "Big ip load balancer", properties: {:attributes=>{"poolname"=>:string, "vip"=>:string, "node1"=>:string, "node2"=>:string}, :associations=>{"service"=>"Service", "vm"=>"Vm"}, :methods=>[]}, created_at: "2018-04-07 17:27:46", updated_at: "2018-04-07 17:27:46">, @virtual_columns=["generic_objects_count", "href_slug", "region_description", "region_number"], @associations=[]> irb(main):013:0> generic_object.destroy results in irb(main):011:0> generic_object.destroy NoMethodError: PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0 PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0 undefined method `destroy' for #<MiqAeMethodService::MiqAeServiceGenericObjectDefinition:0x0000000aca7ba0> from /opt/rh/cfme-gemset/bundler/gems/cfme-automation_engine-ac0e90bcdfeb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:233:in `method_missing' from (irb):11 from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands/console.rb:65:in `start' from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands/console_helper.rb:9:in `start' from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands/commands_tasks.rb:78:in `console' from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands/commands_tasks.rb:49:in `run_command!' from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands.rb:18:in `<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>'
Here with correct definitions irb(main):003:0* generic_object_definition = $evm.vmdb(:generic_object_definition).find_by(:name => 'f5bigip') PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0 PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0 PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0 PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0 => #<MiqAeServiceGenericObjectDefinition:0x4f8583c @object=#<GenericObjectDefinition id: 99000000000001, name: "f5bigip", description: "Big ip load balancer", properties: {:attributes=>{"poolname"=>:string, "vip"=>:string, "node1"=>:string, "node2"=>:string}, :associations=>{"service"=>"Service", "vm"=>"Vm"}, :methods=>[]}, created_at: "2018-04-07 17:27:46", updated_at: "2018-04-07 17:27:46">, @virtual_columns=["generic_objects_count", "href_slug", "region_description", "region_number"], @associations=[]> irb(main):004:0> generic_object_definition.inspect_all PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0 PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0 => "#<MiqAeServiceGenericObjectDefinition:0x4f8583c @object=#<GenericObjectDefinition id: 99000000000001, name: \"f5bigip\", description: \"Big ip load balancer\", properties: {:attributes=>{\"poolname\"=>:string, \"vip\"=>:string, \"node1\"=>:string, \"node2\"=>:string}, :associations=>{\"service\"=>\"Service\", \"vm\"=>\"Vm\"}, :methods=>[]}, created_at: \"2018-04-07 17:27:46\", updated_at: \"2018-04-07 17:27:46\">, @virtual_columns=<generic_objects_count: 2, href_slug: \"generic_object_definitions/99000000000001\", region_description: \"Region 99\", region_number: 99>, @associations=[]>" How do I get rid of the @virtual_columns=<generic_objects_count: 2?
Ok thanks to Greg I was able to delete the DRO, $evm.vmdb(:generic_object).where(:generic_object_definition => 99000000000001).each {|dro| dro.remove_from_vmdb} Please keep this open as there is currently no option of deleting the DRO from the UI
Brad - As I recall not exposing the delete functionality in the UI was by design. There is no RBAC on these objects which would allow anyone with visibility to this area of the UI to delete them.
Note: Deleting an instance from automate is supported (see comment #6) as well as from the api through the 'delete' action.
Agreed with comment #7 and comment #8. This can be done as a custom button on the DRO and that can control the access via the service since DRO don't have direct RBAC but the service does. OK to close?
Yes, can be closed. I think it should be revisited tough, As for a customer, it might not look like it works correctly. There is also no documentation on howto delete it via rest api iirc.
Thanks, Laurent. I checked and the documentation in currently in a PR. PR: https://github.com/ManageIQ/manageiq_docs/pull/676 There's a lot in that PR so more specifically you are looking for: https://github.com/abellotti/manageiq_docs/blob/746d84a86f4e60b5283900d4bfa204c341d999ec/api/reference/generic_objects.adoc#deleting-generic-objects