|
61 | 61 | import org.apache.cloudstack.context.CallContext;
|
62 | 62 | import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
63 | 63 | import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
|
| 64 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; |
64 | 65 | import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
|
| 66 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider; |
| 67 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager; |
| 68 | +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; |
65 | 69 | import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
|
66 | 70 | import org.apache.cloudstack.framework.ca.Certificate;
|
67 | 71 | import org.apache.cloudstack.framework.config.ConfigKey;
|
@@ -409,6 +413,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
409 | 413 | ResourceCleanupService resourceCleanupService;
|
410 | 414 | @Inject
|
411 | 415 | VmWorkJobDao vmWorkJobDao;
|
| 416 | + @Inject |
| 417 | + DataStoreProviderManager dataStoreProviderManager; |
412 | 418 |
|
413 | 419 | private SingleCache<List<Long>> vmIdsInProgressCache;
|
414 | 420 |
|
@@ -1224,6 +1230,11 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
|
1224 | 1230 | planChangedByVolume = true;
|
1225 | 1231 | }
|
1226 | 1232 | }
|
| 1233 | + DataStoreProvider storeProvider = dataStoreProviderManager.getDataStoreProvider(pool.getStorageProviderName()); |
| 1234 | + DataStoreDriver storeDriver = storeProvider.getDataStoreDriver(); |
| 1235 | + if (storeDriver instanceof PrimaryDataStoreDriver) { |
| 1236 | + ((PrimaryDataStoreDriver)storeDriver).detachVolumeFromAllStorageNodes(vol); |
| 1237 | + } |
1227 | 1238 | }
|
1228 | 1239 | }
|
1229 | 1240 |
|
|
0 commit comments