You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2025/01/15 15:00:53 UTC
(cloudstack) branch 4.19 updated: [VMware] Consider CD/DVD drive when calculating next free unit number for volume attachment over IDE controller (#9644)
This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.19 by this push:
new e278bcd08ac [VMware] Consider CD/DVD drive when calculating next free unit number for volume attachment over IDE controller (#9644)
e278bcd08ac is described below
commit e278bcd08ac0734f058858cf415f0fe5eb378b65
Author: Fabricio Duarte <fa...@gmail.com>
AuthorDate: Wed Jan 15 12:00:46 2025 -0300
[VMware] Consider CD/DVD drive when calculating next free unit number for volume attachment over IDE controller (#9644)
Co-authored-by: dahn <da...@gmail.com>
---
.../main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index 742f33575f5..e53d14fc43b 100644
--- a/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -3169,9 +3169,12 @@ public class VirtualMachineMO extends BaseMO {
int deviceCount = 0;
int ideDeviceUnitNumber = -1;
- if (devices != null && devices.size() > 0) {
+ if (devices != null) {
for (VirtualDevice device : devices) {
- if (device instanceof VirtualDisk && (controllerKey == device.getControllerKey())) {
+ if (device.getControllerKey() == null || device.getControllerKey() != controllerKey) {
+ continue;
+ }
+ if (device instanceof VirtualDisk || device instanceof VirtualCdrom) {
deviceCount++;
ideDeviceUnitNumber = device.getUnitNumber();
}