Description of problem: There appears to be NO correlation between the Orphaned vs Archived VM's state in Cloudforms. When VM's are deleted from disk sometimes they are marked as "archived" or times there marked as "orphaned". The vmdb/app/models/vm_or_template.rb has the following code snippet: ~~~ def archived? self.ext_management_system.nil? && self.storage.nil? end alias archived archived? def orphaned? self.ext_management_system.nil? && !self.storage.nil? end alias orphaned orphaned? ~~~ The VM state should be archived if the VM and associated VM disks were deleted and orphaned if the VM was deleted but the disks remain. However, with RHEV, it's a 50/50 gamble to see what state your VM will end up in when you delete the VM since half the time it picks archived and the other half the time it picks orphaned even though the VM's disks were deleted. If the machine is deleted from disk in ANY manner it should be marked as Archived in CF, which doesn't currently happen. Version-Release number of selected component (if applicable): CFME-5.5.0.13.20151201120956_653c0d4 How reproducible: Always Steps to Reproduce: 1. Delete the VM along with disk from RHEV provider 2. Check its status on CFME UI. Actual results: When VM's are deleted from disk sometimes they are marked as "archived" or times there marked as "orphaned" Expected results: When VM's are deleted from disk it should be marked as "archived".
Hi, so I tried to reproduce it on my environment and failed. The attached screen shot shows that all the 8 machines I tried with turned out to be Archives, which is the expected result. I can see the code was changed, the lines that are in the bug description changed as well. Ilanit maybe you can reproduce it in your env?
I checked several scenarios, on cfme 5.6.0.7-beta2.6.20160516171555_b1be31f, and rhevm-3.6.7-0.1: 1. Remove a VM, including it's disk, from rhev side => Turned into Archived. 2. Remove a VM from cfme side => Turned into Archived 3. Remove a VM from rhev side, without removing the disk => Turned into Archived scenario 3. is expected to turn into Orphaned, but from some reason it turned into Archived. (I did have in some previous cfme upstream version some Orphaned, and some archived, though I did not recall removing VMs, without removing their disk as well, but I do not know how to reproduce it)
On CFME 5.6.0.8-rc1.20160524155303_f2a5a50, adding same rhev provider, now show VM in scenario 3 as Orphaned.
For RHEV setup of 100 UP VMs (in 1 vmpool), moving 50 VMs to Down state. Then remove the vmpool. On CFME side, some of the VMs are seen as Archived, and some as Orphaned. Versions: - rhevm-3.6.6.2-0.1.el6 - cfme: 5.6.0.11-rc2.2.20160614152915_f315c68
PR: https://github.com/ManageIQ/manageiq/pull/12788
Verified on CFME-5.8.0.13/RHV-4.1.1.8 Tried multiple times to remove VMs (with/without removing the VM's disks), and the VM turned into the expected state on CFME side (Archived/Orphaned)
Moving qe_test_coverage to +, since there are automation tests, running for CFME/RHV, for VM archived/orphaned status.