mlsorensen opened a new pull request, #7453: URL: https://github.com/apache/cloudstack/pull/7453
### Description This PR fixes live local storage migration for VMs created with "Direct Download" images. Currently, the local storage driver has no special handling for direct download templates during live storage migration. The workflow is something like 1) check to see if root volume's backing template exists on destination primary storage 2) if not, then send a CopyCommand to copy template to destination storage 3) create new destination volume on destination primary storage against the backing template. 4) send destination volume info during MigrateCommand so we can rewrite the volume path in the VM XML during migration 5) migrate VM. In step 2 - CopyCommand is not the right thing to do for putting a "Direct Download" template onto primary storage, it should instead be a type of DirectDownloadCommand. Additionally, Direct Downloads don't use the template ID as the name of the template file on primary, they use a dynamically generated name, so the template paths are different between source and destination pools. Thus we need to pass the new template path along in MigrateCommand so we can replace this backing store path in the VM XML during live migration. This patch updates the KvmNonManagedStorageDataMotionStrategy used during local storage migration to handle staging of DirectDownload templates via a DirectDownloadCommand instead of a CopyCommand, and also provides the backing store path and relevant XML substitution during MigrateCommand handling. Additional testing would be appreciated for workflows involving the KVMNonManagedStorageDataMotionStrategy, though I suspect the scope is fairly limited to live storage migration of Filesystem and NFS storage types. Since this class extends the StorageSystemDataMotionStrategy, some minor changes were made to it as well but nothing that should change its behavior. I haven't tested migration of Direct Download VMs while stopped yet, that may need a separate/similar PR. ### 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) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [x] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [x] Major - [ ] Minor - [ ] Trivial ### How Has This Been Tested? Tested in local virtual environment with local storage KVM hypervisors, first reproduced the problem and then fixed it. <!-- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
