You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "weizhouapache (via GitHub)" <gi...@apache.org> on 2026/08/26 09:35:45 UTC

[PR] vmware-base: fix template copy from secondary to primary [cloudstack]

weizhouapache opened a new pull request, #13977:
URL: https://github.com/apache/cloudstack/pull/13977

   ### Description
   
   This PR fixes #7572 #12036 (hopefully)
   
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ******************************************************************************* -->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ******************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] 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?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5492242702

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5542488817

   <b>[SF] Trillian test result (tid-33)</b>
   Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol8
   Total time taken: 105734 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13977-n33-vmware-80u3.zip
   Smoke tests completed. 137 look OK, 4 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_deploy_more_vms_than_limit_allows | `Error` | 167.72 | test_deploy_vms_in_parallel.py
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 3672.47 | test_kubernetes_clusters.py
   test_01_scale_vm | `Error` | 1.35 | test_scale_vm.py
   test_02_scale_vm_negative_offering_disable_scaling | `Error` | 1.30 | test_scale_vm.py
   test_03_scale_vm_negative_vm_disable_scaling | `Error` | 1.25 | test_scale_vm.py
   test_04_scale_vm_with_user_account | `Error` | 9.22 | test_scale_vm.py
   test_05_scale_vm_dont_allow_disk_offering_change | `Error` | 1.34 | test_scale_vm.py
   test_01_migrate_vm_strict_tags_success | `Error` | 3604.81 | test_vm_strict_host_tags.py
   test_02_migrate_vm_strict_tags_failure | `Error` | 27.38 | test_vm_strict_host_tags.py
   test_01_restore_vm_strict_tags_success | `Error` | 3604.98 | test_vm_strict_host_tags.py
   test_02_restore_vm_strict_tags_failure | `Error` | 14.98 | test_vm_strict_host_tags.py
   test_01_scale_vm_strict_tags_success | `Error` | 3603.48 | test_vm_strict_host_tags.py
   test_02_scale_vm_strict_tags_failure | `Error` | 3.97 | test_vm_strict_host_tags.py
   test_01_deploy_vm_on_specific_host_without_strict_tags | `Error` | 22.26 | test_vm_strict_host_tags.py
   test_02_deploy_vm_on_any_host_without_strict_tags | `Error` | 3606.11 | test_vm_strict_host_tags.py
   test_03_deploy_vm_on_specific_host_with_strict_tags_success | `Error` | 3.95 | test_vm_strict_host_tags.py
   test_04_deploy_vm_on_any_host_with_strict_tags_success | `Error` | 5.70 | test_vm_strict_host_tags.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5423418241

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5423476747

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/13977?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 4.14%. Comparing base ([`6136ac9`](https://app.codecov.io/gh/apache/cloudstack/commit/6136ac93854b53607f09ee42bf1a80a1b7187fce?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`729906f`](https://app.codecov.io/gh/apache/cloudstack/commit/729906f5fb1e7f6c62c43f39a04d8b68b24c7568?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   > :exclamation:  There is a different number of reports uploaded between BASE (6136ac9) and HEAD (729906f). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (6136ac9) | HEAD (729906f) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.20   #13977       +/-   ##
   =============================================
   - Coverage     16.32%    4.14%   -12.18%     
   =============================================
     Files          5669      405     -5264     
     Lines        501399    33026   -468373     
     Branches      60902     5898    -55004     
   =============================================
   - Hits          81847     1370    -80477     
   + Misses       410390    31480   -378910     
   + Partials       9162      176     -8986     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/13977/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/13977/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.14% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/13977/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/cloudstack/pull/13977?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6034629056

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5492252588

   @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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5929927025

   the smoke tests look ok.
   
   I donot know what else need to be tested, maybe the same issue described in the description ?
   cc @sureshanaparti @DaanHoogland 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5462534684

   <b>[SF] Trillian Build Failed (tid-16845)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "andrijapanicsb (via GitHub) via commits" <co...@cloudstack.apache.org>.
andrijapanicsb commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6553330483

   @ACSHomeBot package G


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5947828915

   @vladimirpetrov assigned to you
   
   > the smoke tests look ok.
   > 
   > I donot know what else need to be tested, maybe the same issue described in the description ? cc @sureshanaparti @DaanHoogland
   
   hope you find time for this ...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#discussion_r4219299451


##########
vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareContext.java:
##########
@@ -442,32 +443,82 @@ public void uploadVmdkFile(String httpMethod, String urlString, String localFile
         conn.setRequestProperty("content-length", Long.toString(new File(localFileName).length()));
         connectWithRetry(conn);
 
-        BufferedOutputStream bos = null;
-        BufferedInputStream is = null;
         try {
-            bos = new BufferedOutputStream(conn.getOutputStream());
-            is = new BufferedInputStream(new FileInputStream(localFileName));
-            int bufferSize = ChunkSize;
-            byte[] buffer = new byte[bufferSize];
+            writeVmdkFileToConnection(conn, httpMethod, urlString, localFileName, totalBytesUpdated, progressUpdater);
+            checkUploadResponse(conn, httpMethod, urlString, localFileName);
+        } finally {
+            conn.disconnect();
+        }
+    }
+
+    private void writeVmdkFileToConnection(HttpURLConnection conn, String httpMethod, String urlString, String localFileName, long totalBytesUpdated,
+            ActionDelegate<Long> progressUpdater) throws IOException {
+        long bytesWrittenThisCall = 0;
+        try (BufferedOutputStream bos = new BufferedOutputStream(conn.getOutputStream());
+             BufferedInputStream is = new BufferedInputStream(new FileInputStream(localFileName))) {
+            byte[] buffer = new byte[ChunkSize];
             while (true) {
-                int bytesRead = is.read(buffer, 0, bufferSize);
+                int bytesRead = is.read(buffer, 0, ChunkSize);
                 if (bytesRead == -1) {
                     break;
                 }
                 bos.write(buffer, 0, bytesRead);
                 totalBytesUpdated += bytesRead;
+                bytesWrittenThisCall += bytesRead;
                 bos.flush();
                 if (progressUpdater != null)
                     progressUpdater.action(new Long(totalBytesUpdated));
             }
             bos.flush();
-        } finally {
-            if (is != null)
-                is.close();
-            if (bos != null)
-                bos.close();
+        } catch (IOException e) {
+            throw new IOException(String.format("Upload of %s to %s %s failed after writing %d of %d bytes for this file " +
+                            "(%d bytes total written so far for this import): %s",
+                    localFileName, httpMethod, urlString, bytesWrittenThisCall, new File(localFileName).length(), totalBytesUpdated, e.getMessage()), e);
+        }
+    }
 
-            conn.disconnect();
+    /**
+     * HttpURLConnection does not surface a failed request just because the client finished writing the
+     * request body without an IOException: with chunked transfer encoding many HTTP servers, including
+     * ESXi's NFC endpoint, read and discard the whole body before responding with an error status (e.g. a
+     * VMFS file lock, an out-of-space datastore, or an authentication/session failure). Silently ignoring
+     * the response code is exactly how a rejected/short write can look like a "successful" upload to
+     * CloudStack. Surface the actual status code, reason phrase and (if any) response body so failures like
+     * "file locked" are visible in the CloudStack logs instead of only in vCenter/ESXi's own logs, if at all.
+     */
+    private void checkUploadResponse(HttpURLConnection conn, String httpMethod, String urlString, String localFileName) throws IOException {
+        int responseCode;
+        try {
+            responseCode = conn.getResponseCode();

Review Comment:
   yes, it is. that's why we had the storage issues before. #7572 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#discussion_r4220314020


##########
vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareContext.java:
##########
@@ -442,32 +443,82 @@ public void uploadVmdkFile(String httpMethod, String urlString, String localFile
         conn.setRequestProperty("content-length", Long.toString(new File(localFileName).length()));
         connectWithRetry(conn);
 
-        BufferedOutputStream bos = null;
-        BufferedInputStream is = null;
         try {
-            bos = new BufferedOutputStream(conn.getOutputStream());
-            is = new BufferedInputStream(new FileInputStream(localFileName));
-            int bufferSize = ChunkSize;
-            byte[] buffer = new byte[bufferSize];
+            writeVmdkFileToConnection(conn, httpMethod, urlString, localFileName, totalBytesUpdated, progressUpdater);
+            checkUploadResponse(conn, httpMethod, urlString, localFileName);
+        } finally {
+            conn.disconnect();
+        }
+    }
+
+    private void writeVmdkFileToConnection(HttpURLConnection conn, String httpMethod, String urlString, String localFileName, long totalBytesUpdated,
+            ActionDelegate<Long> progressUpdater) throws IOException {
+        long bytesWrittenThisCall = 0;
+        try (BufferedOutputStream bos = new BufferedOutputStream(conn.getOutputStream());
+             BufferedInputStream is = new BufferedInputStream(new FileInputStream(localFileName))) {
+            byte[] buffer = new byte[ChunkSize];
             while (true) {
-                int bytesRead = is.read(buffer, 0, bufferSize);
+                int bytesRead = is.read(buffer, 0, ChunkSize);
                 if (bytesRead == -1) {
                     break;
                 }
                 bos.write(buffer, 0, bytesRead);
                 totalBytesUpdated += bytesRead;
+                bytesWrittenThisCall += bytesRead;
                 bos.flush();
                 if (progressUpdater != null)
                     progressUpdater.action(new Long(totalBytesUpdated));
             }
             bos.flush();
-        } finally {
-            if (is != null)
-                is.close();
-            if (bos != null)
-                bos.close();
+        } catch (IOException e) {
+            throw new IOException(String.format("Upload of %s to %s %s failed after writing %d of %d bytes for this file " +
+                            "(%d bytes total written so far for this import): %s",
+                    localFileName, httpMethod, urlString, bytesWrittenThisCall, new File(localFileName).length(), totalBytesUpdated, e.getMessage()), e);
+        }
+    }
 
-            conn.disconnect();
+    /**
+     * HttpURLConnection does not surface a failed request just because the client finished writing the
+     * request body without an IOException: with chunked transfer encoding many HTTP servers, including
+     * ESXi's NFC endpoint, read and discard the whole body before responding with an error status (e.g. a
+     * VMFS file lock, an out-of-space datastore, or an authentication/session failure). Silently ignoring
+     * the response code is exactly how a rejected/short write can look like a "successful" upload to
+     * CloudStack. Surface the actual status code, reason phrase and (if any) response body so failures like
+     * "file locked" are visible in the CloudStack logs instead of only in vCenter/ESXi's own logs, if at all.
+     */
+    private void checkUploadResponse(HttpURLConnection conn, String httpMethod, String urlString, String localFileName) throws IOException {
+        int responseCode;
+        try {
+            responseCode = conn.getResponseCode();

Review Comment:
   makes sense, thanks. reading the reply before closing explains the broken copies



##########
test/integration/smoke/test_routers_network_ops.py:
##########
@@ -287,7 +287,7 @@ def test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true(self):
                          )
 
         expected = 1
-        ssh_command = "curl -v -m 1 -o index.html -sL www.google.com"
+        ssh_command = "wget -t 1 -T 5 www.google.com"

Review Comment:
   got it, makes sense as a check that the storage issue is really gone



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5424057146

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5538091175

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5492921094

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6512689758

   Hi @weizhouapache is this ready for testing? @RosiKyu @kiranchavala can you have a look when you have some bandwidth?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5475896012

   thanks @DaanHoogland 
   
   the smoke tests results are consistent with the 4.23.0.0 RC3, I think there is no regression caused by it, we could run together with #13628 
   
   will update the  PR as you suggested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#discussion_r3902962785


##########
vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareContext.java:
##########
@@ -387,25 +388,35 @@ public void uploadFile(String httpMethod, String urlString, String localFileName
         OutputStream out = null;
         InputStream in = null;
         BufferedReader br = null;
+        long bytesWritten = 0;
 
         try {
-            out = conn.getOutputStream();
-            in = new FileInputStream(localFileName);
-            byte[] buf = new byte[ChunkSize];
-            int len = 0;
-            while ((len = in.read(buf)) > 0) {
-                out.write(buf, 0, len);
+            try {

Review Comment:
   done, thanks for review



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5494296434

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "ACSHomeBot (via GitHub) via commits" <co...@cloudstack.apache.org>.
ACSHomeBot commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6553340007

   Accepted: `package kvm G` for `0cb82c3b551d`.
   
   Planned: **RPM + DEB**, **KVM SystemVM**.
   <!-- acshomebot-package-state:20261101T042027Z-30a08885 -->
   Status: **Queued** for **worker G**. Jobs ahead: **0**.
   <!-- /acshomebot-package-state:20261101T042027Z-30a08885 -->
   <!-- acshomebot-package-status:20261101T042027Z-30a08885 -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#discussion_r4219378989


##########
test/integration/smoke/test_routers_network_ops.py:
##########
@@ -287,7 +287,7 @@ def test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true(self):
                          )
 
         expected = 1
-        ssh_command = "curl -v -m 1 -o index.html -sL www.google.com"
+        ssh_command = "wget -t 1 -T 5 www.google.com"

Review Comment:
   if we still see test failures with test_routers_network_ops.py, the issue still exists.
   
   let's wait and see. the Trillian test is still ongoing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#discussion_r3892796900


##########
vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareContext.java:
##########
@@ -387,25 +388,35 @@ public void uploadFile(String httpMethod, String urlString, String localFileName
         OutputStream out = null;
         InputStream in = null;
         BufferedReader br = null;
+        long bytesWritten = 0;
 
         try {
-            out = conn.getOutputStream();
-            in = new FileInputStream(localFileName);
-            byte[] buf = new byte[ChunkSize];
-            int len = 0;
-            while ((len = in.read(buf)) > 0) {
-                out.write(buf, 0, len);
+            try {

Review Comment:
   I would apply the sonarCloud advice here (try-with-resources) but also factor out the method so no try block are nested within a single method



##########
vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareContext.java:
##########
@@ -444,33 +455,88 @@ public void uploadVmdkFile(String httpMethod, String urlString, String localFile
 
         BufferedOutputStream bos = null;
         BufferedInputStream is = null;
+        long bytesWrittenThisCall = 0;
         try {
-            bos = new BufferedOutputStream(conn.getOutputStream());
-            is = new BufferedInputStream(new FileInputStream(localFileName));
-            int bufferSize = ChunkSize;
-            byte[] buffer = new byte[bufferSize];
-            while (true) {
-                int bytesRead = is.read(buffer, 0, bufferSize);
-                if (bytesRead == -1) {
-                    break;
+            try {
+                bos = new BufferedOutputStream(conn.getOutputStream());
+                is = new BufferedInputStream(new FileInputStream(localFileName));
+                int bufferSize = ChunkSize;
+                byte[] buffer = new byte[bufferSize];
+                while (true) {
+                    int bytesRead = is.read(buffer, 0, bufferSize);
+                    if (bytesRead == -1) {
+                        break;
+                    }
+                    bos.write(buffer, 0, bytesRead);
+                    totalBytesUpdated += bytesRead;
+                    bytesWrittenThisCall += bytesRead;
+                    bos.flush();
+                    if (progressUpdater != null)
+                        progressUpdater.action(new Long(totalBytesUpdated));
                 }
-                bos.write(buffer, 0, bytesRead);
-                totalBytesUpdated += bytesRead;
                 bos.flush();
-                if (progressUpdater != null)
-                    progressUpdater.action(new Long(totalBytesUpdated));
+            } catch (IOException e) {
+                throw new IOException(String.format("Upload of %s to %s %s failed after writing %d of %d bytes for this file " +
+                                "(%d bytes total written so far for this import): %s",
+                        localFileName, httpMethod, urlString, bytesWrittenThisCall, new File(localFileName).length(), totalBytesUpdated, e.getMessage()), e);
+            } finally {
+                if (is != null)
+                    is.close();
+                if (bos != null)
+                    bos.close();
             }

Review Comment:
   same here, let’s not have nested try blocks in a single method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5538074643

   
   @blueorangutan test ol8 vmware-80u3
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6033813721

   @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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#discussion_r4219331142


##########
test/integration/smoke/test_routers_network_ops.py:
##########
@@ -287,7 +287,7 @@ def test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true(self):
                          )
 
         expected = 1
-        ssh_command = "curl -v -m 1 -o index.html -sL www.google.com"
+        ssh_command = "wget -t 1 -T 5 www.google.com"

Review Comment:
   wget was originally used, but due to the storage issue, wget was broken while curl still worked. So I switched to curl in PR #8497.
   
   This change switches it back to wget to ensure that the underlying storage issue is finally fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6076330804

   
   @blueorangutan test ol9 vmware-80u3
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6076359274

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "ACSHomeBot (via GitHub) via commits" <co...@cloudstack.apache.org>.
ACSHomeBot commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6551263853

   Accepted: `package kvm G` for `0cb82c3b551d`.
   
   Planned: **RPM + DEB**, **KVM SystemVM**.
   <!-- acshomebot-package-state:20261101T003730Z-d70197fc -->
   Status: **Queued** for **worker G**. Jobs ahead: **0**.
   <!-- /acshomebot-package-state:20261101T003730Z-d70197fc -->
   <!-- acshomebot-package-status:20261101T003730Z-d70197fc -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6055347190

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5494289500

   @blueorangutan test ol8 vmware-80u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5493270217

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5550740509

   <b>[SF] Trillian test result (tid-16901)</b>
   Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol8
   Total time taken: 83312 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13977-t16901-vmware-80u3.zip
   Smoke tests completed. 137 look OK, 4 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | `Error` | 539.45 | test_internal_lb.py
   test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | `Error` | 539.48 | test_internal_lb.py
   test_09_connectivity_between_network_and_vpc_tier | `Error` | 188.45 | test_ipv4_routing.py
   test_deploy_more_vms_than_limit_allows | `Error` | 206.46 | test_deploy_vms_in_parallel.py
   test_01_invalid_upgrade_kubernetes_cluster | `Failure` | 331.31 | test_kubernetes_clusters.py
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 3685.17 | test_kubernetes_clusters.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5423443180

   @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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5424516679

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6136040338

   <b>[SF] Trillian test result (tid-17122)</b>
   Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol8
   Total time taken: 62968 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13977-t17122-vmware-80u3.zip
   Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_03_live_migrate_VM_with_two_data_disks | `Error` | 68.24 | test_vm_life_cycle.py
   test_08_migrate_vm | `Error` | 57.30 | test_vm_life_cycle.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5493259182

   @blueorangutan test ol8 vmware-70u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6119463289

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6055334433

   @blueorangutan test ol9 vmware-80u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "ACSHomeBot (via GitHub) via commits" <co...@cloudstack.apache.org>.
ACSHomeBot commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6553740743

   ### Packaging results:
   
   | Result | Artifact | Platform | Build Time |
   |:--|:--|:--|--:|
   | PASS | RPM | EL (EL8/9/10) | 25 min |
   | PASS | DEB | Ubuntu, Debian | 18 min |
   
   **Test packages are available at:**
   - EL9/RPM: [https://packages.v2kmigrate.com/cloudstack/pr/13977/el9/](https://packages.v2kmigrate.com/cloudstack/pr/13977/el9/index.html)
   - Debian/APT: [https://packages.v2kmigrate.com/cloudstack/pr/13977/debian/](https://packages.v2kmigrate.com/cloudstack/pr/13977/debian/index.html)
   <!-- acshomebot-package-results:20261101T042027Z-30a08885:3 -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub) via commits" <co...@cloudstack.apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6667342342

   @rastopato has also updated https://github.com/apache/cloudstack/discussions/12610#discussioncomment-19425078: 
   ```
   Well, I tried Ubuntu 20.04, 22.04, 24.04 and rhel 9.6.
   But just simple deployment, login and try to run some random commands.
   There was no problem with any of these.
   ```
   
   I think it is good to merge


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "andrijapanicsb (via GitHub) via commits" <co...@cloudstack.apache.org>.
andrijapanicsb commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6552562400

   @ACSHomeBot package G
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub) via commits" <co...@cloudstack.apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6664443551

   test result by @rastopato
   
   
   https://github.com/apache/cloudstack/discussions/12610#discussioncomment-19334001


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5493935321

   <b>[SF] Trillian Build Failed (tid-16863)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5492778079

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13977) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13977&metric=new_coverage&view=list) (required ≥ 40%)  
     
   <!-- sqra:qg_revision=7686f074f0ecbee7e26b348c8337593e05b7b1017c97edaccd1c11a5f4a99fcf -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13977)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5424499049

   @blueorangutan test ol9 vmware-80u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#discussion_r4219331142


##########
test/integration/smoke/test_routers_network_ops.py:
##########
@@ -287,7 +287,7 @@ def test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true(self):
                          )
 
         expected = 1
-        ssh_command = "curl -v -m 1 -o index.html -sL www.google.com"
+        ssh_command = "wget -t 1 -T 5 www.google.com"

Review Comment:
   wget was originally used, but due to the storage issue, wget was broken while curl still worked. So I switched to curl in PR #8497.
   ```
   fix an integration test failure that wget does not work in macchinina vms on vmware80u1
   ```
   
   This change switches it back to wget to ensure that the underlying storage issue is finally fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6102641198

   <b>[SF] Trillian test result (tid-17115)</b>
   Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol9
   Total time taken: 136430 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13977-t17115-vmware-80u3.zip
   Smoke tests completed. 113 look OK, 28 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestClusterDRS>:setup | `Error` | 0.00 | test_cluster_drs.py
   test_CRUD_operations_userdata | `Error` | 1517.48 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata | `Error` | 5.86 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_allow | `Error` | 6.07 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_append | `Error` | 5.88 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_override_policy_deny | `Error` | 5.92 | test_register_userdata.py
   test_deploy_vm_with_registered_userdata_with_params | `Error` | 5.51 | test_register_userdata.py
   test_link_and_unlink_userdata_to_template | `Error` | 5.77 | test_register_userdata.py
   test_user_userdata_crud | `Error` | 5.78 | test_register_userdata.py
   ContextSuite context=TestResetVmOnReboot>:setup | `Error` | 0.00 | test_reset_vm_on_reboot.py
   ContextSuite context=TestRAMCPUResourceAccounting>:setup | `Error` | 0.00 | test_resource_accounting.py
   test_03_register_template | `Error` | 1.09 | test_resource_names.py
   ContextSuite context=TestRestoreVM>:setup | `Error` | 0.00 | test_restore_vm.py
   ContextSuite context=TestRouterDHCPHosts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestRouterDHCPOpts>:setup | `Error` | 0.00 | test_router_dhcphosts.py
   ContextSuite context=TestVolumes>:setup | `Error` | 1512.75 | test_volumes.py
   ContextSuite context=TestRouterDns>:setup | `Error` | 0.00 | test_router_dns.py
   ContextSuite context=TestRouterDnsService>:setup | `Error` | 0.00 | test_router_dnsservice.py
   ContextSuite context=TestRouterIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.py
   ContextSuite context=TestVPCIpTablesPolicies>:setup | `Error` | 0.00 | test_routers_iptables_default_policy.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
   ContextSuite context=TestIsolatedNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRedundantIsolateNetworks>:setup | `Error` | 0.00 | test_routers_network_ops.py
   ContextSuite context=TestRouterServices>:setup | `Error` | 0.00 | test_routers.py
   test_01_scale_vm | `Error` | 1.30 | test_scale_vm.py
   test_02_scale_vm_negative_offering_disable_scaling | `Error` | 1.22 | test_scale_vm.py
   test_03_scale_vm_negative_vm_disable_scaling | `Error` | 1.23 | test_scale_vm.py
   test_04_scale_vm_with_user_account | `Error` | 8.98 | test_scale_vm.py
   test_05_scale_vm_dont_allow_disk_offering_change | `Error` | 1.30 | test_scale_vm.py
   ContextSuite context=TestServiceOfferings>:setup | `Error` | 1513.34 | test_service_offerings.py
   test_04_deploy_vnf_appliance | `Error` | 311.23 | test_vnf_templates.py
   ContextSuite context=TestSetSourceNatIp>:setup | `Error` | 0.00 | test_set_sourcenat.py
   ContextSuite context=TestSnapshotRootDisk>:setup | `Error` | 0.00 | test_snapshots.py
   ContextSuite context=TestSnapshotStandaloneBackup>:setup | `Error` | 0.00 | test_snapshots.py
   test_01_list_sec_storage_vm | `Failure` | 0.03 | test_ssvm.py
   test_03_ssvm_internals | `Failure` | 0.03 | test_ssvm.py
   test_05_stop_ssvm | `Failure` | 0.03 | test_ssvm.py
   test_07_reboot_ssvm | `Failure` | 0.03 | test_ssvm.py
   test_09_reboot_ssvm_forced | `Failure` | 0.04 | test_ssvm.py
   test_11_destroy_ssvm | `Failure` | 0.03 | test_ssvm.py
   ContextSuite context=TestIpv6Vpc>:setup | `Error` | 0.00 | test_vpc_ipv6.py
   ContextSuite context=TestVMWareStoragePolicies>:setup | `Error` | 0.00 | test_storage_policy.py
   test_01_create_template | `Error` | 1.12 | test_templates.py
   test_CreateTemplateWithDuplicateName | `Error` | 149.97 | test_templates.py
   test_02_create_template_with_checksum_sha1 | `Error` | 65.47 | test_templates.py
   test_03_create_template_with_checksum_sha256 | `Error` | 65.46 | test_templates.py
   test_04_create_template_with_checksum_md5 | `Error` | 65.49 | test_templates.py
   test_05_create_template_with_no_checksum | `Error` | 65.45 | test_templates.py
   ContextSuite context=TestTemplates>:setup | `Error` | 145.07 | test_templates.py
   ContextSuite context=TestISOUsage>:setup | `Error` | 0.00 | test_usage.py
   test_01_template_usage | `Error` | 1.13 | test_usage.py
   test_01_volume_usage | `Error` | 74.73 | test_usage.py
   ContextSuite context=TestVAppsVM>:setup | `Error` | 1515.81 | test_vm_life_cycle.py
   test_10_attachAndDetach_iso | `Failure` | 1510.51 | test_vm_life_cycle.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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6119456908

   
   @blueorangutan test ol8 vmware-80u3
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "andrijapanicsb (via GitHub) via commits" <co...@cloudstack.apache.org>.
andrijapanicsb commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6551260108

   @ACShomebot package G


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "ACSHomeBot (via GitHub) via commits" <co...@cloudstack.apache.org>.
ACSHomeBot commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6552568692

   Accepted: `package kvm G` for `0cb82c3b551d`.
   
   Planned: **RPM + DEB**, **KVM SystemVM**.
   <!-- acshomebot-package-state:20261101T025442Z-ed9fd6a0 -->
   Status: **Queued** for **worker G**. Jobs ahead: **0**.
   <!-- /acshomebot-package-state:20261101T025442Z-ed9fd6a0 -->
   <!-- acshomebot-package-status:20261101T025442Z-ed9fd6a0 -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6033783008

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6034660174

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13977) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13977&metric=new_coverage&view=list) (required ≥ 40%)  
     
   <!-- sqra:qg_revision=7686f074f0ecbee7e26b348c8337593e05b7b1017c97edaccd1c11a5f4a99fcf -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13977)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5439800947

   <b>[SF] Trillian Build Failed (tid-16833)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5469914546

   <b>[SF] Trillian test result (tid-16846)</b>
   Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol9
   Total time taken: 76722 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13977-t16846-vmware-80u3.zip
   Smoke tests completed. 136 look OK, 5 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_DeployVmAntiAffinityGroup_in_project | `Error` | 145.95 | test_affinity_groups_projects.py
   test_DeployVmAntiAffinityGroup | `Error` | 62.40 | test_affinity_groups.py
   test_03_deploy_and_scale_kubernetes_cluster | `Failure` | 44.16 | test_kubernetes_clusters.py
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 0.09 | test_kubernetes_clusters.py
   test_01_non_strict_host_anti_affinity | `Failure` | 182.45 | test_nonstrict_affinity_group.py
   test_02_non_strict_host_affinity | `Error` | 105.52 | test_nonstrict_affinity_group.py
   ContextSuite context=TestMigrateVMStrictTags>:setup | `Error` | 0.00 | test_vm_strict_host_tags.py
   test_01_restore_vm_strict_tags_success | `Error` | 3605.57 | test_vm_strict_host_tags.py
   test_02_restore_vm_strict_tags_failure | `Error` | 9.03 | test_vm_strict_host_tags.py
   test_01_scale_vm_strict_tags_success | `Error` | 18.05 | test_vm_strict_host_tags.py
   test_02_scale_vm_strict_tags_failure | `Error` | 3604.19 | test_vm_strict_host_tags.py
   test_01_deploy_vm_on_specific_host_without_strict_tags | `Error` | 17.07 | test_vm_strict_host_tags.py
   test_02_deploy_vm_on_any_host_without_strict_tags | `Error` | 3605.73 | test_vm_strict_host_tags.py
   test_03_deploy_vm_on_specific_host_with_strict_tags_success | `Error` | 3.89 | test_vm_strict_host_tags.py
   test_04_deploy_vm_on_any_host_with_strict_tags_success | `Error` | 5.78 | test_vm_strict_host_tags.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5495009764

   <b>[SF] Trillian Build Failed (tid-16867)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-5424115577

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13977) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13977&metric=new_coverage&view=list) (required ≥ 40%)  
     
   <!-- sqra:qg_revision=320c8f42b16c056bbf10fec3371440fa771938c809a12e7ff7fbf294ef07e8a1 -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13977)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#discussion_r4219274841


##########
test/integration/smoke/test_routers_network_ops.py:
##########
@@ -287,7 +287,7 @@ def test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true(self):
                          )
 
         expected = 1
-        ssh_command = "curl -v -m 1 -o index.html -sL www.google.com"
+        ssh_command = "wget -t 1 -T 5 www.google.com"

Review Comment:
   is the switch from curl to wget in these router tests part of this fix? looks unrelated to the template copy



##########
vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareContext.java:
##########
@@ -442,32 +443,82 @@ public void uploadVmdkFile(String httpMethod, String urlString, String localFile
         conn.setRequestProperty("content-length", Long.toString(new File(localFileName).length()));
         connectWithRetry(conn);
 
-        BufferedOutputStream bos = null;
-        BufferedInputStream is = null;
         try {
-            bos = new BufferedOutputStream(conn.getOutputStream());
-            is = new BufferedInputStream(new FileInputStream(localFileName));
-            int bufferSize = ChunkSize;
-            byte[] buffer = new byte[bufferSize];
+            writeVmdkFileToConnection(conn, httpMethod, urlString, localFileName, totalBytesUpdated, progressUpdater);
+            checkUploadResponse(conn, httpMethod, urlString, localFileName);
+        } finally {
+            conn.disconnect();
+        }
+    }
+
+    private void writeVmdkFileToConnection(HttpURLConnection conn, String httpMethod, String urlString, String localFileName, long totalBytesUpdated,
+            ActionDelegate<Long> progressUpdater) throws IOException {
+        long bytesWrittenThisCall = 0;
+        try (BufferedOutputStream bos = new BufferedOutputStream(conn.getOutputStream());
+             BufferedInputStream is = new BufferedInputStream(new FileInputStream(localFileName))) {
+            byte[] buffer = new byte[ChunkSize];
             while (true) {
-                int bytesRead = is.read(buffer, 0, bufferSize);
+                int bytesRead = is.read(buffer, 0, ChunkSize);
                 if (bytesRead == -1) {
                     break;
                 }
                 bos.write(buffer, 0, bytesRead);
                 totalBytesUpdated += bytesRead;
+                bytesWrittenThisCall += bytesRead;
                 bos.flush();
                 if (progressUpdater != null)
                     progressUpdater.action(new Long(totalBytesUpdated));
             }
             bos.flush();
-        } finally {
-            if (is != null)
-                is.close();
-            if (bos != null)
-                bos.close();
+        } catch (IOException e) {
+            throw new IOException(String.format("Upload of %s to %s %s failed after writing %d of %d bytes for this file " +
+                            "(%d bytes total written so far for this import): %s",
+                    localFileName, httpMethod, urlString, bytesWrittenThisCall, new File(localFileName).length(), totalBytesUpdated, e.getMessage()), e);
+        }
+    }
 
-            conn.disconnect();
+    /**
+     * HttpURLConnection does not surface a failed request just because the client finished writing the
+     * request body without an IOException: with chunked transfer encoding many HTTP servers, including
+     * ESXi's NFC endpoint, read and discard the whole body before responding with an error status (e.g. a
+     * VMFS file lock, an out-of-space datastore, or an authentication/session failure). Silently ignoring
+     * the response code is exactly how a rejected/short write can look like a "successful" upload to
+     * CloudStack. Surface the actual status code, reason phrase and (if any) response body so failures like
+     * "file locked" are visible in the CloudStack logs instead of only in vCenter/ESXi's own logs, if at all.
+     */
+    private void checkUploadResponse(HttpURLConnection conn, String httpMethod, String urlString, String localFileName) throws IOException {
+        int responseCode;
+        try {
+            responseCode = conn.getResponseCode();

Review Comment:
   is waiting for this response the actual fix? before, the connection was closed without reading it, so esxi may not have finished the copy



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6073953512

   <b>[SF] Trillian test result (tid-17096)</b>
   Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol9
   Total time taken: 69177 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13977-t17096-vmware-80u3.zip
   Smoke tests completed. 133 look OK, 8 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_native_to_native_network_migration | `Error` | 53.60 | test_migration.py
   test_02_native_to_native_vpc_migration | `Error` | 20.06 | test_migration.py
   test_nic_secondaryip_add_remove | `Error` | 24.74 | test_multipleips_per_nic.py
   test_nested_virtualization_vmware | `Error` | 25.43 | test_nested_virtualization.py
   test_network_acl | `Error` | 8.36 | test_network_acl.py
   test_01_verify_ipv6_network | `Error` | 20.94 | test_network_ipv6.py
   test_01_verify_ipv6_network | `Error` | 20.94 | test_network_ipv6.py
   test_03_network_operations_on_created_vm_of_otheruser | `Error` | 2.61 | test_network_permissions.py
   test_03_network_operations_on_created_vm_of_otheruser | `Error` | 2.61 | test_network_permissions.py
   test_04_deploy_vm_for_other_user_and_test_vm_operations | `Failure` | 1.38 | test_network_permissions.py
   ContextSuite context=TestNetworkPermissions>:teardown | `Error` | 1.45 | test_network_permissions.py
   test_delete_account | `Error` | 23.13 | test_network.py
   test_delete_network_while_vm_on_it | `Error` | 2.63 | test_network.py
   test_delete_network_while_vm_on_it | `Error` | 2.63 | test_network.py
   test_deploy_vm_l2network | `Error` | 2.64 | test_network.py
   test_deploy_vm_l2network | `Error` | 2.64 | test_network.py
   test_l2network_restart | `Error` | 3.76 | test_network.py
   test_l2network_restart | `Error` | 3.76 | test_network.py
   ContextSuite context=TestL2Networks>:teardown | `Error` | 4.88 | test_network.py
   ContextSuite context=TestPortForwarding>:setup | `Error` | 13.68 | test_network.py
   ContextSuite context=TestPublicIP>:setup | `Error` | 13.39 | test_network.py
   test_reboot_router | `Error` | 7.62 | test_network.py
   test_releaseIP | `Error` | 7.49 | test_network.py
   test_releaseIP_using_IP | `Error` | 7.47 | test_network.py
   ContextSuite context=TestRouterRules>:setup | `Error` | 14.70 | test_network.py
   test_01_deployVMInSharedNetwork | `Failure` | 1.29 | test_network.py
   test_02_verifyRouterIpAfterNetworkRestart | `Failure` | 1.09 | test_network.py
   test_03_destroySharedNetwork | `Failure` | 1.10 | test_network.py
   ContextSuite context=TestSharedNetwork>:teardown | `Error` | 2.20 | test_network.py
   test_01_deployVMInSharedNetwork | `Failure` | 1.35 | test_network.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:teardown | `Error` | 2.43 | test_network.py
   test_10_reboot_cpvm_forced | `Error` | 17.56 | test_ssvm.py
   test_12_destroy_cpvm | `Error` | 7.29 | test_ssvm.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977#issuecomment-6076327898

   > [SF] Trillian test result (tid-17096) Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol9 Total time taken: 69177 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13977-t17096-vmware-80u3.zip Smoke tests completed. 133 look OK, 8 have errors, 0 did not run Only failed and skipped tests results shown below:
   
   Although there are lots of errors, the test `test_routers_network_ops` passed without any issue
   
   ```
   pr13977-t17096-vmware-80u3/MarvinLogs/test_routers_network_ops_TZIU9G # cat results.txt 
   Test redundant router internals ... === TestName: test_01_isolate_network_FW_PF_default_routes_egress_true | Status : SUCCESS ===
   ok
   Test redundant router internals ... === TestName: test_02_isolate_network_FW_PF_default_routes_egress_false | Status : SUCCESS ===
   ok
   Test redundant router internals ... === TestName: test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true | Status : SUCCESS ===
   ok
   Test redundant router internals ... === TestName: test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false | Status : SUCCESS ===
   ok
   Test redundant router internals ... === TestName: test_03_RVR_Network_check_router_state | Status : SUCCESS ===
   ok
   
   ----------------------------------------------------------------------
   Ran 5 tests in 1312.511s
   
   OK
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] vmware-base: fix template copy from secondary to primary [cloudstack]

Posted by "weizhouapache (via GitHub) via commits" <co...@cloudstack.apache.org>.
weizhouapache merged PR #13977:
URL: https://github.com/apache/cloudstack/pull/13977


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org