You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by DaanHoogland <gi...@git.apache.org> on 2017/04/14 09:55:15 UTC

[GitHub] cloudstack pull request #2044: CLOUDSTACK-9877 Cleanup unlinked templates

GitHub user DaanHoogland opened a pull request:

    https://github.com/apache/cloudstack/pull/2044

    CLOUDSTACK-9877 Cleanup unlinked templates

    This implements CLOUDSTACK-9877 by marking templates for gc when
    1. the template they where created with is deleted from cloudstack
    2. all vms that still use it were created as full clones

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shapeblue/cloudstack cleanup-unlinked-templates

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/2044.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 #2044
    
----
commit 7a051b31587e43f94b49bf6f26478b33fc8c4c42
Author: Daan Hoogland <da...@shapeblue.com>
Date:   2017-03-23T15:45:43Z

    CE-110 move config to public fields

commit cf495adfd3fea9fc4806bb1453bbe05d2200f155
Author: Daan Hoogland <da...@shapeblue.com>
Date:   2017-04-14T07:33:35Z

    CE-110 remove duplicate-unused functionality

commit 5cd18ebfb61839816f827eef8b0604c052edf96d
Author: Daan Hoogland <da...@shapeblue.com>
Date:   2017-04-14T07:41:46Z

    CE-110 task for marking cleaning fully cloned templates
      implemented by marking them for GC

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #2044: CLOUDSTACK-9877 Cleanup unlinked templates

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the issue:

    https://github.com/apache/cloudstack/pull/2044
  
    ah ok, I was not aware of that @serg38 . I'll look it up, except from not enabling the feature, how would you handle this?
    a. To not allow restore
    b. To recognise that the disk is fully cloned and bypass the null-template (if almighty vmware allows)
    c. To allow for choosing a successor-template
    d. ...
    Also, Is this a blocker for you?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #2044: CLOUDSTACK-9877 Cleanup unlinked templates

Posted by serg38 <gi...@git.apache.org>.
Github user serg38 commented on the issue:

    https://github.com/apache/cloudstack/pull/2044
  
    @DaanHoogland Not for us since we still use link clones but I am sure tons of other might be affected. Interestingly enough that with PR 1773 merged the default behavior in API is not to allow template deletion if there are active VMs and only if 'forced' flag is used it will be executed
    # c is an option already but I suggest one of the following
    #d introduce another global config with default value = false e.g. vmware.cleanup.fullclonedtemplate that would be a switch old/new behaviur in combination with storage.template.cleanup.enabled
    #e make 0 as a default value for vmware.full.clone.template.cleanup.period and when you  interpret 0 it means that full clone cleanup thread thread never
    
    #e seems to be a good compromise that doesn't require too many changes


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #2044: CLOUDSTACK-9877 Cleanup unlinked templates

Posted by serg38 <gi...@git.apache.org>.
Github user serg38 commented on the issue:

    https://github.com/apache/cloudstack/pull/2044
  
    @DaanHoogland Can you clarify few questions/concerns
    1. This change will likely to break restoreVirtualMachine functions. At the very least users should be able to turn off new behavior with a global setting that will enable/disable such cleanup.
    2. Does this affect a normal template cleanup that will delete both full and linked clone templates from PS when all VMs that use them are gone?
    3. You introduce vmware.full.clone.template.cleanup.period as vmware specific setting. Is this only applicable to vmware?
    4. Some changes are done to Vmware-Host-Scan  task that seems to be unrelated to scope of this PR.



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #2044: CLOUDSTACK-9877 Cleanup unlinked templates

Posted by serg38 <gi...@git.apache.org>.
Github user serg38 commented on the issue:

    https://github.com/apache/cloudstack/pull/2044
  
    @DaanHoogland Thanks. But for #1 the requirement for the code changes is that the template is deleted from cloudstack. In this condition  restoreVirtualMachines when template ID is not specified  will use a local template copy on PS for either full or link clone.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #2044: CLOUDSTACK-9877 Cleanup unlinked templates

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the issue:

    https://github.com/apache/cloudstack/pull/2044
  
    @serg38 
    ad 1. yes they can, if you look in the ticket there is a part of description that describes this possibility. But that said I don't see how restore is going to be hindered if the vm was created using a full clone. The image is not deleted.
    ad 2. No it is only marking templates for gc and not touching any cleanup process, it relies on the regular process to do the actual cleanup. The benefit is that short lived templates that will be replaced by cron jobs for instance will be cleaned without having to wait until the VMs cloned from it are all gone (on a per primary store basis btw)
    ad 3. Yes so far it is I have not studied other hypervisors on this area. The code is now in the vmware plugin but not tightly coupled to the vmware API so generalizing it shoud be rather trivial.
    ad 4. the host scan task was an empty placeholder with only todo. The vcente clusters are not scanned for new hosts atm. If you look at the old code you can find that the task consists of only a comment:
    ```
        private Runnable getHostScanTask() {
            return new Runnable() {
                @Override
                public void run() {
                    // TODO scan vSphere for newly added hosts.
                    // we are going to both support adding host from CloudStack UI and
                    // adding host via vSphere server
                    //
                    // will implement host scanning later
                }
            };
        }
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---