sureshanaparti opened a new pull request, #10045:
URL: https://github.com/apache/cloudstack/pull/10045
### Description
This PR allows config drive deletion of migrated VM, on host maintenance
(from it's last source location - host cache/primary/secondary storage).
Fixes below issues identified during host maintenance tests, with VM using
config drive on KVM host cache.
1. Old config drive location is overriden in the VM detail, while creating
the new one during the migration (config drive location would change here, in
case any of the location settings updated after VM is created -
vm.configdrive.force.host.cache.use, vm.configdrive.primarypool.enabled,
vm.configdrive.use.host.cache.on.unsupported.pool). If so, the rollback or post
migration tries to delete the config drive from the new/overriden location in
the source host after migration, where the file doesn't exists.
1. Delete config drive command HandleConfigDriveIsoCommand is not allowed
when host is in maintenance.
```
2024-12-04 07:36:10,315 DEBUG [c.c.n.e.ConfigDriveNetworkElement]
(Work-Job-Executor-10:ctx-fabb0d27 job-58/job-60 ctx-43e67e9c) (logid:332edac0)
Deleting config drive ISO for vm: i-2-6-VM on host: 1
2024-12-04 07:36:10,318 WARN [c.c.a.m.AgentManagerImpl]
(Work-Job-Executor-10:ctx-fabb0d27 job-58/job-60 ctx-43e67e9c) (logid:332edac0)
Resource [Host:1] is unreachable: Host 1: Unable to send class
com.cloud.agent.api.HandleConfigDriveIsoCommand because agent ol8.localdomain
is in maintenance mode
2024-12-04 07:36:10,319 ERROR [c.c.v.VmWorkJobHandlerProxy]
(Work-Job-Executor-10:ctx-fabb0d27 job-58/job-60 ctx-43e67e9c) (logid:332edac0)
Invocation exception, caused by:
com.cloud.utils.exception.CloudRuntimeException: Unable to get an answer to
handle config drive deletion for vm: i-2-6-VM on host: 1
2024-12-04 07:36:10,319 INFO [c.c.v.VmWorkJobHandlerProxy]
(Work-Job-Executor-10:ctx-fabb0d27 job-58/job-60 ctx-43e67e9c) (logid:332edac0)
Rethrow exception com.cloud.utils.exception.CloudRuntimeException: Unable to
get an answer to handle config drive deletion for vm: i-2-6-VM on host: 1
2024-12-04 07:36:10,319 DEBUG [c.c.v.VmWorkJobDispatcher]
(Work-Job-Executor-10:ctx-fabb0d27 job-58/job-60) (logid:332edac0) Done with
run of VM work job: com.cloud.vm.VmWorkMigrateAway for VM 6, job origin: 58
2024-12-04 07:36:10,319 ERROR [c.c.v.VmWorkJobDispatcher]
(Work-Job-Executor-10:ctx-fabb0d27 job-58/job-60) (logid:332edac0) Unable to
complete AsyncJobVO: {id:60, userId: 1, accountId: 1, instanceType: null,
instanceId: null, cmd: com.cloud.vm.VmWorkMigrateAway, cmdInfo:
rO0ABXNyAB5jb20uY2xvdWQudm0uVm1Xb3JrTWlncmF0ZUF3YXmt4MX4jtcEmwIAAUoACXNyY0hvc3RJZHhyABNjb20uY2xvdWQudm0uVm1Xb3Jrn5m2VvAlZ2sCAARKAAlhY2NvdW50SWRKAAZ1c2VySWRKAAR2bUlkTAALaGFuZGxlck5hbWV0ABJMamF2YS9sYW5nL1N0cmluZzt4cAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABnQAGVZpcnR1YWxNYWNoaW5lTWFuYWdlckltcGwAAAAAAAAAAQ,
cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result:
null, initMsid: 32986187695067, completeMsid: null, lastUpdated: null,
lastPolled: null, created: Wed Dec 04 07:36:04 UTC 2024, removed: null}, job
origin:58
com.cloud.utils.exception.CloudRuntimeException: Unable to get an answer to
handle config drive deletion for vm: i-2-6-VM on host: 1
at
com.cloud.network.element.ConfigDriveNetworkElement.deleteConfigDriveIsoOnHostCache(ConfigDriveNetworkElement.java:585)
at
com.cloud.network.element.ConfigDriveNetworkElement.commitMigration(ConfigDriveNetworkElement.java:379)
at
org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.commitNicForMigration(NetworkOrchestrator.java:2264)
at
com.cloud.vm.VirtualMachineManagerImpl.migrate(VirtualMachineManagerImpl.java:2904)
at
com.cloud.vm.VirtualMachineManagerImpl.orchestrateMigrateAway(VirtualMachineManagerImpl.java:3488)
at
com.cloud.vm.VirtualMachineManagerImpl.orchestrateMigrateAway(VirtualMachineManagerImpl.java:5535)
```
<!--- 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)
- [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)
- [ ] build/CI
- [ ] test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
Manually tested maintenance on host having some running VMs with config
drive on host cache and secondary. Running VMs are migrated to other available
hosts and old config drive is removed.
<!-- 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]