|
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;
|
@@ -385,6 +389,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
385 | 389 | private DomainRouterJoinDao domainRouterJoinDao;
|
386 | 390 | @Inject
|
387 | 391 | private AnnotationDao annotationDao;
|
| 392 | + @Inject |
| 393 | + DataStoreProviderManager dataStoreProviderManager; |
388 | 394 |
|
389 | 395 | VmWorkJobHandlerProxy _jobHandlerProxy = new VmWorkJobHandlerProxy(this);
|
390 | 396 |
|
@@ -1204,6 +1210,11 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
|
1204 | 1210 | planChangedByVolume = true;
|
1205 | 1211 | }
|
1206 | 1212 | }
|
| 1213 | + DataStoreProvider storeProvider = dataStoreProviderManager.getDataStoreProvider(pool.getStorageProviderName()); |
| 1214 | + DataStoreDriver storeDriver = storeProvider.getDataStoreDriver(); |
| 1215 | + if (storeDriver instanceof PrimaryDataStoreDriver) { |
| 1216 | + ((PrimaryDataStoreDriver)storeDriver).detachVolumeFromAllStorageNodes(vol); |
| 1217 | + } |
1207 | 1218 | }
|
1208 | 1219 | }
|
1209 | 1220 |
|
|
0 commit comments