You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/12/01 04:54:18 UTC

[GitHub] [cloudstack] sureshanaparti opened a new pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

sureshanaparti opened a new pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735


   ### Description
   
   This PR improves the volume file search on the datastore while computing the VM snapshot chain size in VMware. The file search is now performed in the VM directory on the datastore, instead of all the directories on the datastore (which is leading to incorrect VM snapshot chain size computation when VM id has 6 digits).
   
   <!--- 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: AUTOMATATION 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)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] 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 -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   Manually tested create and delete VM snapshot operations in VMware, with 6 digit VM ids (set the VM instance sequence manually using the sql: "UPDATE cloud.sequence SET value = 1000000 WHERE name = ‘vm_instance_seq’").
   
   - After Create Snapshot:
   
   ```
   MariaDB [cloud]> SELECT vol.id as volume_id, vol.uuid as volume_uuid, vol.name, vol.volume_type, vol.state, vol.path, vol.size, vol.vm_snapshot_chain_size, vol.chain_info, vol.instance_id, vm.instance_name as instance_name, vm.name as vm_name FROM volumes vol, vm_instance vm WHERE vol.instance_id = vm.id AND vm.id >= 100000;
   +-----------+--------------------------------------+-------------+-------------+-------+----------------------------------+------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+---------------+---------+
   | volume_id | volume_uuid                          | name        | volume_type | state | path                             | size       | vm_snapshot_chain_size | chain_info                                                                                                                                                                                                                   | instance_id | instance_name | vm_name |
   +-----------+--------------------------------------+-------------+-------------+-------+----------------------------------+------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+---------------+---------+
   
   |         6 | 61c4cfa4-33b1-4787-a48f-12167433a404 | ROOT-100001 | ROOT        | Ready | ROOT-000001                             | 2147483648 |              167801095 | {"diskDeviceBusName":"ide0:1","diskChain":["[50da2bc6a157338088dbbf52748b14cf] i-2-100001-VM/ROOT-100001.vmdk","[50da2bc6a157338088dbbf52748b14cf] 16dbb68180af34b5a9589699216e6c75/16dbb68180af34b5a9589699216e6c75.vmdk"]} |      100001 | i-2-100001-VM | vm03    |
   |         7 | 483c4533-f8fd-45f2-8b8c-6d3aa4338564 | DATA-100001 | DATADISK    | Ready | 1b0ea534ebcf4ea6b22053ae608c876a-000001 | 3221225472 |             3221225472 | {"diskDeviceBusName":"scsi0:0","diskChain":["[50da2bc6a157338088dbbf52748b14cf] i-2-100001-VM/1b0ea534ebcf4ea6b22053ae608c876a.vmdk"]}                                                                                       |      100001 | i-2-100001-VM | vm03    |
   
   
   +-----------+--------------------------------------+-------------+-------------+-------+----------------------------------+------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+---------------+---------+
   
   ```
   
   - After Delete Snapshot:
   
   ```
   MariaDB [cloud]> SELECT vol.id as volume_id, vol.uuid as volume_uuid, vol.name, vol.volume_type, vol.state, vol.path, vol.size, vol.vm_snapshot_chain_size, vol.chain_info, vol.instance_id, vm.instance_name as instance_name, vm.name as vm_name FROM volumes vol, vm_instance vm WHERE vol.instance_id = vm.id AND vm.id >= 100000;
   +-----------+--------------------------------------+-------------+-------------+-------+----------------------------------+------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+---------------+---------+
   | volume_id | volume_uuid                          | name        | volume_type | state | path                             | size       | vm_snapshot_chain_size | chain_info                                                                                                                                                                                                                   | instance_id | instance_name | vm_name |
   +-----------+--------------------------------------+-------------+-------------+-------+----------------------------------+------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+---------------+---------+
   
   |         6 | 61c4cfa4-33b1-4787-a48f-12167433a404 | ROOT-100001 | ROOT        | Ready | ROOT-100001                      | 2147483648 |                      0 | {"diskDeviceBusName":"ide0:1","diskChain":["[50da2bc6a157338088dbbf52748b14cf] i-2-100001-VM/ROOT-100001.vmdk","[50da2bc6a157338088dbbf52748b14cf] 16dbb68180af34b5a9589699216e6c75/16dbb68180af34b5a9589699216e6c75.vmdk"]} |      100001 | i-2-100001-VM | vm03    |
   |         7 | 483c4533-f8fd-45f2-8b8c-6d3aa4338564 | DATA-100001 | DATADISK    | Ready | 1b0ea534ebcf4ea6b22053ae608c876a | 3221225472 |                      0 | {"diskDeviceBusName":"scsi0:0","diskChain":["[50da2bc6a157338088dbbf52748b14cf] i-2-100001-VM/1b0ea534ebcf4ea6b22053ae608c876a.vmdk"]}                                                                                       |      100001 | i-2-100001-VM | vm03    |
   
   
   +-----------+--------------------------------------+-------------+-------------+-------+----------------------------------+------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+---------------+---------+
   
   ```
   
   
   <!-- 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



[GitHub] [cloudstack] blueorangutan commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-984385497


   @sureshanaparti a Jenkins job has been kicked to build packages. 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



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#discussion_r759871333



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
##########
@@ -1306,12 +1307,12 @@ private void setVolumeToPathAndSize(List<VolumeObjectTO> volumeTOs, Map<String,
             // get volume's chain size for this VM snapshot; exclude current volume vdisk
             DataStoreTO store = volumeTO.getDataStore();
             ManagedObjectReference morDs = getDatastoreAsManagedObjectReference(baseName, hyperHost, store);
-            long size = getVMSnapshotChainSize(context, hyperHost, baseName + ".vmdk", morDs, newPath);
-            size = getVMSnapshotChainSize(context, hyperHost, baseName + "-*.vmdk", morDs, newPath);
+            long size = getVMSnapshotChainSize(context, hyperHost, baseName + ".vmdk", morDs, newPath, vmName);

Review comment:
       yes @Pearl1594, already created a separate PR (https://github.com/apache/cloudstack/pull/5720) to remove the redundant call.




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



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#discussion_r759871333



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
##########
@@ -1306,12 +1307,12 @@ private void setVolumeToPathAndSize(List<VolumeObjectTO> volumeTOs, Map<String,
             // get volume's chain size for this VM snapshot; exclude current volume vdisk
             DataStoreTO store = volumeTO.getDataStore();
             ManagedObjectReference morDs = getDatastoreAsManagedObjectReference(baseName, hyperHost, store);
-            long size = getVMSnapshotChainSize(context, hyperHost, baseName + ".vmdk", morDs, newPath);
-            size = getVMSnapshotChainSize(context, hyperHost, baseName + "-*.vmdk", morDs, newPath);
+            long size = getVMSnapshotChainSize(context, hyperHost, baseName + ".vmdk", morDs, newPath, vmName);

Review comment:
       yes @Pearl1594, already created a separate PR (https://github.com/apache/cloudstack/pull/5720).




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



[GitHub] [cloudstack] blueorangutan commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-983288698


   @sureshanaparti a Jenkins job has been kicked to build packages. 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



[GitHub] [cloudstack] andrijapanicsb commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
andrijapanicsb commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-1042962594


   @sureshanaparti does this handle detached volumes well? Afaik, the detached volumes are moved to a different folder than the folder where the VM is located (but, I might be wrong if this has changed recently).


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



[GitHub] [cloudstack] blueorangutan commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-984422390


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1817


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



[GitHub] [cloudstack] blueorangutan commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-984944373


   <b>Trillian test result (tid-2604)</b>
   Environment: vmware-70u1 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 33999 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5735-t2604-vmware-70u1.zip
   Smoke tests completed. 91 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


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



[GitHub] [cloudstack] blueorangutan commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-983308280


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1806


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



[GitHub] [cloudstack] sureshanaparti commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-983310834


   @blueorangutan test centos7 vmware-67u3


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



[GitHub] [cloudstack] rhtyd merged pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
rhtyd merged pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735


   


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



[GitHub] [cloudstack] sureshanaparti commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-984385077


   @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



[GitHub] [cloudstack] blueorangutan commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-984464678


   @rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-70u1) 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



[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on a change in pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#discussion_r759862766



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
##########
@@ -1306,12 +1307,12 @@ private void setVolumeToPathAndSize(List<VolumeObjectTO> volumeTOs, Map<String,
             // get volume's chain size for this VM snapshot; exclude current volume vdisk
             DataStoreTO store = volumeTO.getDataStore();
             ManagedObjectReference morDs = getDatastoreAsManagedObjectReference(baseName, hyperHost, store);
-            long size = getVMSnapshotChainSize(context, hyperHost, baseName + ".vmdk", morDs, newPath);
-            size = getVMSnapshotChainSize(context, hyperHost, baseName + "-*.vmdk", morDs, newPath);
+            long size = getVMSnapshotChainSize(context, hyperHost, baseName + ".vmdk", morDs, newPath, vmName);

Review comment:
       shouldn't this call be removed @sureshanaparti?




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



[GitHub] [cloudstack] blueorangutan commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-983756562


   <b>Trillian test result (tid-2597)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 33682 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5735-t2597-vmware-67u3.zip
   Smoke tests completed. 91 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


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



[GitHub] [cloudstack] sureshanaparti commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-983288334


   @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



[GitHub] [cloudstack] blueorangutan commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-983311434


   @sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) 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



[GitHub] [cloudstack] rhtyd commented on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-984463832


   @blueorangutan test centos7 vmware-70u1


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



[GitHub] [cloudstack] andrijapanicsb removed a comment on pull request #5735: [VMware] Improve volume file search on the datastore while computing the VM snapshot chain size.

Posted by GitBox <gi...@apache.org>.
andrijapanicsb removed a comment on pull request #5735:
URL: https://github.com/apache/cloudstack/pull/5735#issuecomment-1042962594


   @sureshanaparti does this handle detached volumes well? Afaik, the detached volumes are moved to a different folder than the folder where the VM is located (but, I might be wrong if this has changed recently).


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