atrocitytheme opened a new pull request #5216: URL: https://github.com/apache/cloudstack/pull/5216
### Description This PR is a GSoC project #4818 This PR adds a full clone feature to the API level, where a fully cloned virtual machine will be created with root disk, data disk, and system configuration the same as the original VM. Feature included: 1. the creation of temporary snapshots during the clone for both root and data disks 2. creation of template from the root disk 3. newly copied data disk attachments to the new VM 4. cleanup of temporary resources and error handling of the full clone process 5. A new CloneVmCmd API interface to use this feature 6. Automatic assignment of new network resources for the new Cloned VM ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] New feature (non-breaking change which adds functionality) - [ ] 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 - [x] 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 --> <!-- see how your change affects other areas of the code, etc. --> This has been manually tested with a mbx KVM setup on a local machine and mbx kvm setup on GCP - This feature has been tested on local Linux system with kvm support (5.3.0-64-generic Ubuntu) and Google Cloud instance (4.9.0-15-amd64 Debian) - Try with cloudmonkey if the management server are running with default configurations. ``` cloneVirtualMachine virtualmachineid=<target_vm_id> ``` will start the clone process, it'll create a new cloned VM and start it (with all copied data available), network Ip will be assigned to DB instantly and the actual VM will get this IP after a while - When secondary system VM agents are not available, the cloning process will fail and clean the previously cloned resources - It'll copy all the data disk content from the target VM no matter whether the data disks are mounted in the VM system or the VM is running - Temporary resources created (snapshots) during the process will not remain whether the clone succeeds or not <!-- 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]
