mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Prevent data corruption for StorPool volumes (#10799)
This commit is contained in:
parent
13ab8a04d1
commit
c183fc9859
@ -61,7 +61,11 @@ import org.apache.cloudstack.ca.CAManager;
|
|||||||
import org.apache.cloudstack.context.CallContext;
|
import org.apache.cloudstack.context.CallContext;
|
||||||
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
||||||
import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
|
import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
|
||||||
|
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
|
||||||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
|
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
|
||||||
|
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
|
||||||
|
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
|
||||||
|
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
|
||||||
import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
|
import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
|
||||||
import org.apache.cloudstack.framework.ca.Certificate;
|
import org.apache.cloudstack.framework.ca.Certificate;
|
||||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||||
@ -385,6 +389,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||||||
private DomainRouterJoinDao domainRouterJoinDao;
|
private DomainRouterJoinDao domainRouterJoinDao;
|
||||||
@Inject
|
@Inject
|
||||||
private AnnotationDao annotationDao;
|
private AnnotationDao annotationDao;
|
||||||
|
@Inject
|
||||||
|
DataStoreProviderManager dataStoreProviderManager;
|
||||||
|
|
||||||
VmWorkJobHandlerProxy _jobHandlerProxy = new VmWorkJobHandlerProxy(this);
|
VmWorkJobHandlerProxy _jobHandlerProxy = new VmWorkJobHandlerProxy(this);
|
||||||
|
|
||||||
@ -1204,6 +1210,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||||||
planChangedByVolume = true;
|
planChangedByVolume = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DataStoreProvider storeProvider = dataStoreProviderManager.getDataStoreProvider(pool.getStorageProviderName());
|
||||||
|
DataStoreDriver storeDriver = storeProvider.getDataStoreDriver();
|
||||||
|
if (storeDriver instanceof PrimaryDataStoreDriver) {
|
||||||
|
((PrimaryDataStoreDriver)storeDriver).detachVolumeFromAllStorageNodes(vol);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user