Uh oh!
There was an error while loading. Please reload this page.
CLOUDSTACK-9386: DS template copies don’t get deleted in VMware ESXi with multiple clusters and zone wide storage - #1560
Conversation
rafaelweingartner
commented
May 24, 2016
Hi @nvazquez, Thanks for the PR. Great work as always, especially on documenting the problem. I think we can improve it a little bit. What about extracting lines 5480-5485 to a method? Then, those java comments can become java docs (which I believe are much better) and also you would be able to write test cases. Also, I think we should change the “throw new Exception()” to a more specific exception. What about the CloudRuntimeException or another one? |
nvazquez
commented
May 25, 2016
Hi @rafaelweingartner thanks for your comments! |
rafaelweingartner
commented
May 25, 2016
Great job, thanks @nvazquez |
| s_logger.error(msg); | ||
| throw new CloudRuntimeException(msg); | ||
| } | ||
| VirtualMachineMO vmMo = dcMo.findVm(vol.getPath()); |
There was a problem hiding this comment.
What about using here: return dcMo.findVm(vol.getPath());
then, we could save 1 line of code ;)
There was a problem hiding this comment.
My bad, I pushed and fixed it :)
bvbharatk
commented
Jun 11, 2016
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no):https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0 Failed tests: Skipped tests: Passed test suits: |
nvazquez
commented
Aug 4, 2016
Hi guys, This pull request it's been opened for a while, @rafaelweingartner, @bvbharatk you've reviewed it before, could you give your blessing to this PR? CC: @swill |
serg38
commented
Aug 16, 2016
@rafaelweingartner@jburwell @rhtyd @koushik-das Can you review this PR? |
rafaelweingartner
commented
Aug 23, 2016
serg38
commented
Aug 29, 2016
@rhtyd @jburwell Can this be merged? |
yadvr
commented
Aug 30, 2016
LGTM (code/logic seems alright, did not run any tests). |
nvazquez
commented
Sep 1, 2016
I rebased master branch, I'll post test results for this PR |
nvazquez
commented
Sep 2, 2016
@jburwell @rhtyd I post test results: |
LGTM for testing. Re-ran smoke tests: test DeployVM in anti-affinity groups for project ... === TestName: test_DeployVmAntiAffinityGroup_in_project | Status : SUCCESS === Ran 104 tests in 9821.371s OK (SKIP=21) |
serg38
commented
Sep 11, 2016
@rafaelweingartner@jburwell This PR seems to be ready for merging as well |
jburwell
commented
Sep 11, 2016
nvazquez
commented
Sep 11, 2016
Great, thanks @jburwell! |
serg38
commented
Sep 12, 2016
@rafaelweingartner@jburwell@karuturi Integration tests passed after merge conflict resolution test DeployVM in anti-affinity groups for project ... === TestName: test_DeployVmAntiAffinityGroup_in_project | Status : SUCCESS === 1. Register a template for VMware with nicAdapter vmxnet3 ... SKIP: VCenter API Integration RemainingTest to add and update added nic to a virtual machine ... === TestName: test_01_nic | Status : SUCCESS === Ran 104 tests in 10873.015s OK (SKIP=21) |
rafaelweingartner
commented
Sep 12, 2016
@serg38 great work. |
jburwell
commented
Sep 13, 2016
@serg38 the git-pr script is not working properly for me. I will debug further tomorrow. @rafaelweingartner do you mind doing the merge honors? |
CLOUDSTACK-9386: DS template copies dont get deleted in VMware ESXi with multiple clusters and zone wide storageJIRA TICKET: https://issues.apache.org/jira/browse/CLOUDSTACK-9386 ### Introduction In some production environments with multiple clusters it was noticed that unused templates were consuming too much storage. It was discovered that template cleanup was not deleting marked templates on ESXi. ### Description of the problem Suppose we have multiple clusters `(c1, c2,...,cN)` on a data center and template `T` from which we deploy vms on `c1.` Suppose now that we expunge those vms, and there's no other vm instance from template `T,` so this was the actual workflow: 1. CloudStack marks template for cleanup after `storage.cleanup.interval` seconds, by setting `marked_for_gc = 1` on `template_spool_ref` table, for that template. 2. After another `storage.cleanup.interval` seconds a `DestroyCommand` will be sent, to delete template from primary storage 3. On `VmwareResource`, command is processed, and it first picks up a random cluster, say `ci != c1` to look for vm template (using volume's path) and destroy it. But, as template was on `c1` it cannot be found, so it won't be deleted. Entry on `template_spool_ref` is deleted but not the actual template on hypervisor side. ### Proposed solution We propose a way to attack problem shown in point 3, by not picking up a random cluster to look for vm but using vSphere data center. This way we make sure vm template will be deleted in every case, and not depending on random cluster selection * pr/1560: CLOUDSTACK-9386: Find vm on datacenter instead of randomly choosing a cluster Signed-off-by: Koushik Das <koushik@apache.org>
rafaelweingartner
commented
Sep 13, 2016
@jburwell someone else already merged ;) |
@serg38@nvazquez I just noticed that this bug was merged to master, but it should also be included in LTS My thinking is that we use the following steps to move it to the 4.9 branch and pull it forward:
Does this make sense? If so, @serg38 would you be able to quickly re-test it against 4.9? If we make this change, I would like it to be included in the upcoming 4.9.1.0 and 4.10.0.0 releases. |
nvazquez
commented
Sep 19, 2016
Thanks @jburwell, I've opened new PR (1676) against 4.9 release branch |
CLOUDSTACK-9502: DS template copies dont get deleted in VMware ESXi with multiple clusters and zone wide storage (include CLOUDSTACK-9386 into 4.9 release branch)Include #1560 into 4.9 release branch * pr/1676: CLOUDSTACK-9502: DS template copies don’t get deleted in VMware ESXi with multiple clusters and zone wide storage Signed-off-by: John Burwell <meaux@cockamamy.net>
Correção de erro de _log_ ao realizar _backup_ Closesapache#1560 See merge request scclouds/scclouds!1168
JIRA TICKET: https://issues.apache.org/jira/browse/CLOUDSTACK-9386
Introduction
In some production environments with multiple clusters it was noticed that unused templates were consuming too much storage. It was discovered that template cleanup was not deleting marked templates on ESXi.
Description of the problem
Suppose we have multiple clusters
(c1, c2,...,cN)on a data center and templateTfrom which we deploy vms onc1.Suppose now that we expunge those vms, and there's no other vm instance from template
T,so this was the actual workflow:storage.cleanup.intervalseconds, by settingmarked_for_gc = 1ontemplate_spool_reftable, for that template.storage.cleanup.intervalseconds aDestroyCommandwill be sent, to delete template from primary storageVmwareResource, command is processed, and it first picks up a random cluster, sayci != c1to look for vm template (using volume's path) and destroy it. But, as template was onc1it cannot be found, so it won't be deleted. Entry ontemplate_spool_refis deleted but not the actual template on hypervisor side.Proposed solution
We propose a way to attack problem shown in point 3, by not picking up a random cluster to look for vm but using vSphere data center. This way we make sure vm template will be deleted in every case, and not depending on random cluster selection