Pearl1594 opened a new pull request #4907:
URL: https://github.com/apache/cloudstack/pull/4907
### Description
This PR adds a force flag to the attachIso / detachIso commands, especially
for VMware where it is noticed that when trying to either detach an iso or
attach an iso when there already exists another present it fails to do the
necessary operation as from ACS end we either answer the question returned by
Esxi for CDRom disconnect operation as No (for detach operation) or do not
answer the question at all (for Attach operation), thus leading to the
following exception:
```
2021-04-12 05:32:41,367 ERROR [c.c.s.r.VmwareStorageProcessor]
(DirectAgent-62:ctx-3f28a2a0 10.0.32.174, job-564, cmd: AttachCommand)
(logid:5d45a935) AttachIsoCommand(attach) failed due to Exception:
java.lang.RuntimeException
Message: Connection control operation failed for disk 'ide0:0'.
Also check if your guest os is a supported version
java.lang.RuntimeException: Connection control operation failed for disk
'ide0:0'.
at
com.cloud.hypervisor.vmware.util.VmwareClient.waitForTask(VmwareClient.java:424)
at
com.cloud.hypervisor.vmware.mo.VirtualMachineMO.attachIso(VirtualMachineMO.java:1625)
at
com.cloud.hypervisor.vmware.mo.VirtualMachineMO.attachIso(VirtualMachineMO.java:1564)
at
com.cloud.storage.resource.VmwareStorageProcessor.attachIso(VmwareStorageProcessor.java:2472)
at
com.cloud.storage.resource.VmwareStorageProcessor.attachIso(VmwareStorageProcessor.java:2048)
at
com.cloud.storage.resource.StorageSubsystemCommandHandlerBase.execute(StorageSubsystemCommandHandlerBase.java:156)
at
com.cloud.storage.resource.StorageSubsystemCommandHandlerBase.handleStorageCommands(StorageSubsystemCommandHandlerBase.java:64)
at
com.cloud.hypervisor.vmware.resource.VmwareResource.executeRequest(VmwareResource.java:566)
at
com.cloud.agent.manager.DirectAgentAttache$Task.runInContext(DirectAgentAttache.java:315)
at
org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:48)
at
org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55)
at
org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:102)
at
org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52)
at
org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:45)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
```
<!---
*********************************************************************************
-->
<!--- NOTE: AUTOMATATION 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)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [X] Minor
### Screenshots (if appropriate):
### How Has This Been Tested?
Perform a detach / attach (on a VM with configdrive iso attached) operation
with the force flag on - operation completes successfully
--
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]