Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92A75105B8 for ; Sat, 15 Mar 2014 05:47:50 +0000 (UTC) Received: (qmail 81899 invoked by uid 500); 15 Mar 2014 05:47:50 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 81625 invoked by uid 500); 15 Mar 2014 05:47:47 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 81062 invoked by uid 99); 15 Mar 2014 05:47:45 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Mar 2014 05:47:45 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 3AF2A8B84D5; Sat, 15 Mar 2014 05:47:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mtutkowski@apache.org To: commits@cloudstack.apache.org Message-Id: <7b5384cf144f4e35a002132a0a435a9d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to d55c4dd Date: Sat, 15 Mar 2014 05:47:45 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/master 5e4a4e8b3 -> d55c4dd80 CLOUDSTACK-6170 Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d55c4dd8 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d55c4dd8 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d55c4dd8 Branch: refs/heads/master Commit: d55c4dd8048abbcc6ce1334ffbf6f2784b52cbb9 Parents: 5e4a4e8 Author: Mike Tutkowski Authored: Tue Mar 11 13:08:00 2014 -0600 Committer: Mike Tutkowski Committed: Fri Mar 14 23:47:20 2014 -0600 ---------------------------------------------------------------------- .../api/command/user/vm/DeployVMCmd.java | 61 +++++++++++--------- .../src/com/cloud/vm/VirtualMachineManager.java | 3 +- .../service/VolumeOrchestrationService.java | 2 +- .../com/cloud/vm/VirtualMachineManagerImpl.java | 18 +++--- .../engine/orchestration/CloudOrchestrator.java | 50 ++++++++++++---- .../orchestration/VolumeOrchestrator.java | 11 ++-- ui/css/cloudstack3.css | 40 +++++++++++++ ui/index.jsp | 13 ++++- ui/scripts/instanceWizard.js | 19 ++++++ ui/scripts/ui-custom/instanceWizard.js | 10 +++- 10 files changed, 172 insertions(+), 55 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index 0235fcc..6db99c7 100755 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -482,41 +482,50 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd { String minIops = (String)map.get("minIops"); String maxIops = (String)map.get("maxIops"); - if ((minIops != null && maxIops == null) || (minIops == null && maxIops != null)) { - throw new InvalidParameterValueException("Either 'Min IOPS' and 'Max IOPS' must both be specified or neither be specified."); - } + verifyMinAndMaxIops(minIops, maxIops); - long lMinIops; + minIops = (String)map.get("minIopsDo"); + maxIops = (String)map.get("maxIopsDo"); - try { - if (minIops != null) { - lMinIops = Long.valueOf(minIops); - } - else { - lMinIops = 0; - } + verifyMinAndMaxIops(minIops, maxIops); + } + } + + private void verifyMinAndMaxIops(String minIops, String maxIops) { + if ((minIops != null && maxIops == null) || (minIops == null && maxIops != null)) { + throw new InvalidParameterValueException("Either 'Min IOPS' and 'Max IOPS' must both be specified or neither be specified."); + } + + long lMinIops; + + try { + if (minIops != null) { + lMinIops = Long.valueOf(minIops); } - catch (NumberFormatException ex) { - throw new InvalidParameterValueException("'Min IOPS' must be a whole number."); + else { + lMinIops = 0; } + } + catch (NumberFormatException ex) { + throw new InvalidParameterValueException("'Min IOPS' must be a whole number."); + } - long lMaxIops; + long lMaxIops; - try { - if (maxIops != null) { - lMaxIops = Long.valueOf(maxIops); - } - else { - lMaxIops = 0; - } + try { + if (maxIops != null) { + lMaxIops = Long.valueOf(maxIops); } - catch (NumberFormatException ex) { - throw new InvalidParameterValueException("'Max IOPS' must be a whole number."); + else { + lMaxIops = 0; } + } + catch (NumberFormatException ex) { + throw new InvalidParameterValueException("'Max IOPS' must be a whole number."); + } - if (lMinIops > lMaxIops) { - throw new InvalidParameterValueException("'Min IOPS' must be less than or equal to 'Max IOPS'."); - } + if (lMinIops > lMaxIops) { + throw new InvalidParameterValueException("'Min IOPS' must be less than or equal to 'Max IOPS'."); } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/engine/api/src/com/cloud/vm/VirtualMachineManager.java ---------------------------------------------------------------------- diff --git a/engine/api/src/com/cloud/vm/VirtualMachineManager.java b/engine/api/src/com/cloud/vm/VirtualMachineManager.java index 99f5595..f070210 100644 --- a/engine/api/src/com/cloud/vm/VirtualMachineManager.java +++ b/engine/api/src/com/cloud/vm/VirtualMachineManager.java @@ -36,7 +36,6 @@ import com.cloud.exception.OperationTimedoutException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.network.Network; -import com.cloud.offering.DiskOffering; import com.cloud.offering.DiskOfferingInfo; import com.cloud.offering.ServiceOffering; import com.cloud.storage.StoragePool; @@ -77,7 +76,7 @@ public interface VirtualMachineManager extends Manager { * @throws InsufficientCapacityException If there are insufficient capacity to deploy this vm. */ void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOffering serviceOffering, DiskOfferingInfo rootDiskOfferingInfo, - LinkedHashMap dataDiskOfferings, LinkedHashMap> auxiliaryNetworks, DeploymentPlan plan, + List dataDiskOfferings, LinkedHashMap> auxiliaryNetworks, DeploymentPlan plan, HypervisorType hyperType) throws InsufficientCapacityException; void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOffering serviceOffering, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java ---------------------------------------------------------------------- diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java index 2531074..66b5ff5 100644 --- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java +++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java @@ -86,7 +86,7 @@ public interface VolumeOrchestrationService { void destroyVolume(Volume volume); - DiskProfile allocateRawVolume(Type type, String name, DiskOffering offering, Long size, VirtualMachine vm, VirtualMachineTemplate template, Account owner); + DiskProfile allocateRawVolume(Type type, String name, DiskOffering offering, Long size, Long minIops, Long maxIops, VirtualMachine vm, VirtualMachineTemplate template, Account owner); VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, Volume rootVolumeOfVm, VolumeInfo volume, HypervisorType rootDiskHyperType) throws NoTransitionException; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java ---------------------------------------------------------------------- diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index bd1a754..3e088db 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -154,7 +154,6 @@ import com.cloud.network.NetworkModel; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkVO; import com.cloud.network.rules.RulesManager; -import com.cloud.offering.DiskOffering; import com.cloud.offering.DiskOfferingInfo; import com.cloud.offering.ServiceOffering; import com.cloud.org.Cluster; @@ -376,7 +375,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac @Override @DB public void allocate(String vmInstanceName, final VirtualMachineTemplate template, ServiceOffering serviceOffering, - final DiskOfferingInfo rootDiskOfferingInfo, LinkedHashMap dataDiskOfferings, + final DiskOfferingInfo rootDiskOfferingInfo, final List dataDiskOfferings, final LinkedHashMap> auxiliaryNetworks, DeploymentPlan plan, HypervisorType hyperType) throws InsufficientCapacityException { @@ -393,8 +392,6 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } assert (plan.getClusterId() == null && plan.getPoolId() == null) : "We currently don't support cluster and pool preset yet"; final VMInstanceVO vmFinal = _vmDao.persist(vm); - final LinkedHashMap dataDiskOfferingsFinal = - dataDiskOfferings == null ? new LinkedHashMap() : dataDiskOfferings; final VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmFinal, template, serviceOffering, null, null); @@ -416,8 +413,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } if (template.getFormat() == ImageFormat.ISO) { - volumeMgr.allocateRawVolume(Type.ROOT, "ROOT-" + vmFinal.getId(), rootDiskOfferingInfo.getDiskOffering(), rootDiskOfferingInfo.getSize(), vmFinal, - template, owner); + volumeMgr.allocateRawVolume(Type.ROOT, "ROOT-" + vmFinal.getId(), rootDiskOfferingInfo.getDiskOffering(), rootDiskOfferingInfo.getSize(), + rootDiskOfferingInfo.getMinIops(), rootDiskOfferingInfo.getMaxIops(), vmFinal, template, owner); } else if (template.getFormat() == ImageFormat.BAREMETAL) { // Do nothing } else { @@ -425,8 +422,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac rootDiskOfferingInfo.getMinIops(), rootDiskOfferingInfo.getMaxIops(), template, vmFinal, owner); } - for (Map.Entry offering : dataDiskOfferingsFinal.entrySet()) { - volumeMgr.allocateRawVolume(Type.DATADISK, "DATA-" + vmFinal.getId(), offering.getKey(), offering.getValue(), vmFinal, template, owner); + if (dataDiskOfferings != null) { + for (DiskOfferingInfo dataDiskOfferingInfo : dataDiskOfferings) { + volumeMgr.allocateRawVolume(Type.DATADISK, "DATA-" + vmFinal.getId(), dataDiskOfferingInfo.getDiskOffering(), dataDiskOfferingInfo.getSize(), + dataDiskOfferingInfo.getMinIops(), dataDiskOfferingInfo.getMaxIops(), vmFinal, template, owner); + } } } }); @@ -439,7 +439,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac @Override public void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOffering serviceOffering, LinkedHashMap> networks, DeploymentPlan plan, HypervisorType hyperType) throws InsufficientCapacityException { - allocate(vmInstanceName, template, serviceOffering, new DiskOfferingInfo(serviceOffering), null, networks, plan, hyperType); + allocate(vmInstanceName, template, serviceOffering, new DiskOfferingInfo(serviceOffering), new ArrayList(), networks, plan, hyperType); } private VirtualMachineGuru getVmGuru(VirtualMachine vm) { http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java ---------------------------------------------------------------------- diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java index fc1b85c..2b49954 100755 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java @@ -45,7 +45,6 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.network.Network; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkVO; -import com.cloud.offering.DiskOffering; import com.cloud.offering.DiskOfferingInfo; import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; @@ -181,14 +180,14 @@ public class CloudOrchestrator implements OrchestrationService { // Else, a disk offering is optional, and if present will be used to create the data disk DiskOfferingInfo rootDiskOfferingInfo = new DiskOfferingInfo(); - LinkedHashMap dataDiskOfferings = new LinkedHashMap(); + List dataDiskOfferings = new ArrayList(); - ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); + ServiceOfferingVO computeOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); - rootDiskOfferingInfo.setDiskOffering(offering); + rootDiskOfferingInfo.setDiskOffering(computeOffering); rootDiskOfferingInfo.setSize(rootDiskSize); - if (offering.isCustomizedIops() != null && offering.isCustomizedIops()) { + if (computeOffering.isCustomizedIops() != null && computeOffering.isCustomizedIops()) { Map userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId()); if (userVmDetails != null) { @@ -213,10 +212,28 @@ public class CloudOrchestrator implements OrchestrationService { } _volumeMgr.validateVolumeSizeRange(size * 1024 * 1024 * 1024); } - dataDiskOfferings.put(diskOffering, size); + + DiskOfferingInfo dataDiskOfferingInfo = new DiskOfferingInfo(); + + dataDiskOfferingInfo.setDiskOffering(diskOffering); + dataDiskOfferingInfo.setSize(size); + + if (diskOffering.isCustomizedIops() != null && diskOffering.isCustomizedIops()) { + Map userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId()); + + if (userVmDetails != null) { + String minIops = userVmDetails.get("minIopsDo"); + String maxIops = userVmDetails.get("maxIopsDo"); + + dataDiskOfferingInfo.setMinIops(minIops != null && minIops.trim().length() > 0 ? Long.parseLong(minIops) : null); + dataDiskOfferingInfo.setMaxIops(maxIops != null && maxIops.trim().length() > 0 ? Long.parseLong(maxIops) : null); + } + } + + dataDiskOfferings.add(dataDiskOfferingInfo); } - _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(templateId)), offering, rootDiskOfferingInfo, dataDiskOfferings, networkIpMap, plan, + _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(templateId)), computeOffering, rootDiskOfferingInfo, dataDiskOfferings, networkIpMap, plan, hypervisorType); return vmEntity; @@ -234,13 +251,12 @@ public class CloudOrchestrator implements OrchestrationService { //load vm instance and offerings and call virtualMachineManagerImpl VMInstanceVO vm = _vmDao.findByUuid(id); - ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); + ServiceOfferingVO computeOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); DiskOfferingInfo rootDiskOfferingInfo = new DiskOfferingInfo(); - rootDiskOfferingInfo.setDiskOffering(offering); + rootDiskOfferingInfo.setDiskOffering(computeOffering); - LinkedHashMap dataDiskOfferings = new LinkedHashMap(); Long diskOfferingId = vm.getDiskOfferingId(); if (diskOfferingId == null) { throw new InvalidParameterValueException("Installing from ISO requires a disk offering to be specified for the root disk."); @@ -261,6 +277,18 @@ public class CloudOrchestrator implements OrchestrationService { rootDiskOfferingInfo.setDiskOffering(diskOffering); rootDiskOfferingInfo.setSize(size); + if (diskOffering.isCustomizedIops() != null && diskOffering.isCustomizedIops()) { + Map userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId()); + + if (userVmDetails != null) { + String minIops = userVmDetails.get("minIopsDo"); + String maxIops = userVmDetails.get("maxIopsDo"); + + rootDiskOfferingInfo.setMinIops(minIops != null && minIops.trim().length() > 0 ? Long.parseLong(minIops) : null); + rootDiskOfferingInfo.setMaxIops(maxIops != null && maxIops.trim().length() > 0 ? Long.parseLong(maxIops) : null); + } + } + LinkedHashMap> networkIpMap = new LinkedHashMap>(); for (String uuid : networkNicMap.keySet()) { NetworkVO network = _networkDao.findByUuid(uuid); @@ -271,7 +299,7 @@ public class CloudOrchestrator implements OrchestrationService { HypervisorType hypervisorType = HypervisorType.valueOf(hypervisor); - _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(isoId)), offering, rootDiskOfferingInfo, dataDiskOfferings, networkIpMap, plan, hypervisorType); + _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(isoId)), computeOffering, rootDiskOfferingInfo, new ArrayList(), networkIpMap, plan, hypervisorType); return vmEntity; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java ---------------------------------------------------------------------- diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index f3753a7..cfa788f 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -569,14 +569,17 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati } @Override - public DiskProfile allocateRawVolume(Type type, String name, DiskOffering offering, Long size, VirtualMachine vm, VirtualMachineTemplate template, Account owner) { + public DiskProfile allocateRawVolume(Type type, String name, DiskOffering offering, Long size, Long minIops, Long maxIops, VirtualMachine vm, VirtualMachineTemplate template, Account owner) { if (size == null) { size = offering.getDiskSize(); } else { size = (size * 1024 * 1024 * 1024); } - VolumeVO vol = new VolumeVO(type, name, vm.getDataCenterId(), owner.getDomainId(), owner.getId(), offering.getId(), size, offering.getMinIops(), offering.getMaxIops(), - null); + + minIops = minIops != null ? minIops : offering.getMinIops(); + maxIops = maxIops != null ? maxIops : offering.getMaxIops(); + + VolumeVO vol = new VolumeVO(type, name, vm.getDataCenterId(), owner.getDomainId(), owner.getId(), offering.getId(), size, minIops, maxIops, null); if (vm != null) { vol.setInstanceId(vm.getId()); } @@ -1151,7 +1154,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati StoragePoolVO storagePool = _storagePoolDao.findById(destPool.getId()); - if (newVol.getVolumeType() == Type.DATADISK && storagePool.isManaged()) { + if (storagePool.isManaged()) { long hostId = vm.getVirtualMachine().getHostId(); Host host = _hostDao.findById(hostId); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/ui/css/cloudstack3.css ---------------------------------------------------------------------- diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 2b88e03..b363d11 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -6057,6 +6057,13 @@ label.error { border-radius: 4px; } +.multi-wizard.instance-wizard .section.custom-iops-do { + position: relative; + background: #F4F4F4; + padding: 7px; + border-radius: 4px; +} + .multi-wizard.instance-wizard .section.custom-size input[type=radio] { float: left; } @@ -6073,6 +6080,12 @@ label.error { margin: 6px -1px 0 8px; } +.multi-wizard.instance-wizard .section.custom-iops-do input[type=text] { + float: left; + width: 28px; + margin: 6px -1px 0 8px; +} + .multi-wizard.instance-wizard .section.custom-size label.error { position: absolute; top: 29px; @@ -6080,6 +6093,33 @@ label.error { font-size: 10px; } +.instance-wizard .step.data-disk-offering.custom-iops-do .select-container { + height: 235px; +} + +.instance-wizard .step.data-disk-offering .custom-iops-do { + display: none; +} + +.instance-wizard .step.data-disk-offering.custom-iops-do .custom-iops-do { + display: block; +} + +.instance-wizard .step.data-disk-offering .custom-iops-do .field { + width: 30%; + float: left; + margin-bottom: 13px; +} + +.instance-wizard .step.data-disk-offering .custom-iops-do .field label { + text-indent: 20px; +} + +.instance-wizard .step.data-disk-offering .custom-iops-do .field input { + width: 88%; + margin-left: 26px; +} + /*** Compute offering*/ .instance-wizard .step.service-offering { } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/ui/index.jsp ---------------------------------------------------------------------- diff --git a/ui/index.jsp b/ui/index.jsp index d46c395..f8acc0c 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -221,7 +221,7 @@ - +
@@ -259,6 +259,17 @@
+ +
+
+ + +
+
+ + +
+
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/ui/scripts/instanceWizard.js ---------------------------------------------------------------------- diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js index 5c04d0e..03ee344 100644 --- a/ui/scripts/instanceWizard.js +++ b/ui/scripts/instanceWizard.js @@ -292,6 +292,9 @@ selectedHypervisor = args.currentData.hypervisorid; } + // if the user is leveraging a template, then we can show custom IOPS, if applicable + var canShowCustomIopsForServiceOffering = (args.currentData["select-template"] != "select-iso" ? true : false); + $.ajax({ url: createURL("listServiceOfferings&issystem=false"), dataType: "json", @@ -299,6 +302,7 @@ success: function(json) { serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering; args.response.success({ + canShowCustomIops: canShowCustomIopsForServiceOffering, customFlag: 'iscustomized', //customFlag: 'offerha', //for testing only customIopsFlag: 'iscustomizediops', @@ -322,6 +326,7 @@ args.response.success({ required: isRequred, customFlag: 'iscustomized', // Field determines if custom slider is shown + customIopsDoFlag: 'iscustomizediops', data: { diskOfferings: diskOfferingObjs } @@ -657,6 +662,20 @@ size : args.data.size }); } + + if (selectedDiskOfferingObj.iscustomizediops == true) { + if (args.$wizard.find('input[name=disk-min-iops-do]').val().length > 0) { + $.extend(deployVmData, { + 'details[0].minIopsDo' : args.$wizard.find('input[name=disk-min-iops-do]').val() + }); + } + + if (args.$wizard.find('input[name=disk-max-iops-do]').val().length > 0) { + $.extend(deployVmData, { + 'details[0].maxIopsDo' : args.$wizard.find('input[name=disk-max-iops-do]').val() + }); + } + } } //step 5: select an affinity group http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d55c4dd8/ui/scripts/ui-custom/instanceWizard.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index f5f7b10..a2cbab7 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -460,7 +460,7 @@ var customIops = item[args.customIopsFlag]; - if (customIops) { + if (customIops && args.canShowCustomIops) { $step.addClass('custom-iops'); } else { $step.removeClass('custom-iops'); @@ -556,6 +556,14 @@ $step.removeClass('custom-disk-size'); } + var customIops = item[args.customIopsDoFlag]; + + if (customIops) { + $step.addClass('custom-iops-do'); + } else { + $step.removeClass('custom-iops-do'); + } + return true; });