|
26 | 26 | import javax.inject.Inject; |
27 | 27 |
|
28 | 28 | import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity; |
| 29 | +import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; |
29 | 30 | import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; |
30 | 31 | import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult; |
31 | 32 | import org.apache.cloudstack.engine.subsystem.api.storage.DataMotionService; |
32 | 33 | import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; |
33 | 34 | import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; |
| 35 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; |
34 | 36 | import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; |
35 | 37 | import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector; |
36 | 38 | import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine; |
37 | | -import org.apache.cloudstack.engine.subsystem.api.storage.Scope; |
38 | 39 | import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event; |
39 | | -import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; |
40 | 40 | import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; |
| 41 | +import org.apache.cloudstack.engine.subsystem.api.storage.Scope; |
41 | 42 | import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; |
42 | 43 | import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo; |
43 | | -import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; |
44 | 44 | import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory; |
45 | 45 | import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; |
46 | 46 | import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService; |
|
77 | 77 | import com.cloud.storage.DataStoreRole; |
78 | 78 | import com.cloud.storage.ScopeType; |
79 | 79 | import com.cloud.storage.StoragePool; |
| 80 | +import com.cloud.storage.StoragePoolStatus; |
80 | 81 | import com.cloud.storage.VMTemplateStoragePoolVO; |
81 | 82 | import com.cloud.storage.VMTemplateStorageResourceAssoc; |
82 | 83 | import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; |
83 | | -import com.cloud.storage.Volume.State; |
84 | 84 | import com.cloud.storage.Volume; |
| 85 | +import com.cloud.storage.Volume.State; |
85 | 86 | import com.cloud.storage.VolumeVO; |
86 | 87 | import com.cloud.storage.dao.VMTemplatePoolDao; |
87 | 88 | import com.cloud.storage.dao.VolumeDao; |
@@ -1302,6 +1303,13 @@ private Map<Long, TemplateProp> listVolume(DataStore store) { |
1302 | 1303 |
|
1303 | 1304 | @Override |
1304 | 1305 | public SnapshotInfo takeSnapshot(VolumeInfo volume) { |
| 1306 | + PrimaryDataStore store = (PrimaryDataStore)volume.getDataStore(); |
| 1307 | + |
| 1308 | + if (store.getStatus() != StoragePoolStatus.Up) { |
| 1309 | + throw new CloudRuntimeException("store is not in up state"); |
| 1310 | + } |
| 1311 | + |
| 1312 | + |
1305 | 1313 | SnapshotInfo snapshot = null; |
1306 | 1314 | try { |
1307 | 1315 | snapshot = snapshotMgr.takeSnapshot(volume); |
|
0 commit comments