GitHub user nvazquez opened a pull request: https://github.com/apache/cloudstack/pull/1905
CLOUDSTACK-9738: Optimize vm expunge process for instances with vm snapshots ## Description It was noticed that expunging instances with many vm snapshots took a look of time, as hypervisor received as many tasks as vm snapshots instance had, apart from the delete vm task. We propose a way to optimize this process for instances with vm snapshots by sending only one delete task to hypervisor, which will delete vm and its snapshots ## Use cases 1. deleteVMsnapohsot-> no changes to current behavior 2. destroyVM with expunge=false -> no actions to VMsnaphsot is performed at the moment. When VM cleanup thread is executed it will perform the same sequence as (3). If instance is recovered before expunged by the cleanup thread it will remain intact with VMSnapshot chain present 3. destroyVM with expunge=true: * Vmsnaphsot is marked with removed timestamp and state = Expunging in DB * VM is deleted in HW You can merge this pull request into a Git repository by running: $ git pull https://github.com/nvazquez/cloudstack expungeVmRefactor Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1905.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1905 ---- commit f5bebb172c36710a3c795a0df542fe443c71a2c9 Author: nvazquez <nicolas.m.vazq...@gmail.com> Date: 2017-01-09T20:08:32Z CLOUDSTACK-9738: Optimize vm expunge process for instances with vm snapshots ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---