mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7248. [VMware] Extract volume fails with an NPE.
Synchronize attach disk to VM on the VM object value instead of using a DB lock.
This commit is contained in:
parent
bb7fc59947
commit
b41a78ce0f
@ -1056,6 +1056,7 @@ public class VirtualMachineMO extends BaseMO {
|
||||
s_logger.trace("vCenter API trace - attachDisk(). target MOR: " + _mor.getValue() + ", vmdkDatastorePath: " + new Gson().toJson(vmdkDatastorePathChain) +
|
||||
", datastore: " + morDs.getValue());
|
||||
|
||||
synchronized (_mor.getValue().intern()) {
|
||||
VirtualDevice newDisk = VmwareHelper.prepareDiskDevice(this, null, getScsiDeviceControllerKey(), vmdkDatastorePathChain, morDs, -1, 1);
|
||||
VirtualMachineConfigSpec reConfigSpec = new VirtualMachineConfigSpec();
|
||||
VirtualDeviceConfigSpec deviceConfigSpec = new VirtualDeviceConfigSpec();
|
||||
@ -1075,6 +1076,7 @@ public class VirtualMachineMO extends BaseMO {
|
||||
}
|
||||
|
||||
_context.waitForTaskProgressDone(morTask);
|
||||
}
|
||||
|
||||
if (s_logger.isTraceEnabled())
|
||||
s_logger.trace("vCenter API trace - attachDisk() done(successfully)");
|
||||
@ -1085,6 +1087,7 @@ public class VirtualMachineMO extends BaseMO {
|
||||
if (s_logger.isTraceEnabled())
|
||||
s_logger.trace("vCenter API trace - attachDisk(). target MOR: " + _mor.getValue() + ", vmdkDatastorePath: " + new Gson().toJson(vmdkDatastorePathChain));
|
||||
|
||||
synchronized (_mor.getValue().intern()) {
|
||||
VirtualDevice newDisk = VmwareHelper.prepareDiskDevice(this, controllerKey, vmdkDatastorePathChain, -1, 1);
|
||||
VirtualMachineConfigSpec reConfigSpec = new VirtualMachineConfigSpec();
|
||||
VirtualDeviceConfigSpec deviceConfigSpec = new VirtualDeviceConfigSpec();
|
||||
@ -1104,6 +1107,7 @@ public class VirtualMachineMO extends BaseMO {
|
||||
}
|
||||
|
||||
_context.waitForTaskProgressDone(morTask);
|
||||
}
|
||||
|
||||
if (s_logger.isTraceEnabled())
|
||||
s_logger.trace("vCenter API trace - attachDisk() done(successfully)");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user