Fix for CLOUDSTACK-9660 - #2098
Conversation
A root volume can be replaced by a different root volume without the VM it belongs to being expunged. From dev@: For example: Let’s say we have a system VM running on NFS primary storage. We then put this primary storage into maintenance mode, which creates the system VM (with the same name) on a different primary storage (we do not create a new row in the cloud.vm_instance table for this VM). While this VM works, the original root disk of the system VM remains on the original primary storage and is not destroyed by the code in StorageManagerImpl.cleanupStorage(boolean) in 4.10 because 4.10 (as shown above) only asks for non-root volumes to consider for deletion. In the 4.9 version of the code, the original root disk is cleaned up in StorageManagerImpl.cleanupStorage(boolean). The problem with 4.10 relying on a root disk always being deleted when the VM it belongs to is deleted is that in a situation like this that the system VM doesn’t get deleted at this point – it gets a new root disk that’s hosted by a different primary storage (so now it’s original root disk is stranded).
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-715 |
|
code changes LGTM. @borisstoyanov can you run CI on this? |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Something went wrong, will rekick the tests. |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-731 |
|
@blueorangutan test centos7 vmware-55u3 |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-55u3) has been kicked to run smoke tests |
|
Trillian test result (tid-1106)
|
|
@mike-tutkowski
|
|
I also run against kvm: |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
For test_vm_life_cycle.test_08_migrate_vm, it looks like the test was run in a bad state for some reason: jobresult : {errorcode : 431, errortext : u'Cannot migrate VM, VM is already presnt on this host, please specify valid destination host to migrate the VM'} For test_deploy_vm_root_resize, it appears its XML config file references an OS type that doesn't exist. |
|
Thanks @mike-tutkowski. Let us wait and see if there are same failures in the next run. |
|
@karuturi sure |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-55u3) has been kicked to run smoke tests |
|
Trillian test result (tid-1124)
|
|
Trillian test result (tid-1123)
|
|
failures werent reported in this run. merging this now. |
Remoção de exibição de dados da infraestrutura durante exceção ao anexar e desanexar volume de VM. Closes apache#2098 See merge request scclouds/scclouds!1162
A root volume can be replaced by a different root volume without the VM it belongs to being expunged.
From dev@:
For example: Let’s say we have a system VM running on NFS primary storage. We then put this primary storage into maintenance mode, which creates the system VM (with the same name) on a different primary storage (we do not create a new row in the cloud.vm_instance table for this VM). While this VM works, the original root disk of the system VM remains on the original primary storage and is not destroyed by the code in StorageManagerImpl.cleanupStorage(boolean) in 4.10 because 4.10 (as shown above) only asks for non-root volumes to consider for deletion. In the 4.9 version of the code, the original root disk is cleaned up in StorageManagerImpl.cleanupStorage(boolean). The problem with 4.10 relying on a root disk always being deleted when the VM it belongs to is deleted is that in a situation like this that the system VM doesn’t get deleted at this point – it gets a new root disk that’s hosted by a different primary storage (so now it’s original root disk is stranded).
*** Update on May 19, 2017 ***
I recently discovered a new use case (in addition to the one above) that this PR fixes:
Reinstall VM
When you run a "Reinstall VM", the root disk is removed from the VM and a new one is given to the VM. The old root disk later gets cleaned up by the storage cleanup thread.
https://issues.apache.org/jira/browse/CLOUDSTACK-9917