Skip to content

CLOUDSTACK-9607: Preventing template deletion when template is in use. - #1773

Merged
yadvr merged 1 commit into
apache:masterfrom
priyankparihar:CLOUDSTACK-9607
Jan 4, 2018
Merged

CLOUDSTACK-9607: Preventing template deletion when template is in use.#1773
yadvr merged 1 commit into
apache:masterfrom
priyankparihar:CLOUDSTACK-9607

Conversation

@priyankparihar

@priyankpariharpriyankparihar commented Nov 24, 2016

Copy link
Copy Markdown
Contributor

For complete description please refer -> CLOUDSTACK-9607

@jburwelljburwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@priyankparihar great small enhancement to ensure the overall system integrity. This seems like it would be a very good addition for LTS users to avoid deleting in-use templates. Therefore, could you please change the base branch of the PR to 4.9?

Also, are their existing Marvin test cases that test attempts to delete in-use templates? If not, could you please create one to verify this PR?

}

s_logger.warn(s.substring(0,s.length()-2));
throw new InvalidParameterValueException(s.substring(0,s.length()-2));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 1187-1193 should replaced with the following to be DRY and improve clarity:

finalStringmessage = String.format("Unable to delete template with id: %1$s because VM instances: [%2$s] are using it.", templateId, Joiner.on(",").join(vmInstanceVOList));
s_logger.warn(message);
thrownewInvalidParameterValueException(message);

@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "the ID of zone of the template")
private Long zoneId;

@Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force delete a template.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add since to this annotation to indicate that this parameter is available in 4.9+.

@priyankparihar

Copy link
Copy Markdown
ContributorAuthor

Hi @jburwell ,
Thanks for teaching me something new. Test is also added.

@ustcweizhou

Copy link
Copy Markdown
Contributor

@priyankparihar

  1. the file change from 10644 to 10755 is not necessary
  2. the default value of forced is false, might cause issue on backwards compatibility
  3. In the vm installation, as the template is still in use , so we can find it in the storage pool where the root disk is located. We need to improve it by using the existing template image on storage pool, or copying the template from storage pool where the root disk is located to another new storage pool (pool of allocated new root disk).

@priyankparihar

Copy link
Copy Markdown
ContributorAuthor

Hi @jburwell ,
Would like to add something on @ustcweizhou comment ?

@serg38

Copy link
Copy Markdown

@priyankparihar I agree with @ustcweizhou . Default behavior should remain forced. And in this case Web UI we should give a warning with "yes and no" if template has deployed VM so users can cancel the operation if they need to.

@serg38

Copy link
Copy Markdown

@priyankparihar@ustcweizhou There seems to be just one case where it will affect resetVM operations. If template is deleted and root disk is migrated to another PS where there is no template copy at destination and the reset VM wont work. It is probably not easy to implement copying a base template from on PS to another as a part of migrate volume command. I think the right approach would be just to have a check in resetVM and if no local template copy is available then find another PS with template copy and reset root disk over there or if at that point there is no PS with template copy gracefully error out resetVM command.

@ustcweizhou

Copy link
Copy Markdown
Contributor

@serg38 yes, your approach is the best solution for now.

By the way, I've implemented the copy of template between storage pools on kvm/nfs in our branch, not implemented for other situations yet. The missing template also impact storage migration (live/offline).

@borisstoyanov

Copy link
Copy Markdown
Contributor

I agree with @serg38 and @ustcweizhou that upon deletion user should be displayed with an yes/no dialogue if there are deployed VMs, but a lot of CS user aren't using UI, but just the APIs. If the force option is enabled by default I guess the API call will go and delete the all selected templates without any warning. I think the force=true should only stay with the UI call.

@priyankparihar

Copy link
Copy Markdown
ContributorAuthor

Hi @ustcweizhou@serg38 and @borisroman,
Thanks for your valuable suggestions.

@ustcweizhou the default value of forced is false, might cause issue on backwards compatibility.

If the force option is enabled by default API call will go and delete the all selected templates without any warning so default value of forced is kept 'false'.

@ustcweizhou In the vm installation, as the template is still in use , so we can find it in the storage pool where the root disk is located. We need to improve it by using the existing template image on storage pool, or copying the template from storage pool where the root disk is located to another new storage pool (pool of allocated new root disk).

I think it will be good to take it in separate PR.

@ustcweizhou

Copy link
Copy Markdown
Contributor

@priyankparihar Then we need to notify hundreds of users to modify their application to add forced=true in deleteTemplate API (Otherwise their application might fail), which is not feasible I think.
You also need to modify your API description to add the default value, and modify UI as well.

@priyankparihar

Copy link
Copy Markdown
ContributorAuthor

Hi @ustcweizhou,
By default enabling force option(force=true) will be very risky, same is mentioned by @borisstoyanov.

@ustcweizhou

Copy link
Copy Markdown
Contributor

@priyankparihar the default behaviour is forced=true from few years ago. If the template is removed, the user vm is not impacted which is very good. There is indeed an issue when reinstall the vm. For you it could be a very risky issue. For us at least it is not a big issue as we provide some other templates for vm reinstallation.

@serg38

serg38 commented Feb 20, 2017

Copy link
Copy Markdown

@ustcweizhou@priyankparihar@borisstoyanov The default behavior was always equivalent of forced=true. We seem to agree that the UI behavior should remain forced=true but with extra warning. We can either change default confirmation "Please confirm that you want to delete this template." e.g. to "Please confirm that you want to delete this template. Features that depends on the template presence might no longer work". But I think the better option will be to have response tag in listTemplate call to indicate if active VMs exists or not. Then warning can be given only to such templates.
As for API side we might still change default behavior but we need to explicitly document it in Release Notes so users can get prepared and change instances of deleteTemplate execution to use forced=true or not as needed.

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-515

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@priyankparihar

priyankparihar commented Feb 21, 2017

Copy link
Copy Markdown
ContributorAuthor

Hi @koushik-das@rajesh-battala@devdeep ,

The default value of forced is false, might cause issue on backwards compatibility.

Should i make changes according to @serg38 and @ustcweizhou suggestion ? ( or current code LGT you, Please notify. )

@jburwell

Copy link
Copy Markdown
Contributor

@priyankparihar I agree with @ustcweizhou regarding the default value of forced in terms of backwards compatibility.

Also, why we permit deletion of a template when it is associated with one or more active volumes? It seems like we are giving the user the means to corrupt their system.

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-874)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34092 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1773-t874-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Test completed. 47 look ok, 2 have error(s)

TestResultTime (s)Test File
test_04_rvpc_privategw_static_routesFailure355.70test_privategw_acl.py
test_02_list_snapshots_with_removed_data_storeError0.04test_snapshots.py
test_01_vpc_site2site_vpnSuccess160.18test_vpc_vpn.py
test_01_vpc_remote_access_vpnSuccess71.18test_vpc_vpn.py
test_01_redundant_vpc_site2site_vpnSuccess246.46test_vpc_vpn.py
test_02_VPC_default_routesSuccess289.60test_vpc_router_nics.py
test_01_VPC_nics_after_destroySuccess533.70test_vpc_router_nics.py
test_05_rvpc_multi_tiersSuccess512.87test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nicsSuccess1406.40test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routersSuccess544.89test_vpc_redundant.py
test_02_redundant_VPC_default_routesSuccess749.53test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACLSuccess1290.57test_vpc_redundant.py
test_09_delete_detached_volumeSuccess156.51test_volumes.py
test_08_resize_volumeSuccess156.44test_volumes.py
test_07_resize_failSuccess161.58test_volumes.py
test_06_download_detached_volumeSuccess156.31test_volumes.py
test_05_detach_volumeSuccess155.74test_volumes.py
test_04_delete_attached_volumeSuccess151.24test_volumes.py
test_03_download_attached_volumeSuccess156.34test_volumes.py
test_02_attach_volumeSuccess95.61test_volumes.py
test_01_create_volumeSuccess716.35test_volumes.py
test_03_delete_vm_snapshotsSuccess275.22test_vm_snapshots.py
test_02_revert_vm_snapshotsSuccess100.67test_vm_snapshots.py
test_01_create_vm_snapshotsSuccess158.69test_vm_snapshots.py
test_deploy_vm_multipleSuccess257.71test_vm_life_cycle.py
test_deploy_vmSuccess0.03test_vm_life_cycle.py
test_advZoneVirtualRouterSuccess0.02test_vm_life_cycle.py
test_10_attachAndDetach_isoSuccess26.73test_vm_life_cycle.py
test_09_expunge_vmSuccess125.25test_vm_life_cycle.py
test_08_migrate_vmSuccess40.98test_vm_life_cycle.py
test_07_restore_vmSuccess0.10test_vm_life_cycle.py
test_06_destroy_vmSuccess125.82test_vm_life_cycle.py
test_03_reboot_vmSuccess125.82test_vm_life_cycle.py
test_02_start_vmSuccess10.39test_vm_life_cycle.py
test_01_stop_vmSuccess40.34test_vm_life_cycle.py
test_CreateTemplateWithDuplicateNameSuccess60.60test_templates.py
test_08_list_system_templatesSuccess0.03test_templates.py
test_07_list_public_templatesSuccess0.04test_templates.py
test_05_template_permissionsSuccess0.06test_templates.py
test_04_extract_templateSuccess5.17test_templates.py
test_03_delete_templateSuccess5.11test_templates.py
test_02_edit_templateSuccess90.16test_templates.py
test_01_create_templateSuccess50.53test_templates.py
test_10_destroy_cpvmSuccess166.62test_ssvm.py
test_09_destroy_ssvmSuccess168.72test_ssvm.py
test_08_reboot_cpvmSuccess101.61test_ssvm.py
test_07_reboot_ssvmSuccess133.52test_ssvm.py
test_06_stop_cpvmSuccess131.71test_ssvm.py
test_05_stop_ssvmSuccess133.80test_ssvm.py
test_04_cpvm_internalsSuccess1.19test_ssvm.py
test_03_ssvm_internalsSuccess3.36test_ssvm.py
test_02_list_cpvm_vmSuccess0.13test_ssvm.py
test_01_list_sec_storage_vmSuccess0.13test_ssvm.py
test_01_snapshot_root_diskSuccess11.11test_snapshots.py
test_04_change_offering_smallSuccess239.70test_service_offerings.py
test_03_delete_service_offeringSuccess0.04test_service_offerings.py
test_02_edit_service_offeringSuccess0.05test_service_offerings.py
test_01_create_service_offeringSuccess0.11test_service_offerings.py
test_02_sys_template_readySuccess0.15test_secondary_storage.py
test_01_sys_vm_startSuccess0.18test_secondary_storage.py
test_09_reboot_routerSuccess35.32test_routers.py
test_08_start_routerSuccess30.30test_routers.py
test_07_stop_routerSuccess10.18test_routers.py
test_06_router_advancedSuccess0.06test_routers.py
test_05_router_basicSuccess0.05test_routers.py
test_04_restart_network_wo_cleanupSuccess5.75test_routers.py
test_03_restart_network_cleanupSuccess60.52test_routers.py
test_02_router_internal_advSuccess1.05test_routers.py
test_01_router_internal_basicSuccess0.58test_routers.py
test_router_dns_guestipquerySuccess76.77test_router_dns.py
test_router_dns_externalipquerySuccess0.08test_router_dns.py
test_router_dhcphostsSuccess277.54test_router_dhcphosts.py
test_router_dhcp_optsSuccess21.97test_router_dhcphosts.py
test_01_updatevolumedetailSuccess0.11test_resource_detail.py
test_01_reset_vm_on_rebootSuccess146.46test_reset_vm_on_reboot.py
test_createRegionSuccess0.04test_regions.py
test_create_pvlan_networkSuccess5.21test_pvlan.py
test_dedicatePublicIpRangeSuccess0.42test_public_ip_range.py
test_03_vpc_privategw_restart_vpc_cleanupSuccess490.46test_privategw_acl.py
test_02_vpc_privategw_static_routesSuccess381.00test_privategw_acl.py
test_01_vpc_privategw_aclSuccess92.29test_privategw_acl.py
test_01_primary_storage_nfsSuccess35.83test_primary_storage.py
test_createPortablePublicIPRangeSuccess15.19test_portable_publicip.py
test_createPortablePublicIPAcquireSuccess15.45test_portable_publicip.py
test_isolate_network_password_serverSuccess89.50test_password_server.py
test_UpdateStorageOverProvisioningFactorSuccess0.25test_over_provisioning.py
test_oobm_zchange_passwordSuccess31.02test_outofbandmanagement.py
test_oobm_multiple_mgmt_server_ownershipSuccess16.40test_outofbandmanagement.py
test_oobm_issue_power_statusSuccess10.44test_outofbandmanagement.py
test_oobm_issue_power_softSuccess15.37test_outofbandmanagement.py
test_oobm_issue_power_resetSuccess15.37test_outofbandmanagement.py
test_oobm_issue_power_onSuccess15.64test_outofbandmanagement.py
test_oobm_issue_power_offSuccess15.35test_outofbandmanagement.py
test_oobm_issue_power_cycleSuccess15.38test_outofbandmanagement.py
test_oobm_enabledisable_across_clusterzonesSuccess82.68test_outofbandmanagement.py
test_oobm_enable_feature_validSuccess5.37test_outofbandmanagement.py
test_oobm_enable_feature_invalidSuccess0.16test_outofbandmanagement.py
test_oobm_disable_feature_validSuccess5.28test_outofbandmanagement.py
test_oobm_disable_feature_invalidSuccess0.12test_outofbandmanagement.py
test_oobm_configure_invalid_driverSuccess0.08test_outofbandmanagement.py
test_oobm_configure_default_driverSuccess0.09test_outofbandmanagement.py
test_oobm_background_powerstate_syncSuccess23.49test_outofbandmanagement.py
test_extendPhysicalNetworkVlanSuccess15.32test_non_contigiousvlan.py
test_01_nicSuccess424.25test_nic.py
test_releaseIPSuccess247.97test_network.py
test_reboot_routerSuccess403.64test_network.py
test_public_ip_user_accountSuccess10.25test_network.py
test_public_ip_admin_accountSuccess40.39test_network.py
test_network_rules_acquired_public_ip_3_Load_Balancer_RuleSuccess67.20test_network.py
test_network_rules_acquired_public_ip_2_nat_ruleSuccess61.73test_network.py
test_network_rules_acquired_public_ip_1_static_nat_ruleSuccess124.35test_network.py
test_delete_accountSuccess303.00test_network.py
test_02_port_fwd_on_non_src_natSuccess55.69test_network.py
test_01_port_fwd_on_src_natSuccess111.89test_network.py
test_nic_secondaryip_add_removeSuccess207.68test_multipleips_per_nic.py
login_test_saml_userSuccess19.33test_login.py
test_assign_and_removal_lbSuccess133.51test_loadbalance.py
test_02_create_lb_rule_non_natSuccess187.42test_loadbalance.py
test_01_create_lb_rule_src_natSuccess217.85test_loadbalance.py
test_03_list_snapshotsSuccess0.09test_list_ids_parameter.py
test_02_list_templatesSuccess0.04test_list_ids_parameter.py
test_01_list_volumesSuccess0.03test_list_ids_parameter.py
test_07_list_default_isoSuccess0.06test_iso.py
test_05_iso_permissionsSuccess0.06test_iso.py
test_04_extract_IsoSuccess5.13test_iso.py
test_03_delete_isoSuccess95.13test_iso.py
test_02_edit_isoSuccess0.06test_iso.py
test_01_create_isoSuccess21.05test_iso.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfacesSuccess193.99test_internal_lb.py
test_03_vpc_internallb_haproxy_stats_on_all_interfacesSuccess152.68test_internal_lb.py
test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80Success507.43test_internal_lb.py
test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80Success440.64test_internal_lb.py
test_dedicateGuestVlanRangeSuccess10.28test_guest_vlan_range.py
test_UpdateConfigParamWithScopeSuccess0.14test_global_settings.py
test_rolepermission_lifecycle_updateSuccess6.18test_dynamicroles.py
test_rolepermission_lifecycle_listSuccess6.01test_dynamicroles.py
test_rolepermission_lifecycle_deleteSuccess6.09test_dynamicroles.py
test_rolepermission_lifecycle_createSuccess5.90test_dynamicroles.py
test_rolepermission_lifecycle_concurrent_updatesSuccess6.01test_dynamicroles.py
test_role_lifecycle_update_role_inuseSuccess5.92test_dynamicroles.py
test_role_lifecycle_updateSuccess11.02test_dynamicroles.py
test_role_lifecycle_listSuccess5.99test_dynamicroles.py
test_role_lifecycle_deleteSuccess10.96test_dynamicroles.py
test_role_lifecycle_createSuccess5.93test_dynamicroles.py
test_role_inuse_deletionSuccess5.89test_dynamicroles.py
test_role_account_acls_multiple_mgmt_serversSuccess8.12test_dynamicroles.py
test_role_account_aclsSuccess8.24test_dynamicroles.py
test_default_role_deletionSuccess6.04test_dynamicroles.py
test_04_create_fat_type_disk_offeringSuccess0.10test_disk_offerings.py
test_03_delete_disk_offeringSuccess0.26test_disk_offerings.py
test_02_edit_disk_offeringSuccess0.06test_disk_offerings.py
test_02_create_sparse_type_disk_offeringSuccess0.07test_disk_offerings.py
test_01_create_disk_offeringSuccess0.11test_disk_offerings.py
test_deployvm_userdispersingSuccess20.66test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userconcentratedSuccess20.61test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_firstfitSuccess65.74test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userdata_postSuccess10.37test_deploy_vm_with_userdata.py
test_deployvm_userdataSuccess70.80test_deploy_vm_with_userdata.py
test_02_deploy_vm_root_resizeSuccess6.02test_deploy_vm_root_resize.py
test_01_deploy_vm_root_resizeSuccess6.04test_deploy_vm_root_resize.py
test_00_deploy_vm_root_resizeSuccess227.70test_deploy_vm_root_resize.py
test_deploy_vm_from_isoSuccess207.53test_deploy_vm_iso.py
test_DeployVmAntiAffinityGroupSuccess60.99test_affinity_groups.py
test_change_service_offering_for_vm_with_snapshotsSkipped0.00test_vm_snapshots.py
test_01_test_vm_volume_snapshotSkipped0.00test_vm_snapshots.py
test_06_copy_templateSkipped0.00test_templates.py
test_static_role_account_aclsSkipped0.02test_staticroles.py
test_11_ss_nfs_version_on_ssvmSkipped0.02test_ssvm.py
test_01_scale_vmSkipped0.00test_scale_vm.py
test_01_primary_storage_iscsiSkipped0.05test_primary_storage.py
test_nested_virtualization_vmwareSkipped0.00test_nested_virtualization.py
test_06_copy_isoSkipped0.00test_iso.py
test_deploy_vgpu_enabled_vmSkipped0.03test_deploy_vgpu_enabled_vm.py
test_3d_gpu_supportSkipped0.04test_deploy_vgpu_enabled_vm.py

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-875)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 27492 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1773-t875-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py
Test completed. 47 look ok, 2 have error(s)

TestResultTime (s)Test File
test_04_rvpc_privategw_static_routesFailure325.34test_privategw_acl.py
test_02_list_snapshots_with_removed_data_storeError0.04test_snapshots.py
test_01_vpc_site2site_vpnSuccess149.78test_vpc_vpn.py
test_01_vpc_remote_access_vpnSuccess66.19test_vpc_vpn.py
test_01_redundant_vpc_site2site_vpnSuccess226.19test_vpc_vpn.py
test_02_VPC_default_routesSuccess259.80test_vpc_router_nics.py
test_01_VPC_nics_after_destroySuccess518.66test_vpc_router_nics.py
test_05_rvpc_multi_tiersSuccess510.72test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nicsSuccess1302.14test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routersSuccess533.12test_vpc_redundant.py
test_02_redundant_VPC_default_routesSuccess754.46test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACLSuccess1284.66test_vpc_redundant.py
test_09_delete_detached_volumeSuccess151.34test_volumes.py
test_08_resize_volumeSuccess156.35test_volumes.py
test_07_resize_failSuccess156.41test_volumes.py
test_06_download_detached_volumeSuccess156.27test_volumes.py
test_05_detach_volumeSuccess155.83test_volumes.py
test_04_delete_attached_volumeSuccess146.14test_volumes.py
test_03_download_attached_volumeSuccess156.23test_volumes.py
test_02_attach_volumeSuccess124.17test_volumes.py
test_01_create_volumeSuccess711.19test_volumes.py
test_03_delete_vm_snapshotsSuccess275.21test_vm_snapshots.py
test_02_revert_vm_snapshotsSuccess95.72test_vm_snapshots.py
test_01_create_vm_snapshotsSuccess163.70test_vm_snapshots.py
test_deploy_vm_multipleSuccess272.73test_vm_life_cycle.py
test_deploy_vmSuccess0.03test_vm_life_cycle.py
test_advZoneVirtualRouterSuccess0.02test_vm_life_cycle.py
test_10_attachAndDetach_isoSuccess26.62test_vm_life_cycle.py
test_09_expunge_vmSuccess125.31test_vm_life_cycle.py
test_08_migrate_vmSuccess35.84test_vm_life_cycle.py
test_07_restore_vmSuccess0.14test_vm_life_cycle.py
test_06_destroy_vmSuccess125.82test_vm_life_cycle.py
test_03_reboot_vmSuccess125.85test_vm_life_cycle.py
test_02_start_vmSuccess10.16test_vm_life_cycle.py
test_01_stop_vmSuccess40.29test_vm_life_cycle.py
test_CreateTemplateWithDuplicateNameSuccess35.39test_templates.py
test_08_list_system_templatesSuccess0.03test_templates.py
test_07_list_public_templatesSuccess0.04test_templates.py
test_05_template_permissionsSuccess0.06test_templates.py
test_04_extract_templateSuccess5.14test_templates.py
test_03_delete_templateSuccess5.10test_templates.py
test_02_edit_templateSuccess90.18test_templates.py
test_01_create_templateSuccess35.38test_templates.py
test_10_destroy_cpvmSuccess136.43test_ssvm.py
test_09_destroy_ssvmSuccess163.10test_ssvm.py
test_08_reboot_cpvmSuccess101.51test_ssvm.py
test_07_reboot_ssvmSuccess133.59test_ssvm.py
test_06_stop_cpvmSuccess131.69test_ssvm.py
test_05_stop_ssvmSuccess133.64test_ssvm.py
test_04_cpvm_internalsSuccess1.39test_ssvm.py
test_03_ssvm_internalsSuccess3.76test_ssvm.py
test_02_list_cpvm_vmSuccess0.12test_ssvm.py
test_01_list_sec_storage_vmSuccess0.12test_ssvm.py
test_01_snapshot_root_diskSuccess11.11test_snapshots.py
test_04_change_offering_smallSuccess239.57test_service_offerings.py
test_03_delete_service_offeringSuccess0.04test_service_offerings.py
test_02_edit_service_offeringSuccess0.05test_service_offerings.py
test_01_create_service_offeringSuccess0.10test_service_offerings.py
test_02_sys_template_readySuccess0.12test_secondary_storage.py
test_01_sys_vm_startSuccess0.17test_secondary_storage.py
test_09_reboot_routerSuccess35.31test_routers.py
test_08_start_routerSuccess25.26test_routers.py
test_07_stop_routerSuccess10.16test_routers.py
test_06_router_advancedSuccess0.06test_routers.py
test_05_router_basicSuccess0.04test_routers.py
test_04_restart_network_wo_cleanupSuccess5.62test_routers.py
test_03_restart_network_cleanupSuccess50.43test_routers.py
test_02_router_internal_advSuccess0.83test_routers.py
test_01_router_internal_basicSuccess0.48test_routers.py
test_router_dns_guestipquerySuccess74.63test_router_dns.py
test_router_dns_externalipquerySuccess0.08test_router_dns.py
test_router_dhcphostsSuccess292.27test_router_dhcphosts.py
test_router_dhcp_optsSuccess21.48test_router_dhcphosts.py
test_01_updatevolumedetailSuccess0.07test_resource_detail.py
test_01_reset_vm_on_rebootSuccess130.88test_reset_vm_on_reboot.py
test_createRegionSuccess0.04test_regions.py
test_create_pvlan_networkSuccess5.21test_pvlan.py
test_dedicatePublicIpRangeSuccess1.02test_public_ip_range.py
test_03_vpc_privategw_restart_vpc_cleanupSuccess485.09test_privategw_acl.py
test_02_vpc_privategw_static_routesSuccess360.16test_privategw_acl.py
test_01_vpc_privategw_aclSuccess92.19test_privategw_acl.py
test_01_primary_storage_nfsSuccess35.74test_primary_storage.py
test_createPortablePublicIPRangeSuccess15.19test_portable_publicip.py
test_createPortablePublicIPAcquireSuccess15.42test_portable_publicip.py
test_isolate_network_password_serverSuccess59.09test_password_server.py
test_UpdateStorageOverProvisioningFactorSuccess0.12test_over_provisioning.py
test_oobm_zchange_passwordSuccess30.61test_outofbandmanagement.py
test_oobm_multiple_mgmt_server_ownershipSuccess16.32test_outofbandmanagement.py
test_oobm_issue_power_statusSuccess10.23test_outofbandmanagement.py
test_oobm_issue_power_softSuccess15.33test_outofbandmanagement.py
test_oobm_issue_power_resetSuccess15.34test_outofbandmanagement.py
test_oobm_issue_power_onSuccess15.35test_outofbandmanagement.py
test_oobm_issue_power_offSuccess10.31test_outofbandmanagement.py
test_oobm_issue_power_cycleSuccess15.32test_outofbandmanagement.py
test_oobm_enabledisable_across_clusterzonesSuccess87.68test_outofbandmanagement.py
test_oobm_enable_feature_validSuccess5.15test_outofbandmanagement.py
test_oobm_enable_feature_invalidSuccess0.08test_outofbandmanagement.py
test_oobm_disable_feature_validSuccess5.17test_outofbandmanagement.py
test_oobm_disable_feature_invalidSuccess0.09test_outofbandmanagement.py
test_oobm_configure_invalid_driverSuccess0.08test_outofbandmanagement.py
test_oobm_configure_default_driverSuccess0.07test_outofbandmanagement.py
test_oobm_background_powerstate_syncSuccess23.43test_outofbandmanagement.py
test_extendPhysicalNetworkVlanSuccess15.30test_non_contigiousvlan.py
test_01_nicSuccess409.21test_nic.py
test_releaseIPSuccess253.50test_network.py
test_reboot_routerSuccess413.87test_network.py
test_public_ip_user_accountSuccess10.26test_network.py
test_public_ip_admin_accountSuccess40.27test_network.py
test_network_rules_acquired_public_ip_3_Load_Balancer_RuleSuccess66.67test_network.py
test_network_rules_acquired_public_ip_2_nat_ruleSuccess61.46test_network.py
test_network_rules_acquired_public_ip_1_static_nat_ruleSuccess120.61test_network.py
test_delete_accountSuccess288.66test_network.py
test_02_port_fwd_on_non_src_natSuccess55.60test_network.py
test_01_port_fwd_on_src_natSuccess111.90test_network.py
test_nic_secondaryip_add_removeSuccess218.16test_multipleips_per_nic.py
login_test_saml_userSuccess19.48test_login.py
test_assign_and_removal_lbSuccess133.09test_loadbalance.py
test_02_create_lb_rule_non_natSuccess187.08test_loadbalance.py
test_01_create_lb_rule_src_natSuccess207.68test_loadbalance.py
test_03_list_snapshotsSuccess0.06test_list_ids_parameter.py
test_02_list_templatesSuccess0.04test_list_ids_parameter.py
test_01_list_volumesSuccess0.03test_list_ids_parameter.py
test_07_list_default_isoSuccess0.06test_iso.py
test_05_iso_permissionsSuccess0.07test_iso.py
test_04_extract_IsoSuccess5.23test_iso.py
test_03_delete_isoSuccess95.15test_iso.py
test_02_edit_isoSuccess0.07test_iso.py
test_01_create_isoSuccess21.02test_iso.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfacesSuccess197.91test_internal_lb.py
test_03_vpc_internallb_haproxy_stats_on_all_interfacesSuccess132.66test_internal_lb.py
test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80Success521.59test_internal_lb.py
test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80Success417.73test_internal_lb.py
test_dedicateGuestVlanRangeSuccess10.27test_guest_vlan_range.py
test_UpdateConfigParamWithScopeSuccess0.13test_global_settings.py
test_rolepermission_lifecycle_updateSuccess6.13test_dynamicroles.py
test_rolepermission_lifecycle_listSuccess5.97test_dynamicroles.py
test_rolepermission_lifecycle_deleteSuccess6.13test_dynamicroles.py
test_rolepermission_lifecycle_createSuccess5.87test_dynamicroles.py
test_rolepermission_lifecycle_concurrent_updatesSuccess5.97test_dynamicroles.py
test_role_lifecycle_update_role_inuseSuccess5.87test_dynamicroles.py
test_role_lifecycle_updateSuccess10.96test_dynamicroles.py
test_role_lifecycle_listSuccess5.88test_dynamicroles.py
test_role_lifecycle_deleteSuccess10.90test_dynamicroles.py
test_role_lifecycle_createSuccess5.89test_dynamicroles.py
test_role_inuse_deletionSuccess5.89test_dynamicroles.py
test_role_account_acls_multiple_mgmt_serversSuccess8.34test_dynamicroles.py
test_role_account_aclsSuccess8.21test_dynamicroles.py
test_default_role_deletionSuccess5.95test_dynamicroles.py
test_04_create_fat_type_disk_offeringSuccess0.06test_disk_offerings.py
test_03_delete_disk_offeringSuccess0.04test_disk_offerings.py
test_02_edit_disk_offeringSuccess0.05test_disk_offerings.py
test_02_create_sparse_type_disk_offeringSuccess0.06test_disk_offerings.py
test_01_create_disk_offeringSuccess0.10test_disk_offerings.py
test_deployvm_userdispersingSuccess20.58test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userconcentratedSuccess15.59test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_firstfitSuccess60.68test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userdata_postSuccess10.54test_deploy_vm_with_userdata.py
test_deployvm_userdataSuccess50.73test_deploy_vm_with_userdata.py
test_02_deploy_vm_root_resizeSuccess6.03test_deploy_vm_root_resize.py
test_01_deploy_vm_root_resizeSuccess5.94test_deploy_vm_root_resize.py
test_00_deploy_vm_root_resizeSuccess212.66test_deploy_vm_root_resize.py
test_deploy_vm_from_isoSuccess202.41test_deploy_vm_iso.py
test_DeployVmAntiAffinityGroupSuccess50.85test_affinity_groups.py
test_change_service_offering_for_vm_with_snapshotsSkipped0.00test_vm_snapshots.py
test_01_test_vm_volume_snapshotSkipped0.00test_vm_snapshots.py
test_06_copy_templateSkipped0.00test_templates.py
test_static_role_account_aclsSkipped0.02test_staticroles.py
test_11_ss_nfs_version_on_ssvmSkipped0.02test_ssvm.py
test_01_scale_vmSkipped0.00test_scale_vm.py
test_01_primary_storage_iscsiSkipped0.03test_primary_storage.py
test_nested_virtualization_vmwareSkipped0.00test_nested_virtualization.py
test_06_copy_isoSkipped0.00test_iso.py
test_deploy_vgpu_enabled_vmSkipped0.03test_deploy_vgpu_enabled_vm.py
test_3d_gpu_supportSkipped0.03test_deploy_vgpu_enabled_vm.py

@serg38

Copy link
Copy Markdown

@jburwell That was default behavior for few years to allow deletion of the template even if active VMs exist. Deletion of the template on secondary doesn't remove the template copy on primary storage so all existing VM function work just fine.
From my prospective if we allow forced deletion from the UI I am fine with switching default to forced=no and documenting it in Release Notes.

@koushik-das

Copy link
Copy Markdown
Contributor

I think changing the default API behaviour for fixing a bug should be ok as long as documented properly. Also in this case the deletion criteria is made more strict, so there is no unwanted data loss.

@priyankparihar

Copy link
Copy Markdown
ContributorAuthor

Hi @serg38@ustcweizhou@koushik-das@jburwell@borisstoyanov ,
Thanks for valuable insight. Code is modified according to your suggestion. :)

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@serg38

Copy link
Copy Markdown

Thanks @priyankparihar . We verified in our environment that all is working fine including UI part.
LGTM
I think this one is
tag:mergeready

@borisstoyanovborisstoyanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM based on test results and code review

@ustcweizhou

Copy link
Copy Markdown
Contributor

LGTM

@priyankparihar

Copy link
Copy Markdown
ContributorAuthor

@karuturi This seems to be ready for merge (tag:mergeready).
It has 3 LGTMs and tests are passed.

@SudharmaJain

Copy link
Copy Markdown
Contributor

@priyankparihar This PR will break the reset VM feature. I think we should also prevent reset vm if the template is deleted.

@priyankparihar

Copy link
Copy Markdown
ContributorAuthor

Hi @SudharmaJain,

This PR will break the reset VM feature. I think we should also prevent reset vm if the template is deleted.

'Force' option is introduced to solve above mentioned problem.

@yadvr

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖centos6 ✖centos7 ✖debian. JID-1292

@yadvryadvr added this to the 4.11 milestone Dec 10, 2017
@yadvr

Copy link
Copy Markdown
Member

@priyankparihar fix conflicts please.

@yadvr

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1498

@yadvr

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1514

@yadvr

yadvr commented Jan 2, 2018

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1540

@yadvr

yadvr commented Jan 3, 2018

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1983)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37390 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1773-t1983-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_deploy_virtio_scsi_vm.py
Smoke tests completed. 66 look OK, 0 have error(s)
Only failed tests results shown below:

TestResultTime (s)Test File

@yadvr

yadvr commented Jan 4, 2018

Copy link
Copy Markdown
Member

Merging this based on code review lgtms and test results.

@yadvr
yadvr merged commit 25b63f5 into apache:masterJan 4, 2018
lucas-a-martins pushed a commit to scclouds/cloudstack that referenced this pull request Jan 29, 2024
Habilitação da funcionalidade de _over-provisioning_ para _primary storages_ do tipo `SharedMountPoint`
Closesapache#1773
See merge request scclouds/scclouds!716
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@priyankparihar@ustcweizhou@serg38@borisstoyanov@blueorangutan@jburwell@koushik-das@SudharmaJain@yadvr