sudo87 opened a new pull request, #11541: URL: https://github.com/apache/cloudstack/pull/11541
### Description CS creates transient KVM domain.xml. When instance is unmanaged from CS, explicit dump of domain has to be taken to manage is outside of CS. With this PR - domainXML gets backed up and becomes persistent for further management of Instance. - Stopped instance also can be unmanaged, last host for instance is considered for defining domain - hostid param is supported in unmanageVirtualMachine API for KVM hypervisor and for stopped Instances - hostid field in response of unmanageVirtualMachine, representing host used for unmanage operation - Disable unmanaging instance with config drive, use forced param from API for KVM Doc PR: https://github.com/apache/cloudstack-documentation/pull/562 <!--- 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: AUTOMATION 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) - [ ] build/CI - [ ] test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate):  In above screenshot, "i-2-3-VM" is no longer managed by CS and is brought down. It is still listed in response of: ```virsh list --all``` API payload and response:  ### How Has This Been Tested? #### For Running Instance: 1. Created an instance and verified listing it using 'virsh list --all' 2. Unmanage the instance, xml is found in "/etc/libvirt/qemu" directory (persistent domains location) 3. Brought that instance down with 'virsh destory <vmName>' 4. It is seen in response of 'virsh list --all' 5. Imported KVM instance in the CS to manage #### For Stopped Instance: 1. Created an instance and verified listing it using 'virsh list --all' 2. Stop the VM, confirm that domain disappears with virsh 3. Unmanage the instance, xml gets registered in "/etc/libvirt/qemu" directory (persistent domains location) 4. Start the instance with 'virsh start <vmName>' 6. Import KVM instance in the CS to manage <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> #### How did you try to break this feature and the system with this change? <!-- see how your change affects other areas of the code, etc. --> <!-- 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]
