GaOrtiga commented on code in PR #12966:
URL: https://github.com/apache/cloudstack/pull/12966#discussion_r3058023150


##########
api/src/main/java/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java:
##########
@@ -109,6 +110,13 @@ public class CreateVolumeCmd extends 
BaseAsyncCreateCustomIdCmd implements UserC
                description = "The ID of the Instance; to be used with snapshot 
Id, Instance to which the volume gets attached after creation")
     private Long virtualMachineId;
 
+    @Parameter(name = ApiConstants.STORAGE_ID,
+            type = CommandType.UUID,
+            entityType = StoragePoolResponse.class,
+            description = "Storage pool ID to create the volume in. Exclusive 
with SnapshotId parameter.",

Review Comment:
   ```suggestion
               description = "Storage pool ID to create the volume in. Can not 
be specified with SnapshotId parameter.",
   ```
   Could we rephrase like this to make it more clear? Exclusive lead me to 
understand they have to be used together, I think others may reach the same 
conclusion.



##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -1043,6 +1043,36 @@ public boolean validateVolumeSizeInBytes(long size) {
         return true;
     }
 
+    private VolumeVO createVolumeOnStoragePool(Long volumeId, Long storageId) 
throws ExecutionException, InterruptedException {
+        VolumeVO volume = _volsDao.findById(volumeId);
+        StoragePool destPool = (StoragePool) 
dataStoreMgr.getDataStore(storageId, DataStoreRole.Primary);
+        if (destPool == null) {
+            throw new InvalidParameterValueException("Failed to find the 
destination storage pool: " + storageId);
+        } else if (destPool.isInMaintenance()) {

Review Comment:
   What would be the behaviour if the pool is in other states, such as 
disabled, creating, removed, etc? Should we check for those?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to