Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Provisioned IOPS for EBS Volumes support

  • Loading branch information...
commit 96623c6d195d9864ebb7ff961e5f5cc96d154b40 1 parent d39feff
Eugene Kato authored
4 ec2ui/content/ec2ui/controller.js
View
@@ -85,11 +85,13 @@ var ec2ui_controller = {
objResponse.callback();
},
- createVolume : function (size, snapshotId, zone, callback) {
+ createVolume : function (size, snapshotId, zone, volumeType, iops, callback) {
var params = []
if (size != null) params.push(["Size", size]);
if (snapshotId != null) params.push(["SnapshotId", snapshotId]);
if (zone != null) params.push(["AvailabilityZone", zone]);
+ if (volumeType != null) params.push(["VolumeType", volumeType]);
+ if (iops != null) params.push(["Iops", iops]);
ec2_httpclient.queryEC2("CreateVolume", params, this, true, "onCompleteCreateVolume", callback);
},
8 ec2ui/content/ec2ui/dialog_new_volume.xul
View
@@ -30,6 +30,14 @@
<menulist id="ec2ui.newvolume.availabilityzonelist" />
</row>
<row>
+ <label control="ec2ui.newvolume.volumetypelist" value="&ec2ui.volumes.volumeType.label;" />
+ <menulist id="ec2ui.newvolume.volumetypelist" />
+ </row>
+ <row>
+ <label control="ec2ui.newvolume.iops" value="&ec2ui.volumes.iops.label;" />
+ <textbox id="ec2ui.newvolume.iops" size="40" />
+ </row>
+ <row>
<label control="ec2ui.newvolume.tag" value="Tag" />
<textbox id="ec2ui.newvolume.tag" size="40" />
</row>
26 ec2ui/content/ec2ui/newvolumedialog.js
View
@@ -14,7 +14,13 @@ var ec2_VolumeCreator = {
this.retVal.zone = document.getElementById("ec2ui.newvolume.availabilityzonelist").value;
+ this.retVal.volumeType = document.getElementById("ec2ui.newvolume.volumetypelist").value;
+
+ this.retVal.iops = document.getElementById("ec2ui.newvolume.iops").value.trim();
+ if (this.retVal.iops.length == 0) this.retVal.iops = null;
+
if (!this.validateSize()) return false;
+ if (!this.validateIops()) return false;
this.retVal.tag = document.getElementById("ec2ui.newvolume.tag").value.trim();
this.retVal.ok = true;
@@ -34,6 +40,19 @@ var ec2_VolumeCreator = {
return true;
},
+ validateIops : function() {
+ var val = (this.retVal.size != null) ? this.retVal.size : "";
+ val = parseInt(val);
+ var textbox = document.getElementById("ec2ui.newvolume.iops");
+ if (!isNaN(val) && val < 1) {
+ alert("IOPS must be >= 1 if a snapshot is not selected");
+ textbox.select();
+ return false;
+ }
+
+ return true;
+ },
+
init : function() {
var srcSnap = window.arguments[0];
this.ec2ui_session = window.arguments[1];
@@ -62,6 +81,13 @@ var ec2_VolumeCreator = {
}
//}
}
+
+ // volume types
+ var volTypeMenu = document.getElementById("ec2ui.newvolume.volumetypelist");
+ volTypeMenu.appendItem("standard", "standard");
+ volTypeMenu.appendItem("io1", "io1");
+ volTypeMenu.selectedIndex = 0;
+
// To accommodate the <NONE> element added at the head of the list
snapshotIdMenu.selectedIndex += 1;
2  ec2ui/content/ec2ui/volumesview.js
View
@@ -149,6 +149,8 @@ var ec2ui_VolumeTreeView = {
ec2ui_session.controller.createVolume(retVal.size,
retVal.snapshotId,
retVal.zone,
+ retVal.volumeType,
+ retVal.iops,
wrap);
// Let's tag this volume
2  ec2ui/locale/ec2ui/en-US/ec2ui.dtd
View
@@ -101,6 +101,8 @@
<!ENTITY ec2ui.volumes.size.label "Size (GB)">
<!ENTITY ec2ui.volumes.status.label "Status">
<!ENTITY ec2ui.volumes.createTime.label "Local Creation Date">
+<!ENTITY ec2ui.volumes.volumeType.label "Volume Type">
+<!ENTITY ec2ui.volumes.iops.label "IOPS">
<!ENTITY ec2ui.volumes.attachment.device.label "Device">
<!ENTITY ec2ui.volumes.attachment.status.label "Attachment Status">
<!ENTITY ec2ui.volumes.attachment.attachTime.label "Attach Time">
Please sign in to comment.
Something went wrong with that request. Please try again.