{"action":"created","issue":{"url":"https://api.github.com/repos/apache/cloudstack/issues/1560","repository_url":"https://api.github.com/repos/apache/cloudstack","labels_url":"https://api.github.com/repos/apache/cloudstack/issues/1560/labels{/name}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/1560/comments","events_url":"https://api.github.com/repos/apache/cloudstack/issues/1560/events","html_url":"https://github.com/apache/cloudstack/pull/1560","id":156590869,"number":1560,"title":"CLOUDSTACK-9386: DS template copies don’t get deleted in VMware ESXi with multiple clusters and zone wide storage","user":{"login":"nvazquez","id":5295080,"avatar_url":"https://avatars.githubusercontent.com/u/5295080?v=3","gravatar_id":"","url":"https://api.github.com/users/nvazquez","html_url":"https://github.com/nvazquez","followers_url":"https://api.github.com/users/nvazquez/followers","following_url":"https://api.github.com/users/nvazquez/following{/other_user}","gists_url":"https://api.github.com/users/nvazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/nvazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvazquez/subscriptions","organizations_url":"https://api.github.com/users/nvazquez/orgs","repos_url":"https://api.github.com/users/nvazquez/repos","events_url":"https://api.github.com/users/nvazquez/events{/privacy}","received_events_url":"https://api.github.com/users/nvazquez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-05-24T19:34:45Z","updated_at":"2016-09-12T20:29:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/1560","html_url":"https://github.com/apache/cloudstack/pull/1560","diff_url":"https://github.com/apache/cloudstack/pull/1560.diff","patch_url":"https://github.com/apache/cloudstack/pull/1560.patch"},"body":"JIRA TICKET: https://issues.apache.org/jira/browse/CLOUDSTACK-9386\r\n\r\n### Introduction\r\nIn 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.\r\n\r\n### Description of the problem\r\nSuppose we have multiple clusters `(c1, c2,...,cN)` on a data center and template `T` from which we deploy vms on `c1.`\r\nSuppose now that we expunge those vms, and there's no other vm instance from template `T,` so this was the actual workflow:\r\n\r\n1. CloudStack marks template for cleanup after `storage.cleanup.interval` seconds, by setting `marked_for_gc = 1` on `template_spool_ref` table, for that template.\r\n\r\n2. After another `storage.cleanup.interval` seconds a `DestroyCommand` will be sent, to delete template from primary storage\r\n\r\n3. 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.\r\n\r\n### Proposed solution\r\nWe 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"},"comment":{"url":"https://api.github.com/repos/apache/cloudstack/issues/comments/246481222","html_url":"https://github.com/apache/cloudstack/pull/1560#issuecomment-246481222","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/1560","id":246481222,"user":{"login":"serg38","id":16176702,"avatar_url":"https://avatars.githubusercontent.com/u/16176702?v=3","gravatar_id":"","url":"https://api.github.com/users/serg38","html_url":"https://github.com/serg38","followers_url":"https://api.github.com/users/serg38/followers","following_url":"https://api.github.com/users/serg38/following{/other_user}","gists_url":"https://api.github.com/users/serg38/gists{/gist_id}","starred_url":"https://api.github.com/users/serg38/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serg38/subscriptions","organizations_url":"https://api.github.com/users/serg38/orgs","repos_url":"https://api.github.com/users/serg38/repos","events_url":"https://api.github.com/users/serg38/events{/privacy}","received_events_url":"https://api.github.com/users/serg38/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T20:29:17Z","updated_at":"2016-09-12T20:29:17Z","body":"@rafaelweingartner @jburwell @karuturi Integration tests passed after merge conflict resolution\r\n\r\ntest DeployVM in anti-affinity groups for project ... === TestName: test_DeployVmAntiAffinityGroup_in_project | Status : SUCCESS ===\r\ntest DeployVM in anti-affinity groups ... === TestName: test_DeployVmAntiAffinityGroup | Status : SUCCESS ===\r\nTest Deploy Virtual Machine ... SKIP: Skipping test because suitable hypervisor/host not                    present\r\nTest Deploy Virtual Machine from ISO ... === TestName: test_deploy_vm_from_iso | Status : SUCCESS ===\r\nTest deploy virtual machine with root resize ... === TestName: test_00_deploy_vm_root_resize | Status : SUCCESS ===\r\nTest proper failure to deploy virtual machine with rootdisksize of 0 ... === TestName: test_01_deploy_vm_root_resize | Status : SUCCESS ===\r\nTest proper failure to deploy virtual machine with rootdisksize less than template size ... === TestName: test_02_deploy_vm_root_resize | Status : SUCCESS ===\r\nTest to deploy vm with a first fit offering ... === TestName: test_deployvm_firstfit | Status : SUCCESS ===\r\nTest deploy VMs using user concentrated planner ... === TestName: test_deployvm_userconcentrated | Status : SUCCESS ===\r\nTest deploy VMs using user dispersion planner ... === TestName: test_deployvm_userdispersing | Status : SUCCESS ===\r\nTest userdata as GET, size > 2k ... === TestName: test_deployvm_userdata | Status : SUCCESS ===\r\nTest userdata as POST, size > 2k ... === TestName: test_deployvm_userdata_post | Status : SUCCESS ===\r\nTest to create disk offering ... === TestName: test_01_create_disk_offering | Status : SUCCESS ===\r\nTest to create  a sparse type disk offering ... === TestName: test_02_create_sparse_type_disk_offering | Status : SUCCESS ===\r\nTest to create  a sparse type disk offering ... === TestName: test_04_create_fat_type_disk_offering | Status : SUCCESS ===\r\nTest to update existing disk offering ... === TestName: test_02_edit_disk_offering | Status : SUCCESS ===\r\nTest to delete disk offering ... === TestName: test_03_delete_disk_offering | Status : SUCCESS ===\r\nTest to ensure 4 default roles cannot be deleted ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTest to check role, role permissions and account life cycles ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTest for role-rule enforcement in case of multiple mgmt servers ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTest to ensure role in use cannot be deleted ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests normal lifecycle operations for roles ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests role update ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests that default four roles exist ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests role update ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests role update when role is in use by an account ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests concurrent order updation of role permission ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests creation of role permission ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests deletion of role permission ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests listing of default role's permission ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\nTests order updation of role permission ... SKIP: Dynamic Role-Based API checker not enabled, skipping test\r\ntest update configuration setting at zone level scope ... === TestName: test_UpdateConfigParamWithScope | Status : SUCCESS ===\r\nTest guest vlan range dedication ... === TestName: test_dedicateGuestVlanRange | Status : SUCCESS ===\r\nTest create public & private ISO ... === TestName: test_01_create_iso | Status : SUCCESS ===\r\nTest Edit ISO ... === TestName: test_02_edit_iso | Status : SUCCESS ===\r\nTest delete ISO ... === TestName: test_03_delete_iso | Status : SUCCESS ===\r\nTest for extract ISO ... === TestName: test_04_extract_Iso | Status : SUCCESS ===\r\nUpdate & Test for ISO permissions ... === TestName: test_05_iso_permissions | Status : SUCCESS ===\r\nTest for copy ISO from one zone to another ... SKIP: Not enough zones available to perform copy template\r\nTest delete ISO ... === TestName: test_07_list_default_iso | Status : SUCCESS ===\r\nTest listing Volumes using 'ids' parameter ... === TestName: test_01_list_volumes | Status : SUCCESS ===\r\nTest listing Templates using 'ids' parameter ... === TestName: test_02_list_templates | Status : SUCCESS ===\r\nTest listing Snapshots using 'ids' parameter ... === TestName: test_03_list_snapshots | Status : SUCCESS ===\r\nTest to create Load balancing rule with source NAT ... === TestName: test_01_create_lb_rule_src_nat | Status : SUCCESS ===\r\nTest to create Load balancing rule with non source NAT ... === TestName: test_02_create_lb_rule_non_nat | Status : SUCCESS ===\r\nTest for assign & removing load balancing rule ... === TestName: test_assign_and_removal_lb | Status : SUCCESS ===\r\nTests that SAML users are not allowed CloudStack local log in ... === TestName: login_test_saml_user | Status : SUCCESS ===\r\ntest_nic_secondaryip_add_remove (integration.smoke.test_multipleips_per_nic.TestDeployVM) ... === TestName: test_nic_secondaryip_add_remove | Status : SUCCESS ===\r\nTest network ACL lists and items in VPC ... === TestName: test_network_acl | Status : SUCCESS ===\r\n# 1. Register a template for VMware with nicAdapter vmxnet3 ... SKIP: VCenter API Integration Remaining\r\nTest to add and update added nic to a virtual machine ... === TestName: test_01_nic | Status : SUCCESS ===\r\nTest to update a physical network and extend its vlan ... === TestName: test_extendPhysicalNetworkVlan | Status : SUCCESS ===\r\ntest update configuration setting at storage scope ... === TestName: test_UpdateStorageOverProvisioningFactor | Status : SUCCESS ===\r\ntest_create_pvlan_network (integration.smoke.test_pvlan.TestPVLAN) ... === TestName: test_create_pvlan_network | Status : SUCCESS ===\r\nTest for create region ... === TestName: test_createRegion | Status : SUCCESS ===\r\nTest reset virtual machine on reboot ... === TestName: test_01_reset_vm_on_reboot | Status : SUCCESS ===\r\nTest volume detail ... === TestName: test_01_updatevolumedetail | Status : SUCCESS ===\r\nTest scale virtual machine ... SKIP: Skipping scale VM operation because                    VMware tools are not installed on the VM\r\nTest to create service offering ... === TestName: test_01_create_service_offering | Status : SUCCESS ===\r\nTest to update existing service offering ... === TestName: test_02_edit_service_offering | Status : SUCCESS ===\r\nTest to delete service offering ... === TestName: test_03_delete_service_offering | Status : SUCCESS ===\r\nTest to change service to a small capacity ... === TestName: test_04_change_offering_small | Status : SUCCESS ===\r\nTest List secondary storage VMs ... === TestName: test_01_list_sec_storage_vm | Status : SUCCESS ===\r\nTest List console proxy VMs ... === TestName: test_02_list_cpvm_vm | Status : SUCCESS ===\r\nTest SSVM Internals ... === TestName: test_03_ssvm_internals | Status : SUCCESS ===\r\nTest CPVM Internals ... === TestName: test_04_cpvm_internals | Status : SUCCESS ===\r\nTest stop SSVM ... === TestName: test_05_stop_ssvm | Status : SUCCESS ===\r\nTest stop CPVM ... === TestName: test_06_stop_cpvm | Status : SUCCESS ===\r\nTest reboot SSVM ... === TestName: test_07_reboot_ssvm | Status : SUCCESS ===\r\nTest reboot CPVM ... === TestName: test_08_reboot_cpvm | Status : SUCCESS ===\r\nTest destroy SSVM ... === TestName: test_09_destroy_ssvm | Status : SUCCESS ===\r\nTest destroy CPVM ... === TestName: test_10_destroy_cpvm | Status : SUCCESS ===\r\nTests allowed APIs for common account types ... === TestName: test_static_role_account_acls | Status : SUCCESS ===\r\nTest create public & private template ... === TestName: test_01_create_template | Status : SUCCESS ===\r\nTest when createTemplate is used to create templates having the same name all of them get ... === TestName: test_CreateTemplateWithDuplicateName | Status : SUCCESS ===\r\nTest Edit template ... === TestName: test_02_edit_template | Status : SUCCESS ===\r\nTest delete template ... === TestName: test_03_delete_template | Status : SUCCESS ===\r\nTest for extract template ... === TestName: test_04_extract_template | Status : SUCCESS ===\r\nUpdate & Test for template permissions ... === TestName: test_05_template_permissions | Status : SUCCESS ===\r\nTest for copy template from one zone to another ... SKIP: Not enough zones available to perform copy template\r\nTest only public templates are visible to normal user ... === TestName: test_07_list_public_templates | Status : SUCCESS ===\r\nTest System templates are not visible to normal user ... === TestName: test_08_list_system_templates | Status : SUCCESS ===\r\nCheck events in usage_events table when VM creation fails ... === TestName: test_01_positive_tests_usage | Status : SUCCESS ===\r\nTest advanced zone virtual router ... === TestName: test_advZoneVirtualRouter | Status : SUCCESS ===\r\nTests for basic zone virtual router ... === TestName: test_basicZoneVirtualRouter | Status : SUCCESS ===\r\nTest Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS ===\r\nTest Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS ===\r\nTest Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS ===\r\nTest Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS ===\r\nTest Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS ===\r\nTest destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS ===\r\nTest recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS ===\r\nTest migrate VM ... === TestName: test_08_migrate_vm | Status : SUCCESS ===\r\nTest destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS ===\r\nTest for attach and detach ISO to virtual machine ... === TestName: test_10_attachAndDetach_iso | Status : SUCCESS ===\r\nTest Volume creation for all Disk Offerings (incl. custom) ... === TestName: test_01_create_volume | Status : SUCCESS ===\r\nAttach a created Volume to a Running VM ... === TestName: test_02_attach_volume | Status : SUCCESS ===\r\nDownload a Volume attached to a VM ... === TestName: test_03_download_attached_volume | Status : SUCCESS ===\r\nDelete a Volume attached to a VM ... === TestName: test_04_delete_attached_volume | Status : SUCCESS ===\r\nDetach a Volume attached to a VM ... === TestName: test_05_detach_volume | Status : SUCCESS ===\r\nDownload a Volume unattached to an VM ... === TestName: test_06_download_detached_volume | Status : SUCCESS ===\r\nTest resize (negative) non-existent volume ... SKIP: Resize Volume is unsupported on VmWare and Hyper-V\r\nTest resize a volume ... SKIP: Resize Volume is unsupported on VmWare and Hyper-V\r\nDelete a Volume unattached to an VM ... === TestName: test_09_delete_detached_volume | Status : SUCCESS ===\r\n\r\n----------------------------------------------------------------------\r\nRan 104 tests in 10873.015s\r\n\r\nOK (SKIP=21)"}}
{"actor":{"display_login":"serg38"}}