Skip to content

Conversation

@nvazquez
Copy link
Contributor

@nvazquez nvazquez commented Mar 8, 2017

Issue description: https://issues.apache.org/jira/browse/CLOUDSTACK-9827

Fixes

  • Create Primary Storage: Persist tags into storage_pool_tags instead of storage_pool_details
  • List Storage Tags: Queries storage_pool_tags table instead of storage_tag_view
  • Find Storage Pools by Tags using proper DAO
  • Remove storage tags after deleting Primary Storage
  • Remove unused StorageTagDao, StorageTagDaoImpl, StorageTagVO and storage_tag_view

@serg38
Copy link

serg38 commented Mar 8, 2017

@mike-tutkowski @karuturi @koushik-das @rafaelweingartner Please review the fix for 4.10 blocker

@serg38
Copy link

serg38 commented Mar 8, 2017

@nvazquez Should we simply replace storage_tag_view instead of switching queries over to another view?

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-940)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 28984 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1994-t940-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)

Test Result Time (s) Test File
test_04_rvpc_privategw_static_routes Failure 366.22 test_privategw_acl.py
test_02_list_snapshots_with_removed_data_store Error 0.04 test_snapshots.py
test_01_vpc_site2site_vpn Success 161.27 test_vpc_vpn.py
test_01_vpc_remote_access_vpn Success 71.26 test_vpc_vpn.py
test_01_redundant_vpc_site2site_vpn Success 266.14 test_vpc_vpn.py
test_02_VPC_default_routes Success 272.29 test_vpc_router_nics.py
test_01_VPC_nics_after_destroy Success 573.38 test_vpc_router_nics.py
test_05_rvpc_multi_tiers Success 524.87 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Success 1296.05 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Success 558.76 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Success 761.27 test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Success 1310.90 test_vpc_redundant.py
test_09_delete_detached_volume Success 156.60 test_volumes.py
test_08_resize_volume Success 156.91 test_volumes.py
test_07_resize_fail Success 161.50 test_volumes.py
test_06_download_detached_volume Success 156.34 test_volumes.py
test_05_detach_volume Success 155.76 test_volumes.py
test_04_delete_attached_volume Success 151.23 test_volumes.py
test_03_download_attached_volume Success 156.46 test_volumes.py
test_02_attach_volume Success 124.66 test_volumes.py
test_01_create_volume Success 713.58 test_volumes.py
test_03_delete_vm_snapshots Success 275.17 test_vm_snapshots.py
test_02_revert_vm_snapshots Success 95.75 test_vm_snapshots.py
test_01_create_vm_snapshots Success 163.78 test_vm_snapshots.py
test_deploy_vm_multiple Success 272.95 test_vm_life_cycle.py
test_deploy_vm Success 0.03 test_vm_life_cycle.py
test_advZoneVirtualRouter Success 0.03 test_vm_life_cycle.py
test_10_attachAndDetach_iso Success 26.88 test_vm_life_cycle.py
test_09_expunge_vm Success 125.25 test_vm_life_cycle.py
test_08_migrate_vm Success 30.90 test_vm_life_cycle.py
test_07_restore_vm Success 0.13 test_vm_life_cycle.py
test_06_destroy_vm Success 130.98 test_vm_life_cycle.py
test_03_reboot_vm Success 125.88 test_vm_life_cycle.py
test_02_start_vm Success 10.17 test_vm_life_cycle.py
test_01_stop_vm Success 40.33 test_vm_life_cycle.py
test_CreateTemplateWithDuplicateName Success 50.75 test_templates.py
test_08_list_system_templates Success 0.03 test_templates.py
test_07_list_public_templates Success 0.04 test_templates.py
test_05_template_permissions Success 0.06 test_templates.py
test_04_extract_template Success 5.13 test_templates.py
test_03_delete_template Success 5.11 test_templates.py
test_02_edit_template Success 90.21 test_templates.py
test_01_create_template Success 40.46 test_templates.py
test_10_destroy_cpvm Success 166.67 test_ssvm.py
test_09_destroy_ssvm Success 164.14 test_ssvm.py
test_08_reboot_cpvm Success 131.56 test_ssvm.py
test_07_reboot_ssvm Success 133.64 test_ssvm.py
test_06_stop_cpvm Success 131.75 test_ssvm.py
test_05_stop_ssvm Success 133.76 test_ssvm.py
test_04_cpvm_internals Success 1.22 test_ssvm.py
test_03_ssvm_internals Success 3.37 test_ssvm.py
test_02_list_cpvm_vm Success 0.13 test_ssvm.py
test_01_list_sec_storage_vm Success 0.17 test_ssvm.py
test_01_snapshot_root_disk Success 11.11 test_snapshots.py
test_04_change_offering_small Success 240.71 test_service_offerings.py
test_03_delete_service_offering Success 0.04 test_service_offerings.py
test_02_edit_service_offering Success 0.05 test_service_offerings.py
test_01_create_service_offering Success 0.11 test_service_offerings.py
test_02_sys_template_ready Success 0.13 test_secondary_storage.py
test_01_sys_vm_start Success 0.20 test_secondary_storage.py
test_09_reboot_router Success 35.32 test_routers.py
test_08_start_router Success 30.32 test_routers.py
test_07_stop_router Success 10.16 test_routers.py
test_06_router_advanced Success 0.06 test_routers.py
test_05_router_basic Success 0.04 test_routers.py
test_04_restart_network_wo_cleanup Success 5.70 test_routers.py
test_03_restart_network_cleanup Success 55.51 test_routers.py
test_02_router_internal_adv Success 1.04 test_routers.py
test_01_router_internal_basic Success 0.56 test_routers.py
test_router_dns_guestipquery Success 76.84 test_router_dns.py
test_router_dns_externalipquery Success 0.07 test_router_dns.py
test_router_dhcphosts Success 277.56 test_router_dhcphosts.py
test_router_dhcp_opts Success 21.76 test_router_dhcphosts.py
test_01_updatevolumedetail Success 0.08 test_resource_detail.py
test_01_reset_vm_on_reboot Success 151.35 test_reset_vm_on_reboot.py
test_createRegion Success 0.04 test_regions.py
test_create_pvlan_network Success 5.22 test_pvlan.py
test_dedicatePublicIpRange Success 0.45 test_public_ip_range.py
test_03_vpc_privategw_restart_vpc_cleanup Success 515.64 test_privategw_acl.py
test_02_vpc_privategw_static_routes Success 350.69 test_privategw_acl.py
test_01_vpc_privategw_acl Success 92.58 test_privategw_acl.py
test_01_primary_storage_nfs Success 35.81 test_primary_storage.py
test_createPortablePublicIPRange Success 15.19 test_portable_publicip.py
test_createPortablePublicIPAcquire Success 15.44 test_portable_publicip.py
test_isolate_network_password_server Success 89.64 test_password_server.py
test_UpdateStorageOverProvisioningFactor Success 0.14 test_over_provisioning.py
test_oobm_zchange_password Success 30.64 test_outofbandmanagement.py
test_oobm_multiple_mgmt_server_ownership Success 16.34 test_outofbandmanagement.py
test_oobm_issue_power_status Success 10.24 test_outofbandmanagement.py
test_oobm_issue_power_soft Success 15.31 test_outofbandmanagement.py
test_oobm_issue_power_reset Success 10.30 test_outofbandmanagement.py
test_oobm_issue_power_on Success 15.34 test_outofbandmanagement.py
test_oobm_issue_power_off Success 15.35 test_outofbandmanagement.py
test_oobm_issue_power_cycle Success 15.38 test_outofbandmanagement.py
test_oobm_enabledisable_across_clusterzones Success 92.65 test_outofbandmanagement.py
test_oobm_enable_feature_valid Success 5.16 test_outofbandmanagement.py
test_oobm_enable_feature_invalid Success 0.10 test_outofbandmanagement.py
test_oobm_disable_feature_valid Success 5.18 test_outofbandmanagement.py
test_oobm_disable_feature_invalid Success 0.10 test_outofbandmanagement.py
test_oobm_configure_invalid_driver Success 0.08 test_outofbandmanagement.py
test_oobm_configure_default_driver Success 0.08 test_outofbandmanagement.py
test_oobm_background_powerstate_sync Success 23.42 test_outofbandmanagement.py
test_extendPhysicalNetworkVlan Success 15.31 test_non_contigiousvlan.py
test_01_nic Success 439.52 test_nic.py
test_releaseIP Success 278.19 test_network.py
test_reboot_router Success 408.54 test_network.py
test_public_ip_user_account Success 10.26 test_network.py
test_public_ip_admin_account Success 40.28 test_network.py
test_network_rules_acquired_public_ip_3_Load_Balancer_Rule Success 66.96 test_network.py
test_network_rules_acquired_public_ip_2_nat_rule Success 61.76 test_network.py
test_network_rules_acquired_public_ip_1_static_nat_rule Success 123.89 test_network.py
test_delete_account Success 272.80 test_network.py
test_02_port_fwd_on_non_src_nat Success 55.66 test_network.py
test_01_port_fwd_on_src_nat Success 112.21 test_network.py
test_nic_secondaryip_add_remove Success 202.54 test_multipleips_per_nic.py
login_test_saml_user Success 19.28 test_login.py
test_assign_and_removal_lb Success 133.66 test_loadbalance.py
test_02_create_lb_rule_non_nat Success 187.32 test_loadbalance.py
test_01_create_lb_rule_src_nat Success 218.55 test_loadbalance.py
test_03_list_snapshots Success 0.08 test_list_ids_parameter.py
test_02_list_templates Success 0.04 test_list_ids_parameter.py
test_01_list_volumes Success 0.03 test_list_ids_parameter.py
test_07_list_default_iso Success 0.06 test_iso.py
test_05_iso_permissions Success 0.06 test_iso.py
test_04_extract_Iso Success 5.17 test_iso.py
test_03_delete_iso Success 95.17 test_iso.py
test_02_edit_iso Success 0.06 test_iso.py
test_01_create_iso Success 21.02 test_iso.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfaces Success 214.50 test_internal_lb.py
test_03_vpc_internallb_haproxy_stats_on_all_interfaces Success 153.01 test_internal_lb.py
test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 Success 501.17 test_internal_lb.py
test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 Success 431.06 test_internal_lb.py
test_dedicateGuestVlanRange Success 10.41 test_guest_vlan_range.py
test_UpdateConfigParamWithScope Success 0.15 test_global_settings.py
test_rolepermission_lifecycle_update Success 6.34 test_dynamicroles.py
test_rolepermission_lifecycle_list Success 6.01 test_dynamicroles.py
test_rolepermission_lifecycle_delete Success 5.85 test_dynamicroles.py
test_rolepermission_lifecycle_create Success 5.87 test_dynamicroles.py
test_rolepermission_lifecycle_concurrent_updates Success 6.00 test_dynamicroles.py
test_role_lifecycle_update_role_inuse Success 5.92 test_dynamicroles.py
test_role_lifecycle_update Success 10.98 test_dynamicroles.py
test_role_lifecycle_list Success 5.90 test_dynamicroles.py
test_role_lifecycle_delete Success 11.50 test_dynamicroles.py
test_role_lifecycle_create Success 6.21 test_dynamicroles.py
test_role_inuse_deletion Success 5.90 test_dynamicroles.py
test_role_account_acls_multiple_mgmt_servers Success 8.06 test_dynamicroles.py
test_role_account_acls Success 8.57 test_dynamicroles.py
test_default_role_deletion Success 5.97 test_dynamicroles.py
test_04_create_fat_type_disk_offering Success 0.07 test_disk_offerings.py
test_03_delete_disk_offering Success 0.04 test_disk_offerings.py
test_02_edit_disk_offering Success 0.05 test_disk_offerings.py
test_02_create_sparse_type_disk_offering Success 0.07 test_disk_offerings.py
test_01_create_disk_offering Success 0.11 test_disk_offerings.py
test_deployvm_userdispersing Success 55.83 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userconcentrated Success 20.71 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_firstfit Success 60.72 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userdata_post Success 10.38 test_deploy_vm_with_userdata.py
test_deployvm_userdata Success 50.69 test_deploy_vm_with_userdata.py
test_02_deploy_vm_root_resize Success 5.97 test_deploy_vm_root_resize.py
test_01_deploy_vm_root_resize Success 5.98 test_deploy_vm_root_resize.py
test_00_deploy_vm_root_resize Success 207.44 test_deploy_vm_root_resize.py
test_deploy_vm_from_iso Success 212.50 test_deploy_vm_iso.py
test_DeployVmAntiAffinityGroup Success 70.95 test_affinity_groups.py
test_change_service_offering_for_vm_with_snapshots Skipped 0.00 test_vm_snapshots.py
test_01_test_vm_volume_snapshot Skipped 0.00 test_vm_snapshots.py
test_06_copy_template Skipped 0.00 test_templates.py
test_static_role_account_acls Skipped 0.02 test_staticroles.py
test_11_ss_nfs_version_on_ssvm Skipped 0.02 test_ssvm.py
test_01_scale_vm Skipped 0.00 test_scale_vm.py
test_01_primary_storage_iscsi Skipped 0.04 test_primary_storage.py
test_nested_virtualization_vmware Skipped 0.00 test_nested_virtualization.py
test_06_copy_iso Skipped 0.00 test_iso.py
test_deploy_vgpu_enabled_vm Skipped 0.03 test_deploy_vgpu_enabled_vm.py
test_3d_gpu_support Skipped 0.04 test_deploy_vgpu_enabled_vm.py

@rafaelweingartner
Copy link
Member

@nvazquez I am assuming the change needed to fix the bug is line 135 at PrimaryDataStoreHelper.java?
The other changes are regarding code conformity

@nvazquez
Copy link
Contributor Author

Hi @rafaelweingartner, you're right, it was basically that fix.
I've pushed another commit due to issue reported by @mike-tutkowski in mailing list:

I have an NFS SR as primary storage under CloudStack with a storage tag of NFS-A. I have a compute offering with a matching storage tag. I can’t seem to get a VM to spin up, however: It says insufficient capacity. The CPU, MHz, and memory are all low (and what I typically use), so I think the problem is with matching the storage tag.

@serg38
Copy link

serg38 commented Mar 10, 2017

@nvazquez Is storage_tag_view still in use after this change that reference old way of retrieving the tags? If not should we remove it? E.g. host tags don't have a separate view.

@nvazquez
Copy link
Contributor Author

nvazquez commented Mar 10, 2017

@serg38 actually is not being used anymore, I'll add removal of the view on last commit

@nvazquez nvazquez force-pushed the CLOUDSTACK-9827 branch 2 times, most recently from bd1ba78 to e618253 Compare March 10, 2017 01:35
@nvazquez
Copy link
Contributor Author

nvazquez commented Mar 10, 2017

Added these items to description:

  • Find Storage Pools by Tags using proper DAO
  • Remove storage tags after deleting Primary Storage
  • Remove unused StorageTagDao, StorageTagDaoImpl, StorageTagVO and storage_tag_view

@serg38
Copy link

serg38 commented Mar 10, 2017

@rhtyd @borisstoyanov Can you kick off new tests for this release blocker?

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-946)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 28653 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr1994-t946-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)

Test Result Time (s) Test File
test_04_rvpc_privategw_static_routes Failure 350.78 test_privategw_acl.py
test_02_list_snapshots_with_removed_data_store Error 0.04 test_snapshots.py
test_01_vpc_site2site_vpn Success 155.07 test_vpc_vpn.py
test_01_vpc_remote_access_vpn Success 61.14 test_vpc_vpn.py
test_01_redundant_vpc_site2site_vpn Success 251.03 test_vpc_vpn.py
test_02_VPC_default_routes Success 290.08 test_vpc_router_nics.py
test_01_VPC_nics_after_destroy Success 525.27 test_vpc_router_nics.py
test_05_rvpc_multi_tiers Success 527.95 test_vpc_redundant.py
test_04_rvpc_network_garbage_collector_nics Success 1442.83 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Success 569.18 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Success 760.64 test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Success 1312.03 test_vpc_redundant.py
test_09_delete_detached_volume Success 156.64 test_volumes.py
test_08_resize_volume Success 156.42 test_volumes.py
test_07_resize_fail Success 156.51 test_volumes.py
test_06_download_detached_volume Success 156.40 test_volumes.py
test_05_detach_volume Success 155.84 test_volumes.py
test_04_delete_attached_volume Success 151.29 test_volumes.py
test_03_download_attached_volume Success 151.28 test_volumes.py
test_02_attach_volume Success 94.89 test_volumes.py
test_01_create_volume Success 711.29 test_volumes.py
test_03_delete_vm_snapshots Success 275.21 test_vm_snapshots.py
test_02_revert_vm_snapshots Success 100.74 test_vm_snapshots.py
test_01_create_vm_snapshots Success 163.86 test_vm_snapshots.py
test_deploy_vm_multiple Success 262.94 test_vm_life_cycle.py
test_deploy_vm Success 0.03 test_vm_life_cycle.py
test_advZoneVirtualRouter Success 0.03 test_vm_life_cycle.py
test_10_attachAndDetach_iso Success 26.70 test_vm_life_cycle.py
test_09_expunge_vm Success 125.18 test_vm_life_cycle.py
test_08_migrate_vm Success 30.98 test_vm_life_cycle.py
test_07_restore_vm Success 0.13 test_vm_life_cycle.py
test_06_destroy_vm Success 125.83 test_vm_life_cycle.py
test_03_reboot_vm Success 125.88 test_vm_life_cycle.py
test_02_start_vm Success 10.17 test_vm_life_cycle.py
test_01_stop_vm Success 40.33 test_vm_life_cycle.py
test_CreateTemplateWithDuplicateName Success 40.50 test_templates.py
test_08_list_system_templates Success 0.03 test_templates.py
test_07_list_public_templates Success 0.04 test_templates.py
test_05_template_permissions Success 0.14 test_templates.py
test_04_extract_template Success 5.16 test_templates.py
test_03_delete_template Success 5.11 test_templates.py
test_02_edit_template Success 90.17 test_templates.py
test_01_create_template Success 40.43 test_templates.py
test_10_destroy_cpvm Success 161.69 test_ssvm.py
test_09_destroy_ssvm Success 168.76 test_ssvm.py
test_08_reboot_cpvm Success 131.64 test_ssvm.py
test_07_reboot_ssvm Success 103.62 test_ssvm.py
test_06_stop_cpvm Success 131.88 test_ssvm.py
test_05_stop_ssvm Success 163.87 test_ssvm.py
test_04_cpvm_internals Success 1.24 test_ssvm.py
test_03_ssvm_internals Success 3.48 test_ssvm.py
test_02_list_cpvm_vm Success 0.15 test_ssvm.py
test_01_list_sec_storage_vm Success 0.14 test_ssvm.py
test_01_snapshot_root_disk Success 11.18 test_snapshots.py
test_04_change_offering_small Success 239.97 test_service_offerings.py
test_03_delete_service_offering Success 0.04 test_service_offerings.py
test_02_edit_service_offering Success 0.06 test_service_offerings.py
test_01_create_service_offering Success 0.11 test_service_offerings.py
test_02_sys_template_ready Success 0.14 test_secondary_storage.py
test_01_sys_vm_start Success 0.19 test_secondary_storage.py
test_09_reboot_router Success 35.34 test_routers.py
test_08_start_router Success 30.28 test_routers.py
test_07_stop_router Success 10.20 test_routers.py
test_06_router_advanced Success 0.08 test_routers.py
test_05_router_basic Success 0.08 test_routers.py
test_04_restart_network_wo_cleanup Success 5.73 test_routers.py
test_03_restart_network_cleanup Success 55.52 test_routers.py
test_02_router_internal_adv Success 1.03 test_routers.py
test_01_router_internal_basic Success 0.59 test_routers.py
test_router_dns_guestipquery Success 76.72 test_router_dns.py
test_router_dns_externalipquery Success 0.08 test_router_dns.py
test_router_dhcphosts Success 276.92 test_router_dhcphosts.py
test_router_dhcp_opts Success 21.83 test_router_dhcphosts.py
test_01_updatevolumedetail Success 0.08 test_resource_detail.py
test_01_reset_vm_on_reboot Success 130.94 test_reset_vm_on_reboot.py
test_createRegion Success 0.04 test_regions.py
test_create_pvlan_network Success 5.21 test_pvlan.py
test_dedicatePublicIpRange Success 0.48 test_public_ip_range.py
test_03_vpc_privategw_restart_vpc_cleanup Success 490.19 test_privategw_acl.py
test_02_vpc_privategw_static_routes Success 365.31 test_privategw_acl.py
test_01_vpc_privategw_acl Success 92.29 test_privategw_acl.py
test_01_primary_storage_nfs Success 35.86 test_primary_storage.py
test_createPortablePublicIPRange Success 15.28 test_portable_publicip.py
test_createPortablePublicIPAcquire Success 15.44 test_portable_publicip.py
test_isolate_network_password_server Success 91.18 test_password_server.py
test_UpdateStorageOverProvisioningFactor Success 0.14 test_over_provisioning.py
test_oobm_zchange_password Success 30.70 test_outofbandmanagement.py
test_oobm_multiple_mgmt_server_ownership Success 11.34 test_outofbandmanagement.py
test_oobm_issue_power_status Success 10.24 test_outofbandmanagement.py
test_oobm_issue_power_soft Success 15.36 test_outofbandmanagement.py
test_oobm_issue_power_reset Success 10.32 test_outofbandmanagement.py
test_oobm_issue_power_on Success 15.42 test_outofbandmanagement.py
test_oobm_issue_power_off Success 15.32 test_outofbandmanagement.py
test_oobm_issue_power_cycle Success 15.37 test_outofbandmanagement.py
test_oobm_enabledisable_across_clusterzones Success 92.79 test_outofbandmanagement.py
test_oobm_enable_feature_valid Success 5.18 test_outofbandmanagement.py
test_oobm_enable_feature_invalid Success 0.10 test_outofbandmanagement.py
test_oobm_disable_feature_valid Success 5.19 test_outofbandmanagement.py
test_oobm_disable_feature_invalid Success 0.10 test_outofbandmanagement.py
test_oobm_configure_invalid_driver Success 0.08 test_outofbandmanagement.py
test_oobm_configure_default_driver Success 0.08 test_outofbandmanagement.py
test_oobm_background_powerstate_sync Success 23.45 test_outofbandmanagement.py
test_extendPhysicalNetworkVlan Success 15.33 test_non_contigiousvlan.py
test_01_nic Success 429.27 test_nic.py
test_releaseIP Success 258.04 test_network.py
test_reboot_router Success 408.55 test_network.py
test_public_ip_user_account Success 10.27 test_network.py
test_public_ip_admin_account Success 40.49 test_network.py
test_network_rules_acquired_public_ip_3_Load_Balancer_Rule Success 67.00 test_network.py
test_network_rules_acquired_public_ip_2_nat_rule Success 61.77 test_network.py
test_network_rules_acquired_public_ip_1_static_nat_rule Success 124.15 test_network.py
test_delete_account Success 288.94 test_network.py
test_02_port_fwd_on_non_src_nat Success 55.79 test_network.py
test_01_port_fwd_on_src_nat Success 111.78 test_network.py
test_nic_secondaryip_add_remove Success 222.91 test_multipleips_per_nic.py
login_test_saml_user Success 19.16 test_login.py
test_assign_and_removal_lb Success 133.66 test_loadbalance.py
test_02_create_lb_rule_non_nat Success 187.51 test_loadbalance.py
test_01_create_lb_rule_src_nat Success 219.39 test_loadbalance.py
test_03_list_snapshots Success 0.06 test_list_ids_parameter.py
test_02_list_templates Success 0.04 test_list_ids_parameter.py
test_01_list_volumes Success 0.03 test_list_ids_parameter.py
test_07_list_default_iso Success 0.07 test_iso.py
test_05_iso_permissions Success 0.07 test_iso.py
test_04_extract_Iso Success 5.17 test_iso.py
test_03_delete_iso Success 95.22 test_iso.py
test_02_edit_iso Success 0.06 test_iso.py
test_01_create_iso Success 21.05 test_iso.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfaces Success 203.93 test_internal_lb.py
test_03_vpc_internallb_haproxy_stats_on_all_interfaces Success 153.24 test_internal_lb.py
test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 Success 528.45 test_internal_lb.py
test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 Success 450.65 test_internal_lb.py
test_dedicateGuestVlanRange Success 10.31 test_guest_vlan_range.py
test_UpdateConfigParamWithScope Success 0.16 test_global_settings.py
test_rolepermission_lifecycle_update Success 6.24 test_dynamicroles.py
test_rolepermission_lifecycle_list Success 6.03 test_dynamicroles.py
test_rolepermission_lifecycle_delete Success 5.87 test_dynamicroles.py
test_rolepermission_lifecycle_create Success 5.91 test_dynamicroles.py
test_rolepermission_lifecycle_concurrent_updates Success 6.05 test_dynamicroles.py
test_role_lifecycle_update_role_inuse Success 5.94 test_dynamicroles.py
test_role_lifecycle_update Success 11.04 test_dynamicroles.py
test_role_lifecycle_list Success 5.95 test_dynamicroles.py
test_role_lifecycle_delete Success 11.21 test_dynamicroles.py
test_role_lifecycle_create Success 5.94 test_dynamicroles.py
test_role_inuse_deletion Success 6.05 test_dynamicroles.py
test_role_account_acls_multiple_mgmt_servers Success 8.61 test_dynamicroles.py
test_role_account_acls Success 9.39 test_dynamicroles.py
test_default_role_deletion Success 6.52 test_dynamicroles.py
test_04_create_fat_type_disk_offering Success 0.10 test_disk_offerings.py
test_03_delete_disk_offering Success 0.05 test_disk_offerings.py
test_02_edit_disk_offering Success 0.07 test_disk_offerings.py
test_02_create_sparse_type_disk_offering Success 0.08 test_disk_offerings.py
test_01_create_disk_offering Success 0.15 test_disk_offerings.py
test_deployvm_userdispersing Success 20.63 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userconcentrated Success 20.65 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_firstfit Success 70.82 test_deploy_vms_with_varied_deploymentplanners.py
test_deployvm_userdata_post Success 10.48 test_deploy_vm_with_userdata.py
test_deployvm_userdata Success 70.96 test_deploy_vm_with_userdata.py
test_02_deploy_vm_root_resize Success 6.22 test_deploy_vm_root_resize.py
test_01_deploy_vm_root_resize Success 6.01 test_deploy_vm_root_resize.py
test_00_deploy_vm_root_resize Success 222.75 test_deploy_vm_root_resize.py
test_deploy_vm_from_iso Success 212.81 test_deploy_vm_iso.py
test_DeployVmAntiAffinityGroup Success 66.12 test_affinity_groups.py
test_change_service_offering_for_vm_with_snapshots Skipped 0.00 test_vm_snapshots.py
test_01_test_vm_volume_snapshot Skipped 0.00 test_vm_snapshots.py
test_06_copy_template Skipped 0.00 test_templates.py
test_static_role_account_acls Skipped 0.03 test_staticroles.py
test_11_ss_nfs_version_on_ssvm Skipped 0.02 test_ssvm.py
test_01_scale_vm Skipped 0.00 test_scale_vm.py
test_01_primary_storage_iscsi Skipped 0.04 test_primary_storage.py
test_nested_virtualization_vmware Skipped 0.00 test_nested_virtualization.py
test_06_copy_iso Skipped 0.00 test_iso.py
test_deploy_vgpu_enabled_vm Skipped 0.04 test_deploy_vgpu_enabled_vm.py
test_3d_gpu_support Skipped 0.04 test_deploy_vgpu_enabled_vm.py

@serg38
Copy link

serg38 commented Mar 10, 2017

@mike-tutkowski Can you test this fix in your environment?

@mike-tutkowski
Copy link
Member

mike-tutkowski commented Mar 10, 2017 via email

Copy link
Member

@rafaelweingartner rafaelweingartner left a comment

Choose a reason for hiding this comment

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

@nvazquez I have checked the code, and I had a few suggestions to improve the code quality. I know it is a blocker, and we are in RC. So, I will not be picky with the code. If it is not possible to make those changes, I am ok (at least for now).


@Override
public List<StoragePoolTagVO> searchByIds(Long... stIds) {
String batchCfg = _configDao.getValue("detail.batch.query.size");
Copy link
Member

Choose a reason for hiding this comment

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

@nvazquez what about extracting lines 95-97 to a method?
Then, we can have test cases and some doc for it. Especially for that 2000 magic number there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

About number 2000, I assumed it was a default value for that configuration

ids[k] = stIds[j];
}

SearchCriteria<StoragePoolTagVO> sc = StoragePoolIdsSearch.create();
Copy link
Member

Choose a reason for hiding this comment

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

@nvazquez lines 105-119 are the same as 128-142.
What about extracting them for a method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, created method searchForStoragePoolIdsInternal

Map<String, String> details = tagsToDetails(tags);

StringBuilder sql = new StringBuilder(ZoneWideDetailsSqlPrefix);
StringBuilder sql = new StringBuilder(ZoneWideTagsSqlPrefix);
Copy link
Member

Choose a reason for hiding this comment

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

@nvazquez what about extracting lines 463-469 to a method? Then, we can create doc and most of all test cases. This is a pretty tricky bit of code (Especially line 468).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, I had missed it out. Created methods getSqlPreparedStatement and searchStoragePoolsPreparedStatement which are called from many methods and allow storage pool retrieval

@mike-tutkowski
Copy link
Member

I have run the following use cases successfully:

PS = Primary Storage
ST = Storage Tag
CO = Compute Offering
DO = Disk Offering
V = Volume

Create PS_1 with ST NFS-A

Create CO_1 with ST NFS-A
Create CO_2 with ST NFS-B

Create VM_1 with CO_1 (VM starts)
Create VM_2 with CO_2 (VM fails to find storage)

Edit ST of PS_1 from NFS-A to NFS-B

Create VM_2 with CO_1 (VM fails to find storage)
Create VM_2 with CO_2 (VM starts)

Create DO_1 with ST NFS-A
Create DO_2 with ST NFS-B

Create V_1 with DO_1 and attach to VM_1 (fails to find storage)
Create V_2 with DO_2 and attach to VM_1

Edit ST of PS_1 from NFS-B to NFS-A

Create V_1 with DO_1 and attach to VM_1

Create PS_2 with no ST

Edit ST of PS_2 to NFS-B

Create V_3 with DO_1 and attach to VM_2 (lands on expected PS)
Create V_4 with DO_2 and attach to VM_2 (lands on expected PS)

Create PS_3 with ST NFS-B

Migrate V_4 from PS_2 to PS_3 (PS_1 is not an option)
Migrate V_4 from PS_3 to PS_2 (PS_1 is not an option)

Migrate V_3 from PS_1 to PS_2 (Neither PS_2 nor PS_3 is an option)

Migrate root V of VM_1 from PS_1 to PS_2 (Neither PS_2 nor PS_3 is an option)

Migrate root V of VM_2 from PS_1 to PS_3 (PS_2 and PS_3 are options)

listStorageTags API returned expected results (I ran this at several points along the way)

@karuturi
Copy link
Member

@nvazquez I think any of the existing marvin tests didnt catch this bug. Is it possible to add a marvin test for it?

@nvazquez
Copy link
Contributor Author

@mike-tutkowski awesome, thanks for testing this PR!

@rafaelweingartner thanks for reviewing, I'll work on changes proposed

@karuturi sure, I'll work on it, thanks!

Copy link
Member

@rafaelweingartner rafaelweingartner left a comment

Choose a reason for hiding this comment

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

@nvazquez I have been thinking a while about this conditional. what do you think about my comment?

List<StoragePoolTagVO> uvList = new ArrayList<StoragePoolTagVO>();
int curr_index = 0;

if (stIds.length > detailsBatchSize) {
Copy link
Member

Choose a reason for hiding this comment

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

Correct me if I am wrong, but this if is not needed.
Let's assume the configuration:

batchSize=2000
current_index=0
lengthOfStIds=100

curr_index + detailsBatchSize = 0 + 2000, which is not less than the size of the array (100). Therefore, the while is not executed. Then, the pools will be loaded at lines 100-112

Copy link
Contributor Author

@nvazquez nvazquez Mar 14, 2017

Choose a reason for hiding this comment

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

I think that if is needed, we need it to control the max query size. I agree with the example you provided, but let's say for example that lengthOfStIds is greater that batchSize. If we remove that if, we will load pools on lines 100-112 but with a query size greater that batchSize (defined in line 111)

Copy link
Member

Choose a reason for hiding this comment

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

I mistyped the lines in my last sentence, it should have been 110-112.
Will it be loaded with a bigger batch size? From my reading, even without the if at line 103, if stIds.length is smaller than the batch size, the while is not executed (not even once). Then, the flow proceeds the same as if the if had been executed. Then, at line 111 the batch_size is calculated using stIds.length - curr_index.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @rafaelweingartner, I assumed that you meant deleting the whole if block (lines 103-108), is it correct or you mean just deleting line 103 (and 108)?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, no this is not what I meant.
I meant only removing the if and letting the while directly there.
Just deleting line 103

Copy link
Contributor Author

@nvazquez nvazquez Mar 15, 2017

Choose a reason for hiding this comment

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

Nice, I agree with you that the line can be removed. Sorry for the confusion, I'll try adding some unit tests for this change. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

No problem ;)

It is awesome the changes you have done here. The code became cleaner, with good documentation and on top of that, we now have unit tests to guarantee that the methods are workings as expected.

Great job @nvazquez, well done!

PS: Sorry if I have been too picky with the code changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Thanks a lot @rafaelweingartner!

Copy link
Member

@rafaelweingartner rafaelweingartner left a comment

Choose a reason for hiding this comment

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

Other static variable that was left behind in the test case

private static PrimaryDataStoreDaoImpl primaryDataStoreDao = new PrimaryDataStoreDaoImpl();

@Mock
static StoragePoolVO storagePoolVO;
Copy link
Member

Choose a reason for hiding this comment

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

Here you have other static variable in a test case that does not need to be static.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I removed it

@karuturi
Copy link
Member

@nvazquez any update?

@nvazquez
Copy link
Contributor Author

Hi @karuturi, I've been working on marvin tests, I hope posting them today

@nvazquez
Copy link
Contributor Author

@karuturi I added marvin tests to simulate tests performed by @mike-tutkowski.

This are results in our env:

[root@ussarlabcsmgt41 cloudstack]# cat /tmp//MarvinLogs//011CTF/results.txt
Test primary storage pools - XEN. Not Supported for kvm,hyperv,vmware ... SKIP: iscsi primary storage not supported on kvm, VMWare, Hyper-V, or LXC
Test primary storage pools - XEN, KVM, VMWare. Not Supported for hyperv ... === TestName: test_01_primary_storage_nfs | Status : SUCCESS ===
ok
Test Deploy VMS using different Service Offerings with Storage Tags ... === TestName: test_01_deploy_vms_storage_tags | Status : SUCCESS ===
ok
Test edit Storage Tags ... === TestName: test_02_edit_primary_storage_tags | Status : SUCCESS ===
ok
Test Volume migration options for Storage Pools with different Storage Tags ... SKIP: Skipping test as it is not running on simulator

----------------------------------------------------------------------
Ran 5 tests in 295.996s

OK (SKIP=2)

@rafaelweingartner @mike-tutkowski @karuturi can you please review marvin tests added?

@karuturi
Copy link
Member

Thanks @nvazquez Waiting for LGTMs

@serg38
Copy link

serg38 commented Mar 20, 2017

@nvazquez Looks like Travis cant SSH into management server during the test .

2017-03-17 19:26:58,672 - DEBUG - mount -t nfs nfs:/export/automation/1/testprimary /mnt/marvin-1b4190cb-b9f5-4441-9bdc-bd89e9b7567b
2017-03-17 19:27:13,468 - CRITICAL - EXCEPTION: test_03_migration_options_storage_tags: ['Traceback (most recent call last):\n', ' File "/opt/python/2.7.12/lib/python2.7/unittest/case.py", line 329, in run\n testMethod()\n', ' File "/home/travis/.local/lib/python2.7/site-packages/marvin/lib/decoratorGenerators.py", line 30, in test_wrapper\n return test(self, *args, **kwargs)\n', ' File "/home/travis/build/apache/cloudstack/test/integration/smoke/test_primary_storage.py", line 559, in test_03_migration_options_storage_tags\n log_lvl=logging.INFO\n', ' File "/home/travis/.local/lib/python2.7/site-packages/marvin/sshClient.py", line 81, in init\n raise internalError("SSH Connection Failed")\n', 'internalError: SSH Connection Failed\n']

@nvazquez
Copy link
Contributor Author

Thanks @serg38, we are using mgtSvr details provided in .cfg file, should we use these for Marvin too?

@karuturi
Copy link
Member

@mike-tutkowski can you do a final review please?

@mike-tutkowski
Copy link
Member

I should have a chance to look through this later tonight. In the meanwhile, perhaps we can re-push the code to kick off Travis again (since its most recent run has a failure). Thanks!

@mike-tutkowski
Copy link
Member

OK, this LGTM (as long as Travis shows green before we merge). Thanks!

@nvazquez
Copy link
Contributor Author

Thanks @mike-tutkowski! I pushed force to kick off Travis again

@nvazquez nvazquez force-pushed the CLOUDSTACK-9827 branch 2 times, most recently from b6f0d76 to 84ce38f Compare March 23, 2017 18:26
@nvazquez
Copy link
Contributor Author

@karuturi I refactored last marvin test which was failing on Travis. These are results in our env:

[root@ussarlabcsmgt41 cloudstack]# cat /tmp//MarvinLogs//4GSNSY/results.txt
Test primary storage pools - XEN. Not Supported for kvm,hyperv,vmware ... SKIP: iscsi primary storage not supported on kvm, VMWare, Hyper-V, or LXC
Test primary storage pools - XEN, KVM, VMWare. Not Supported for hyperv ... === TestName: test_01_primary_storage_nfs | Status : SUCCESS ===
ok
Test Deploy VMS using different Service Offerings with Storage Tags ... === TestName: test_01_deploy_vms_storage_tags | Status : SUCCESS ===
ok
Test Edit Storage Tags ... === TestName: test_02_edit_primary_storage_tags | Status : SUCCESS ===
ok
Test Volume migration options for Storage Pools with different Storage Tags ... === TestName: test_03_migration_options_storage_tags | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 5 tests in 442.216s

OK (SKIP=1)

@rhtyd @borisstoyanov @jburwell on test_primary_storage.py we are creating 2 primary storages, using urls in "nfs" and "nfs2" test data templates. As PR #1961 uses "nfs2" template on test_snapshots.py, should it be a problem for BlueOrangutan?

@nvazquez
Copy link
Contributor Author

@karuturi Travis is now failing as it doesn't find key "nfs2"

2017-03-24 17:33:45,621 - CRITICAL - EXCEPTION: test_03_migration_options_storage_tags: ['Traceback (most recent call last):\n', '  File "/opt/python/2.7.12/lib/python2.7/unittest/case.py", line 329, in run\n    testMethod()\n', '  File "/home/travis/.local/lib/python2.7/site-packages/marvin/lib/decoratorGenerators.py", line 30, in test_wrapper\n    return test(self, *args, **kwargs)\n', '  File "/home/travis/build/apache/cloudstack/test/integration/smoke/test_primary_storage.py", line 520, in test_03_migration_options_storage_tags\n    self.services["nfs2"],\n', "KeyError: 'nfs2'\n"]

It is introduced in PR #1961, can these two PRs be merged together?

@karuturi
Copy link
Member

Thank you all. I will merge #1961 and #1994 now

@asfgit asfgit merged commit edf0e2b into apache:master Mar 28, 2017
asfgit pushed a commit that referenced this pull request Mar 28, 2017
CLOUDSTACK-9827: Storage tags stored in multiple placesIssue description: https://issues.apache.org/jira/browse/CLOUDSTACK-9827

### Fixes
- Create Primary Storage: Persist tags into `storage_pool_tags` instead of `storage_pool_details`
- List Storage Tags: Queries `storage_pool_tags` table instead of `storage_tag_view`
- Find Storage Pools by Tags using proper DAO
- Remove storage tags after deleting Primary Storage
- Remove unused `StorageTagDao`, `StorageTagDaoImpl`, `StorageTagVO` and `storage_tag_view`

* pr/1994:
  CLOUDSTACK-9827: Storage tags stored in multiple places

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
verify(primaryDataStoreDao).getSqlPreparedStatement(
primaryDataStoreDao.TagsSqlPrefix, primaryDataStoreDao.TagsSqlSuffix, SQL_VALUES, CLUSTER_ID);
String expectedSql = primaryDataStoreDao.TagsSqlPrefix + SQL_VALUES + primaryDataStoreDao.TagsSqlSuffix;
verify(primaryDataStoreDao).searchStoragePoolsPreparedStatement(expectedSql, DATACENTER_ID, POD_ID, CLUSTER_ID, SCOPE, STORAGE_TAGS_ARRAY.length);

Choose a reason for hiding this comment

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

@nvazquez With these types of test we are kind of forcing the SQL statement to use in implementation. Do you think this is correct thing to test? What if somebody wants to rewrite in different way altogether to achieve the same result?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @anshul1886,
I understand your point of view and I think it is valid. However, from my point of view these unit tests are covering internal methods used in the implementation. For example, for method String getSqlValuesFromStorageTags(String[] tags) tests provided cover cases when parameter is null, empty or not null. As this method returns a string, it is the goal of unit tests to check if the string returned by the method is the one we expect for each of those cases, and in my opinion, it is being tested properly. I mention this particular method as string returned is a SQL statement.
The last two tests in this file are testing findPoolsByDetailsOrTagsInternal, comparing returned list with the one expected and also verifying that internal methods are invoked with expected parameters, but these parametes are strings (SQL statements). From my point of view, we are not forcing SQL statement to use, we are checking that internal methods are being invoked properly.
In this way, if method is refactored but achieves the same result, we have to modify/remove lines which verifies if internal methods are invoked for the ones that belong to new implementation.
Please let me know if I didn't explain myself, what do you think? I don't mean to be stubborn with this, it was my point of view, and of course I might be wrong. What do you think it has to be refactored in these tests?

@anshul1886
Copy link

@nvazquez I have this PR #1835 which is making changes in that SQL. Now the the tests written by you are not allowing those changes. How should we go about it?

@nvazquez
Copy link
Contributor Author

Hi @anshul1886, you can modify verify lines on tests testFindPoolsByDetailsOrTagsInternalStorageTagsType and testFindPoolsByDetailsOrTagsInternalDetailsType for the ones that methods will expect, or if you want you can delete them to not be tied to SQL implementation

@anshul1886
Copy link

@nvazquez Is it ok for you to remove those tests?

@nvazquez
Copy link
Contributor Author

nvazquez commented Jun 7, 2017

@anshul1886 I would prefer that you delete verify lines on those tests, but if you want to remove tests it is ok for me.

@nvazquez nvazquez deleted the CLOUDSTACK-9827 branch April 6, 2020 14:53
Sign up for free to 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