diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java index 1e3c01cec9e0..54c376e22657 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java @@ -79,7 +79,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCustomIdCmd { description = "the ID of the disk offering. Either diskOfferingId or snapshotId must be passed in.") private Long diskOfferingId; - @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the disk volume") + @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the disk volume") private String volumeName; @Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, description = "Arbitrary volume size") diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 0874a6c2c53b..b60ecd38041f 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -672,7 +672,7 @@ public VolumeVO allocVolume(CreateVolumeCmd cmd) throws ResourceAllocationExcept } String userSpecifiedName = cmd.getVolumeName(); - if (userSpecifiedName == null) { + if (userSpecifiedName == null || userSpecifiedName.isEmpty()) { userSpecifiedName = getRandomVolumeName(); } diff --git a/ui/scripts/docs.js b/ui/scripts/docs.js index ed6ab0c938c1..a2e333eeaed6 100755 --- a/ui/scripts/docs.js +++ b/ui/scripts/docs.js @@ -1008,7 +1008,7 @@ cloudStack.docs = { }, // Add volume helpVolumeName: { - desc: 'Give the volume a unique name so you can find it later.', + desc: 'Give the volume a unique name. If not, it will be generated randomly.', externalLink: '' }, helpVolumeAvailabilityZone: { diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 599802a45ab0..1e1f1a57d753 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -80,10 +80,7 @@ fields: { name: { docID: 'helpVolumeName', - label: 'label.name', - validation: { - required: true - } + label: 'label.name' }, availabilityZone: { label: 'label.availability.zone',