GutoVeronezi opened a new pull request #5067:
URL: https://github.com/apache/cloudstack/pull/5067
### Description
In ACS, there are two ways to migrate a volume between storages:
- migrating only the volume (`migrateVolume`);
- migrating a VM with volume (`migrateVirtualMachineWithVolume`);
Both, although are in differents flows, work similarly: they create a new
volume in the destination storage and then delete the old volume in the source
storage; When we delete the old volume, we also delete the volume policies
(snapshot scheduling).
Therefore, the new volume will not have the snapshot schedules and we will
lose this information. This PR intends to copy the policies from source to
destination volume before deleting the old volume;
### 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
### How Has This Been Tested?
It has been tested locally in a test lab.
1. I created a VM;
2. I configured snapshot schedules in the volume;
3. I migrated :
- volume (with `migrateVolume`);
- VM and volume (with `migrateVirtualMachineWithVolume`);
4. I checked if the policies were copied to new volume;
-- After applying this patch, the policies were copied.
Also, I created Java unit tests for the methods I changed.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]