-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix export snapshot and template to secondary storage to export only required disk #5510
Conversation
…e to export only one required disk
if (vmDisks.length != 1) { | ||
String baseName = VmwareHelper.getDiskDeviceFileName(requiredDisk); | ||
s_logger.info(String.format("Detaching all disks for the cloned VM: %s except disk with base name: %s, key=%d", clonedVm.getName(), baseName, requiredDisk.getKey())); | ||
clonedVm.detachAllDisksExcept(VmwareHelper.getDiskDeviceFileName(requiredDisk), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to include this process, as part of creating full clone with specific disk (which ensures it detaches/destroys the additional disks), instead checking this separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to keep it in same method. Thanks Suresh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the process to virtualMachineMO class.
@harikrishna-patnala does the sdk/api behave differently in different vmware versions? |
Ideally it should not differ, I'll test all versions. |
This needs a manual test confirmation cc @borisstoyanov @vladimirpetrov @NuxRo thanks |
ea5999b
to
874b5a3
Compare
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
Outdated
Show resolved
Hide resolved
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
Outdated
Show resolved
Hide resolved
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, manually tested it.
@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
Trillian test result (tid-2239)
|
@blueorangutan test centos7 vmware-67u3 |
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests |
Trillian test result (tid-2243)
|
Edit: smoke test failure also seen on the health checks PR, merging this PR - test needs fixing on stabilisation phase |
…required disk (apache#5510) * Fix export snapshot and export template to secondary storage in VMware to export only one required disk * Move clone operation into virtual machine mo * Code refactored for readability * Added disk key check even for successful clone operation * Delete dettached disks from cloned VM and added few logs
…required disk (apache#5510) * Fix export snapshot and export template to secondary storage in VMware to export only one required disk * Move clone operation into virtual machine mo * Code refactored for readability * Added disk key check even for successful clone operation * Delete dettached disks from cloned VM and added few logs (cherry picked from commit df0c004) Signed-off-by: Rohit Yadav <[email protected]>
…required disk (apache#5510) * Fix export snapshot and export template to secondary storage in VMware to export only one required disk * Move clone operation into virtual machine mo * Code refactored for readability * Added disk key check even for successful clone operation * Delete dettached disks from cloned VM and added few logs (cherry picked from commit df0c004) Signed-off-by: Rohit Yadav <[email protected]>
Description
This PR fixes issue #5498 where multiple volumes of a VM are exported to secondary storage upon taking snapshot of a single volume in case of VMware
Fixes: #5498
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?