mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-1301: VM I/O Throttling (change default value from 0 to null)
This commit is contained in:
parent
635974e1f9
commit
e1a5c58f02
|
|
@ -106,19 +106,19 @@ public class CreateDiskOfferingCmd extends BaseCmd {
|
|||
}
|
||||
|
||||
public Long getBytesReadRate() {
|
||||
return (bytesReadRate == null) || (bytesReadRate < 0) ? 0 : bytesReadRate;
|
||||
return bytesReadRate;
|
||||
}
|
||||
|
||||
public Long getBytesWriteRate() {
|
||||
return (bytesWriteRate == null) || (bytesWriteRate < 0) ? 0 : bytesWriteRate;
|
||||
return bytesWriteRate;
|
||||
}
|
||||
|
||||
public Long getIopsReadRate() {
|
||||
return (iopsReadRate == null) || (iopsReadRate < 0) ? 0 : iopsReadRate;
|
||||
return iopsReadRate;
|
||||
}
|
||||
|
||||
public Long getIopsWriteRate() {
|
||||
return (iopsWriteRate == null) || (iopsWriteRate < 0) ? 0 : iopsWriteRate;
|
||||
return iopsWriteRate;
|
||||
}
|
||||
|
||||
public String getStorageType() {
|
||||
|
|
|
|||
|
|
@ -184,19 +184,19 @@ public class CreateServiceOfferingCmd extends BaseCmd {
|
|||
}
|
||||
|
||||
public Long getBytesReadRate() {
|
||||
return (bytesReadRate == null) || (bytesReadRate < 0) ? 0 : bytesReadRate;
|
||||
return bytesReadRate;
|
||||
}
|
||||
|
||||
public Long getBytesWriteRate() {
|
||||
return (bytesWriteRate == null) || (bytesWriteRate < 0) ? 0 : bytesWriteRate;
|
||||
return bytesWriteRate;
|
||||
}
|
||||
|
||||
public Long getIopsReadRate() {
|
||||
return (iopsReadRate == null) || (iopsReadRate < 0) ? 0 : iopsReadRate;
|
||||
return iopsReadRate;
|
||||
}
|
||||
|
||||
public Long getIopsWriteRate() {
|
||||
return (iopsWriteRate == null) || (iopsWriteRate < 0) ? 0 : iopsWriteRate;
|
||||
return iopsWriteRate;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -3507,13 +3507,13 @@ ServerResource {
|
|||
|
||||
}
|
||||
|
||||
if (volume.getBytesReadRate() > 0)
|
||||
if ((volume.getBytesReadRate() != null) && (volume.getBytesReadRate() > 0))
|
||||
disk.setBytesReadRate(volume.getBytesReadRate());
|
||||
if (volume.getBytesWriteRate() > 0)
|
||||
if ((volume.getBytesWriteRate() != null) && (volume.getBytesWriteRate() > 0))
|
||||
disk.setBytesWriteRate(volume.getBytesWriteRate());
|
||||
if (volume.getIopsReadRate() > 0)
|
||||
if ((volume.getIopsReadRate() != null) && (volume.getIopsReadRate() > 0))
|
||||
disk.setIopsReadRate(volume.getIopsReadRate());
|
||||
if (volume.getIopsWriteRate() > 0)
|
||||
if ((volume.getIopsWriteRate() != null) && (volume.getIopsWriteRate() > 0))
|
||||
disk.setIopsWriteRate(volume.getIopsWriteRate());
|
||||
|
||||
vm.getDevices().addDevice(disk);
|
||||
|
|
@ -3689,13 +3689,13 @@ ServerResource {
|
|||
diskdef.defBlockBasedDisk(attachingDisk.getPath(), devId,
|
||||
DiskDef.diskBus.VIRTIO);
|
||||
}
|
||||
if (bytesReadRate > 0)
|
||||
if ((bytesReadRate != null) && (bytesReadRate > 0))
|
||||
diskdef.setBytesReadRate(bytesReadRate);
|
||||
if (bytesWriteRate > 0)
|
||||
if ((bytesWriteRate != null) && (bytesWriteRate > 0))
|
||||
diskdef.setBytesWriteRate(bytesWriteRate);
|
||||
if (iopsReadRate > 0)
|
||||
if ((iopsReadRate != null) && (iopsReadRate > 0))
|
||||
diskdef.setIopsReadRate(iopsReadRate);
|
||||
if (iopsWriteRate > 0)
|
||||
if ((iopsWriteRate != null) && (iopsWriteRate > 0))
|
||||
diskdef.setIopsWriteRate(iopsWriteRate);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2046,13 +2046,13 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
ServiceOfferingVO offering = new ServiceOfferingVO(name, cpu, ramSize, speed, networkRate, null, offerHA, limitResourceUse, volatileVm, displayText, localStorageRequired, false, tags, isSystem, vm_type,
|
||||
domainId, hostTag, deploymentPlanner);
|
||||
|
||||
if (bytesReadRate != null && (bytesReadRate > 0))
|
||||
if ((bytesReadRate != null) && (bytesReadRate > 0))
|
||||
offering.setBytesReadRate(bytesReadRate);
|
||||
if (bytesWriteRate != null && (bytesWriteRate > 0))
|
||||
if ((bytesWriteRate != null) && (bytesWriteRate > 0))
|
||||
offering.setBytesWriteRate(bytesWriteRate);
|
||||
if (iopsReadRate != null && (iopsReadRate > 0))
|
||||
if ((iopsReadRate != null) && (iopsReadRate > 0))
|
||||
offering.setIopsReadRate(iopsReadRate);
|
||||
if (iopsWriteRate != null && (iopsWriteRate > 0))
|
||||
if ((iopsWriteRate != null) && (iopsWriteRate > 0))
|
||||
offering.setIopsWriteRate(iopsWriteRate);
|
||||
|
||||
if ((offering = _serviceOfferingDao.persist(offering)) != null) {
|
||||
|
|
|
|||
|
|
@ -1888,9 +1888,9 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
// get bytesReadRate from service_offering, disk_offering and vm.disk.throttling.bytes_read_rate
|
||||
@Override
|
||||
public Long getDiskBytesReadRate(ServiceOfferingVO offering, DiskOfferingVO diskOffering) {
|
||||
if ((offering != null) && (offering.getBytesReadRate() > 0)) {
|
||||
if ((offering != null) && (offering.getBytesReadRate() != null) && (offering.getBytesReadRate() > 0)) {
|
||||
return offering.getBytesReadRate();
|
||||
} else if ((diskOffering != null) && (diskOffering.getBytesReadRate() > 0)) {
|
||||
} else if ((diskOffering != null) && (diskOffering.getBytesReadRate() != null) && (diskOffering.getBytesReadRate() > 0)) {
|
||||
return diskOffering.getBytesReadRate();
|
||||
} else {
|
||||
Long bytesReadRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingBytesReadRate.key()));
|
||||
|
|
@ -1904,9 +1904,9 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
// get bytesWriteRate from service_offering, disk_offering and vm.disk.throttling.bytes_write_rate
|
||||
@Override
|
||||
public Long getDiskBytesWriteRate(ServiceOfferingVO offering, DiskOfferingVO diskOffering) {
|
||||
if ((offering != null) && (offering.getBytesWriteRate() > 0)) {
|
||||
if ((offering != null) && (offering.getBytesWriteRate() != null) && (offering.getBytesWriteRate() > 0)) {
|
||||
return offering.getBytesWriteRate();
|
||||
} else if ((diskOffering != null) && (diskOffering.getBytesWriteRate() > 0)) {
|
||||
} else if ((diskOffering != null) && (diskOffering.getBytesWriteRate() != null) && (diskOffering.getBytesWriteRate() > 0)) {
|
||||
return diskOffering.getBytesWriteRate();
|
||||
} else {
|
||||
Long bytesWriteRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingBytesWriteRate.key()));
|
||||
|
|
@ -1920,9 +1920,9 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
// get iopsReadRate from service_offering, disk_offering and vm.disk.throttling.iops_read_rate
|
||||
@Override
|
||||
public Long getDiskIopsReadRate(ServiceOfferingVO offering, DiskOfferingVO diskOffering) {
|
||||
if ((offering != null) && (offering.getIopsReadRate() > 0)) {
|
||||
if ((offering != null) && (offering.getIopsReadRate() != null) && (offering.getIopsReadRate() > 0)) {
|
||||
return offering.getIopsReadRate();
|
||||
} else if ((diskOffering != null) && (diskOffering.getIopsReadRate() > 0)) {
|
||||
} else if ((diskOffering != null) && (diskOffering.getIopsReadRate() != null) && (diskOffering.getIopsReadRate() > 0)) {
|
||||
return diskOffering.getIopsReadRate();
|
||||
} else {
|
||||
Long iopsReadRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingIopsReadRate.key()));
|
||||
|
|
@ -1936,9 +1936,9 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
// get iopsWriteRate from service_offering, disk_offering and vm.disk.throttling.iops_write_rate
|
||||
@Override
|
||||
public Long getDiskIopsWriteRate(ServiceOfferingVO offering, DiskOfferingVO diskOffering) {
|
||||
if ((offering != null) && (offering.getIopsWriteRate() > 0)) {
|
||||
if ((offering != null) && (offering.getIopsWriteRate() != null) && (offering.getIopsWriteRate() > 0)) {
|
||||
return offering.getIopsWriteRate();
|
||||
} else if ((diskOffering != null) && (diskOffering.getIopsWriteRate() > 0)) {
|
||||
} else if ((diskOffering != null) && (diskOffering.getIopsWriteRate() != null) && (diskOffering.getIopsWriteRate() > 0)) {
|
||||
return diskOffering.getIopsWriteRate();
|
||||
} else {
|
||||
Long iopsWriteRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingIopsWriteRate.key()));
|
||||
|
|
|
|||
|
|
@ -290,13 +290,13 @@ ALTER TABLE `cloud`.`nics` ADD COLUMN `display_nic` tinyint(1) NOT NULL DEFAULT
|
|||
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `display_offering` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Should disk offering be displayed to the end user';
|
||||
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `bytes_read_rate` bigint(20) unsigned DEFAULT 0;
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `bytes_read_rate` bigint(20);
|
||||
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `bytes_write_rate` bigint(20) unsigned DEFAULT 0;
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `bytes_write_rate` bigint(20);
|
||||
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `iops_read_rate` bigint(20) unsigned DEFAULT 0;
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `iops_read_rate` bigint(20);
|
||||
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `iops_write_rate` bigint(20) unsigned DEFAULT 0;
|
||||
ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `iops_write_rate` bigint(20);
|
||||
|
||||
CREATE TABLE `cloud`.`volume_details` (
|
||||
`id` bigint unsigned NOT NULL auto_increment,
|
||||
|
|
|
|||
Loading…
Reference in New Issue