Description of problem: vm.storage only returns one storage id instead of list of storage ids that are associated with VM object. Version-Release number of selected component (if applicable): 5.9 How reproducible: Always Steps to Reproduce: 1. Create a VM under Vmware provider and another hard disk under different storage domain then the one where VM is deployed. In that way, you will have multiple storage ids associated with that vm. 2. Go to Rails console and perform below commands: # vmware = $evm.vmdb('ems').find_by_name('vmware-admin') ; # vm = vmware.vms.select { |v| v.name == 'nchugh-cfme59' }.first ; # vm.storage ( only one storage id returns) Though the vm object is associated with multiple storage ids but it shows only one storage id in which Vm is deployed. But VM's active record object has inbuilt method i.e. "storage_ids" which provides the list of storage ids associated with it. #vm = VmOrTemplate.find_by_id(<vm id>) #vm.storage_ids ( will list out the storage ids assciated with it) We cannot use Active record object types directly in the automation so we need inbuilt functionality under service model object which can provide the list of the storage ids. Actual results: It returns only one storage id where the VM is deployed. Expected results: Vm.storage should return the list of storage ids associated with the VM. Additional info:
The storage property of the VmOrTemplate object by design only returns a single storage element, usually a reference to where the configuration file is stored or maybe the first disk. This object returned from this method should not change. The active record object for VmOrTemplate does expose a "storages" property to return more storage instances for the VM. This need just needs to be exposed to through the VmOrTemplate service model.
solved in: https://github.com/ManageIQ/manageiq-automation_engine/pull/187 `storages` attribute was exposed into the MiqAeServiceVmOrTemplate
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/RHSA-2019:0212