Skip to content

Conversation

weizhouapache
Copy link
Member

Description

This PR fixes the test failure below on vmware

image

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@boring-cyborg boring-cyborg bot added component:integration-test Python Warning... Python code Ahead! labels May 16, 2025
@weizhouapache
Copy link
Member Author

I do not understand why the old volume is expunged only for vmware

// For VMware hypervisor since the old root volume is replaced by the new root volume, force expunge old root volume if it has been created in storage
if (vm.getHypervisorType() == HypervisorType.VMware) {
VolumeInfo volumeInStorage = volFactory.getVolume(root.getId());
if (volumeInStorage != null) {
logger.info("Expunging volume {} from primary data store", root);
AsyncCallFuture<VolumeApiResult> future = _volService.expungeVolumeAsync(volFactory.getVolume(root.getId()));
try {
future.get();
} catch (Exception e) {
logger.debug("Failed to expunge volume: {}", root, e);
}
}

it is the root cause

Copy link

codecov bot commented May 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.13%. Comparing base (badf3e1) to head (042870f).
Report is 1 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #10885      +/-   ##
============================================
- Coverage     16.14%   16.13%   -0.01%     
+ Complexity    13240    13239       -1     
============================================
  Files          5656     5656              
  Lines        497578   497578              
  Branches      60332    60332              
============================================
- Hits          80310    80299      -11     
- Misses       408317   408330      +13     
+ Partials       8951     8949       -2     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 16.98% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13433

@weizhouapache
Copy link
Member Author

@blueorangutan test ol8 vmware-80u3

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-80u3) has been kicked to run smoke tests

@weizhouapache weizhouapache marked this pull request as ready for review May 19, 2025 10:09
Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

clgtm, somehow my commit was missed in PR #10586

# git diff
diff --git a/test/integration/smoke/test_restore_vm.py b/test/integration/smoke/test_restore_vm.py
index aac33460da1..6ce06c957e6 100644
--- a/test/integration/smoke/test_restore_vm.py
+++ b/test/integration/smoke/test_restore_vm.py
@@ -148,9 +148,13 @@ class TestRestoreVM(cloudstackTestCase):
         self.assertEqual(root_vol.state, 'Ready', "Volume should be in Ready state")
         self.assertEqual(root_vol.size, 16 * 1024 * 1024 * 1024, "Size of volume and custom disk size should match")
 
-        old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)[0]
-        self.assertEqual(old_root_vol.state, "Destroy", "Old volume should be in Destroy state")
-        Volume.delete(old_root_vol, self.apiclient)
+        if self.hypervisor.lower() not in ["vmware"]:
+            old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)[0]
+            self.assertEqual(old_root_vol.state, "Destroy", "Old volume should be in Destroy state")
+            Volume.delete(old_root_vol, self.apiclient)
+        else:
+            old_root_vol = Volume.list(self.apiclient, id=old_root_vol.id)
+            self.assertEqual(old_root_vol, None, "Old volume should be deleted")
 
     @attr(tags=["advanced", "basic"], required_hardware="false")
     def test_04_restore_vm_allocated_root(self):
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index bde48c87616..c90037ea22e 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -1080,7 +1080,7 @@ test_data = {
             "format": "vhd",
             "hypervisor": "xenserver",
             "ostype": "Other Linux (64-bit)",
-            "url": "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64-azure.vhd.tar.gz",
+            "url": "https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-amd64-azure.vhd.tar.gz",
             "requireshvm": "True",
             "ispublic": "True",
             "isextractable": "True"
@@ -1091,7 +1091,7 @@ test_data = {
             "format": "ova",
             "hypervisor": "vmware",
             "ostype": "Other Linux (64-bit)",
-            "url": "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.ova",
+            "url": "https://cloud-images.ubuntu.com/releases/jammy/release/ubuntu-22.04-server-cloudimg-amd64.ova",
             "requireshvm": "True",
             "ispublic": "True",
             "deployasis": "True"
...
# git log -1
commit 3b34d1f4718ea52aa3a186b9be1a5c0249f0f28d (HEAD -> vmware-80u2-and-80u3-updates)
Author: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
Date:  Thu Apr 10 11:56:26 2025 +0530

  Updated restore vm test for VMware (old root volume is expunged in VMware as it is replaced by the new root volume)

@weizhouapache
Copy link
Member Author

tests results

image

@weizhouapache
Copy link
Member Author

thanks @sureshanaparti

merging as the smoke tests passed

@weizhouapache weizhouapache merged commit 538e35f into apache:4.20 May 19, 2025
14 of 26 checks passed
@blueorangutan
Copy link

[SF] Trillian test result (tid-13346)
Environment: vmware-80u3 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 123364 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10885-t13346-vmware-80u3.zip
Smoke tests completed. 114 look OK, 27 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_11_isolated_network_with_dynamic_routed_mode Failure 179.67 test_ipv4_routing.py
test_11_isolated_network_with_dynamic_routed_mode Error 179.68 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 1.10 test_ipv4_routing.py
test_deploy_more_vms_than_limit_allows Error 220.31 test_deploy_vms_in_parallel.py
test_05_basic_lifecycle_kubernetes_cluster Failure 187.00 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 714.11 test_kubernetes_clusters.py
test_nested_virtualization_vmware Error 220.49 test_nested_virtualization.py
test_03_network_operations_on_created_vm_of_otheruser Failure 265.08 test_network_permissions.py
test_03_network_operations_on_created_vm_of_otheruser Error 265.09 test_network_permissions.py
test_04_deploy_vm_for_other_user_and_test_vm_operations Failure 62.45 test_network_permissions.py
ContextSuite context=TestNetworkPermissions>:teardown Error 1.54 test_network_permissions.py
test_reboot_router Error 306.49 test_network.py
test_01_deployVMInSharedNetwork Error 428.69 test_network.py
test_03_nic_multiple_vmware Error 682.80 test_nic.py
test_01_non_strict_host_anti_affinity Error 295.01 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 116.44 test_nonstrict_affinity_group.py
test_10_project_activation Error 8.87 test_projects.py
test_08_start_router Error 2.18 test_routers.py
test_09_reboot_router Error 1.16 test_routers.py
test_10_reboot_router_forced Error 1.14 test_routers.py
test_04_change_offering_small Error 102.83 test_service_offerings.py
test_resize_shared_fs Error 23.27 test_sharedfs_lifecycle.py
test_01_list_sec_storage_vm Failure 0.07 test_ssvm.py
test_03_ssvm_internals Failure 0.07 test_ssvm.py
test_05_stop_ssvm Failure 0.06 test_ssvm.py
test_06_stop_cpvm Failure 936.02 test_ssvm.py
test_07_reboot_ssvm Failure 0.06 test_ssvm.py
test_08_reboot_cpvm Failure 0.04 test_ssvm.py
test_09_reboot_ssvm_forced Failure 0.04 test_ssvm.py
test_10_reboot_cpvm_forced Failure 0.05 test_ssvm.py
test_11_destroy_ssvm Failure 0.04 test_ssvm.py
ContextSuite context=TestVMWareStoragePolicies>:setup Error 0.00 test_storage_policy.py
test_01_create_template Error 1.22 test_templates.py
test_CreateTemplateWithDuplicateName Error 152.64 test_templates.py
test_02_create_template_with_checksum_sha1 Error 65.76 test_templates.py
test_03_create_template_with_checksum_sha256 Error 65.82 test_templates.py
test_04_create_template_with_checksum_md5 Error 65.84 test_templates.py
test_05_create_template_with_no_checksum Error 65.77 test_templates.py
ContextSuite context=TestTemplates>:setup Error 168.80 test_templates.py
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py
test_01_template_usage Error 1.24 test_usage.py
test_01_volume_usage Error 75.21 test_usage.py
test_01_deploy_vm_on_specific_host Error 4.49 test_vm_deployment_planner.py
test_02_deploy_vm_on_specific_cluster Error 4.50 test_vm_deployment_planner.py
test_03_deploy_vm_on_specific_pod Error 4.65 test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_cluster Error 4.56 test_vm_deployment_planner.py
test_05_deploy_vm_on_cluster_override_pod Error 1.43 test_vm_deployment_planner.py
ContextSuite context=TestVAppsVM>:setup Error 1525.14 test_vm_life_cycle.py
test_02_start_vm Error 7.28 test_vm_life_cycle.py
test_03_reboot_vm Error 1.12 test_vm_life_cycle.py
test_04_reboot_vm_forced Failure 1.10 test_vm_life_cycle.py
test_10_attachAndDetach_iso Failure 1514.17 test_vm_life_cycle.py
test_05_vmschedule_test_e2e Failure 362.67 test_vm_schedule.py
test_change_service_offering_for_vm_with_snapshots Failure 361.02 test_vm_snapshots.py
test_02_revert_vm_snapshots Error 110.16 test_vm_snapshots.py
ContextSuite context=TestMigrateVMStrictTags>:setup Error 0.00 test_vm_strict_host_tags.py
ContextSuite context=TestRestoreVMStrictTags>:setup Error 0.00 test_vm_strict_host_tags.py
ContextSuite context=TestScaleVMStrictTags>:setup Error 0.00 test_vm_strict_host_tags.py
ContextSuite context=TestVMDeploymentPlannerStrictTags>:setup Error 0.00 test_vm_strict_host_tags.py
test_04_deploy_vnf_appliance Error 311.96 test_vnf_templates.py
ContextSuite context=TestVolumes>:setup Error 1517.72 test_volumes.py
ContextSuite context=TestIpv6Vpc>:setup Error 0.00 test_vpc_ipv6.py
ContextSuite context=TestVPCRedundancy>:setup Error 0.00 test_vpc_redundant.py
ContextSuite context=TestVPCNics>:setup Error 0.00 test_vpc_router_nics.py
ContextSuite context=TestRVPCSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVPCSite2SiteVPNMultipleOptions>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcRemoteAccessVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py

@DaanHoogland DaanHoogland deleted the 4.20-fix-vmware-test-restore-vm branch May 20, 2025 06:41
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
* test: fix test_restore_vm failure on vmware

* Fix URL for cloud-init vms on vmware/xen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants