Skip to content

Commit 637cc6e

Browse files
nathanejohnsonGabrielBrascher
authored andcommitted
feature: add libvirt / qemu io bursting (#3133)
* feature: add libvirt / qemu io bursting Adds the ability to set bursting features from libvirt / qemu This allows you to utilize the iops and bytes temporary "burst" mode introduced with libvirt 2.4 and improved upon with libvirt 2.6. https://blogs.igalia.com/berto/2016/05/24/io-bursts-with-qemu-2-6/ * updates per rafael et al
1 parent 460d312 commit 637cc6e

25 files changed

Lines changed: 1229 additions & 84 deletions

File tree

api/src/main/java/com/cloud/offering/DiskOffering.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,53 @@ public String toString() {
9999

100100
Long getBytesReadRate();
101101

102+
void setBytesReadRateMax(Long bytesReadRateMax);
103+
104+
Long getBytesReadRateMax();
105+
106+
void setBytesReadRateMaxLength(Long bytesReadRateMaxLength);
107+
108+
Long getBytesReadRateMaxLength();
109+
110+
102111
void setBytesWriteRate(Long bytesWriteRate);
103112

104113
Long getBytesWriteRate();
105114

115+
void setBytesWriteRateMax(Long bytesWriteMax);
116+
117+
Long getBytesWriteRateMax();
118+
119+
void setBytesWriteRateMaxLength(Long bytesWriteMaxLength);
120+
121+
Long getBytesWriteRateMaxLength();
122+
123+
106124
void setIopsReadRate(Long iopsReadRate);
107125

108126
Long getIopsReadRate();
109127

128+
void setIopsReadRateMax(Long iopsReadRateMax);
129+
130+
Long getIopsReadRateMax();
131+
132+
void setIopsReadRateMaxLength(Long iopsReadRateMaxLength);
133+
134+
Long getIopsReadRateMaxLength();
135+
110136
void setIopsWriteRate(Long iopsWriteRate);
111137

112138
Long getIopsWriteRate();
113139

140+
void setIopsWriteRateMax(Long iopsWriteRateMax);
141+
142+
Long getIopsWriteRateMax();
143+
144+
145+
void setIopsWriteRateMaxLength(Long iopsWriteRateMaxLength);
146+
147+
Long getIopsWriteRateMaxLength();
148+
114149
void setHypervisorSnapshotReserve(Integer hypervisorSnapshotReserve);
115150

116151
Integer getHypervisorSnapshotReserve();

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ public class ApiConstants {
3737
public static final String BIND_DN = "binddn";
3838
public static final String BIND_PASSWORD = "bindpass";
3939
public static final String BYTES_READ_RATE = "bytesreadrate";
40+
public static final String BYTES_READ_RATE_MAX = "bytesreadratemax";
41+
public static final String BYTES_READ_RATE_MAX_LENGTH = "bytesreadratemaxlength";
4042
public static final String BYTES_WRITE_RATE = "byteswriterate";
43+
public static final String BYTES_WRITE_RATE_MAX = "byteswriteratemax";
44+
public static final String BYTES_WRITE_RATE_MAX_LENGTH = "byteswriteratemaxlength";
4145
public static final String BYPASS_VLAN_OVERLAP_CHECK = "bypassvlanoverlapcheck";
4246
public static final String CATEGORY = "category";
4347
public static final String CAN_REVERT = "canrevert";
@@ -162,7 +166,11 @@ public class ApiConstants {
162166
public static final String INTERVAL_TYPE = "intervaltype";
163167
public static final String LOCATION_TYPE = "locationtype";
164168
public static final String IOPS_READ_RATE = "iopsreadrate";
169+
public static final String IOPS_READ_RATE_MAX = "iopsreadratemax";
170+
public static final String IOPS_READ_RATE_MAX_LENGTH = "iopsreadratemaxlength";
165171
public static final String IOPS_WRITE_RATE = "iopswriterate";
172+
public static final String IOPS_WRITE_RATE_MAX = "iopswriteratemax";
173+
public static final String IOPS_WRITE_RATE_MAX_LENGTH = "iopswriteratemaxlength";
166174
public static final String IP_ADDRESS = "ipaddress";
167175
public static final String IP6_ADDRESS = "ip6address";
168176
public static final String IP_ADDRESS_ID = "ipaddressid";

api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,41 @@ public class CreateDiskOfferingCmd extends BaseCmd {
8080
@Parameter(name = ApiConstants.BYTES_READ_RATE, type = CommandType.LONG, required = false, description = "bytes read rate of the disk offering")
8181
private Long bytesReadRate;
8282

83+
84+
@Parameter(name = ApiConstants.BYTES_READ_RATE_MAX, type = CommandType.LONG, required = false, description = "burst bytes read rate of the disk offering")
85+
private Long bytesReadRateMax;
86+
87+
@Parameter(name = ApiConstants.BYTES_READ_RATE_MAX_LENGTH, type = CommandType.LONG, required = false, description = "length (in seconds) of the burst")
88+
private Long bytesReadRateMaxLength;
89+
8390
@Parameter(name = ApiConstants.BYTES_WRITE_RATE, type = CommandType.LONG, required = false, description = "bytes write rate of the disk offering")
8491
private Long bytesWriteRate;
8592

93+
@Parameter(name = ApiConstants.BYTES_WRITE_RATE_MAX, type = CommandType.LONG, required = false, description = "burst bytes write rate of the disk offering")
94+
private Long bytesWriteRateMax;
95+
96+
97+
@Parameter(name = ApiConstants.BYTES_WRITE_RATE_MAX_LENGTH, type = CommandType.LONG, required = false, description = "length (in seconds) of the burst")
98+
private Long bytesWriteRateMaxLength;
99+
86100
@Parameter(name = ApiConstants.IOPS_READ_RATE, type = CommandType.LONG, required = false, description = "io requests read rate of the disk offering")
87101
private Long iopsReadRate;
88102

103+
@Parameter(name = ApiConstants.IOPS_READ_RATE_MAX, type = CommandType.LONG, required = false, description = "burst requests read rate of the disk offering")
104+
private Long iopsReadRateMax;
105+
106+
@Parameter(name = ApiConstants.IOPS_READ_RATE_MAX_LENGTH, type = CommandType.LONG, required = false, description = "length (in seconds) of the burst")
107+
private Long iopsReadRateMaxLength;
108+
89109
@Parameter(name = ApiConstants.IOPS_WRITE_RATE, type = CommandType.LONG, required = false, description = "io requests write rate of the disk offering")
90110
private Long iopsWriteRate;
91111

112+
@Parameter(name = ApiConstants.IOPS_WRITE_RATE_MAX, type = CommandType.LONG, required = false, description = "burst io requests write rate of the disk offering")
113+
private Long iopsWriteRateMax;
114+
115+
@Parameter(name = ApiConstants.IOPS_WRITE_RATE_MAX_LENGTH, type = CommandType.LONG, required = false, description = "length (in seconds) of the burst")
116+
private Long iopsWriteRateMaxLength;
117+
92118
@Parameter(name = ApiConstants.CUSTOMIZED_IOPS, type = CommandType.BOOLEAN, required = false, description = "whether disk offering iops is custom or not")
93119
private Boolean customizedIops;
94120

@@ -148,18 +174,50 @@ public Long getBytesReadRate() {
148174
return bytesReadRate;
149175
}
150176

177+
public Long getBytesReadRateMax() {
178+
return bytesReadRateMax;
179+
}
180+
181+
public Long getBytesReadRateMaxLength() {
182+
return bytesReadRateMaxLength;
183+
}
184+
151185
public Long getBytesWriteRate() {
152186
return bytesWriteRate;
153187
}
154188

189+
public Long getBytesWriteRateMax() {
190+
return bytesWriteRateMax;
191+
}
192+
193+
public Long getBytesWriteRateMaxLength() {
194+
return bytesWriteRateMaxLength;
195+
}
196+
155197
public Long getIopsReadRate() {
156198
return iopsReadRate;
157199
}
158200

201+
public Long getIopsReadRateMax() {
202+
return iopsReadRateMax;
203+
}
204+
205+
public Long getIopsReadRateMaxLength() {
206+
return iopsReadRateMaxLength;
207+
}
208+
159209
public Long getIopsWriteRate() {
160210
return iopsWriteRate;
161211
}
162212

213+
public Long getIopsWriteRateMax() {
214+
return iopsWriteRateMax;
215+
}
216+
217+
public Long getIopsWriteRateMaxLength() {
218+
return iopsWriteRateMaxLength;
219+
}
220+
163221
public String getStorageType() {
164222
return storageType;
165223
}

api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,39 @@ public class CreateServiceOfferingCmd extends BaseCmd {
113113
@Parameter(name = ApiConstants.BYTES_READ_RATE, type = CommandType.LONG, required = false, description = "bytes read rate of the disk offering")
114114
private Long bytesReadRate;
115115

116+
@Parameter(name = ApiConstants.BYTES_READ_RATE_MAX, type = CommandType.LONG, required = false, description = "burst bytes read rate of the disk offering")
117+
private Long bytesReadRateMax;
118+
119+
@Parameter(name = ApiConstants.BYTES_READ_RATE_MAX_LENGTH, type = CommandType.LONG, required = false, description = "length (in seconds) of the burst")
120+
private Long bytesReadRateMaxLength;
121+
116122
@Parameter(name = ApiConstants.BYTES_WRITE_RATE, type = CommandType.LONG, required = false, description = "bytes write rate of the disk offering")
117123
private Long bytesWriteRate;
118124

125+
@Parameter(name = ApiConstants.BYTES_WRITE_RATE_MAX, type = CommandType.LONG, required = false, description = "burst bytes write rate of the disk offering")
126+
private Long bytesWriteRateMax;
127+
128+
@Parameter(name = ApiConstants.BYTES_WRITE_RATE_MAX_LENGTH, type = CommandType.LONG, required = false, description = "length (in seconds) of the burst")
129+
private Long bytesWriteRateMaxLength;
130+
119131
@Parameter(name = ApiConstants.IOPS_READ_RATE, type = CommandType.LONG, required = false, description = "io requests read rate of the disk offering")
120132
private Long iopsReadRate;
121133

134+
@Parameter(name = ApiConstants.IOPS_READ_RATE_MAX, type = CommandType.LONG, required = false, description = "burst requests read rate of the disk offering")
135+
private Long iopsReadRateMax;
136+
137+
@Parameter(name = ApiConstants.IOPS_READ_RATE_MAX_LENGTH, type = CommandType.LONG, required = false, description = "length (in seconds) of the burst")
138+
private Long iopsReadRateMaxLength;
139+
122140
@Parameter(name = ApiConstants.IOPS_WRITE_RATE, type = CommandType.LONG, required = false, description = "io requests write rate of the disk offering")
123141
private Long iopsWriteRate;
124142

143+
@Parameter(name = ApiConstants.IOPS_WRITE_RATE_MAX, type = CommandType.LONG, required = false, description = "burst io requests write rate of the disk offering")
144+
private Long iopsWriteRateMax;
145+
146+
@Parameter(name = ApiConstants.IOPS_WRITE_RATE_MAX_LENGTH, type = CommandType.LONG, required = false, description = "length (in seconds) of the burst")
147+
private Long iopsWriteRateMaxLength;
148+
125149
@Parameter(name = ApiConstants.CUSTOMIZED_IOPS, type = CommandType.BOOLEAN, required = false, description = "whether compute offering iops is custom or not", since = "4.4")
126150
private Boolean customizedIops;
127151

@@ -232,18 +256,50 @@ public Long getBytesReadRate() {
232256
return bytesReadRate;
233257
}
234258

259+
public Long getBytesReadRateMax() {
260+
return bytesReadRateMax;
261+
}
262+
263+
public Long getBytesReadRateMaxLength() {
264+
return bytesReadRateMaxLength;
265+
}
266+
235267
public Long getBytesWriteRate() {
236268
return bytesWriteRate;
237269
}
238270

271+
public Long getBytesWriteRateMax() {
272+
return bytesWriteRateMax;
273+
}
274+
275+
public Long getBytesWriteRateMaxLength() {
276+
return bytesWriteRateMaxLength;
277+
}
278+
239279
public Long getIopsReadRate() {
240280
return iopsReadRate;
241281
}
242282

283+
public Long getIopsReadRateMax() {
284+
return iopsReadRateMax;
285+
}
286+
287+
public Long getIopsReadRateMaxLength() {
288+
return iopsReadRateMaxLength;
289+
}
290+
243291
public Long getIopsWriteRate() {
244292
return iopsWriteRate;
245293
}
246294

295+
public Long getIopsWriteRateMax() {
296+
return iopsWriteRateMax;
297+
}
298+
299+
public Long getIopsWriteRateMaxLength() {
300+
return iopsWriteRateMaxLength;
301+
}
302+
247303
public Boolean isCustomizedIops() {
248304
return customizedIops;
249305
}

api/src/main/java/org/apache/cloudstack/api/response/DiskOfferingResponse.java

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,50 @@ public class DiskOfferingResponse extends BaseResponse {
9292
@Param(description = "bytes read rate of the disk offering")
9393
private Long bytesReadRate;
9494

95+
@SerializedName("diskBytesReadRateMax")
96+
@Param(description = "burst bytes read rate of the disk offering")
97+
private Long bytesReadRateMax;
98+
99+
@SerializedName("diskBytesReadRateMaxLength")
100+
@Param(description = "length (in seconds) of the burst")
101+
private Long bytesReadRateMaxLength;
102+
95103
@SerializedName("diskBytesWriteRate")
96104
@Param(description = "bytes write rate of the disk offering")
97105
private Long bytesWriteRate;
98106

107+
@SerializedName("diskBytesWriteRateMax")
108+
@Param(description = "burst bytes write rate of the disk offering")
109+
private Long bytesWriteRateMax;
110+
111+
@SerializedName("diskBytesWriteRateMaxLength")
112+
@Param(description = "length (in seconds) of the burst")
113+
private Long bytesWriteRateMaxLength;
114+
99115
@SerializedName("diskIopsReadRate")
100116
@Param(description = "io requests read rate of the disk offering")
101117
private Long iopsReadRate;
102118

119+
@SerializedName("diskIopsReadRateMax")
120+
@Param(description = "burst io requests read rate of the disk offering")
121+
private Long iopsReadRateMax;
122+
123+
@SerializedName("diskIopsReadRateMaxLength")
124+
@Param(description = "length (in second) of the burst")
125+
private Long iopsReadRateMaxLength;
126+
103127
@SerializedName("diskIopsWriteRate")
104128
@Param(description = "io requests write rate of the disk offering")
105129
private Long iopsWriteRate;
106130

131+
@SerializedName("diskIopsWriteRateMax")
132+
@Param(description = "burst io requests write rate of the disk offering")
133+
private Long iopsWriteRateMax;
134+
135+
@SerializedName("diskIopsWriteRateMaxLength")
136+
@Param(description = "length (in seconds) of the burst")
137+
private Long iopsWriteRateMaxLength;
138+
107139
@SerializedName("cacheMode")
108140
@Param(description = "the cache mode to use for this disk offering. none, writeback or writethrough", since = "4.4")
109141
private String cacheMode;
@@ -253,15 +285,47 @@ public void setBytesReadRate(Long bytesReadRate) {
253285
this.bytesReadRate = bytesReadRate;
254286
}
255287

288+
public void setBytesReadRateMax(Long bytesReadRateMax) {
289+
this.bytesReadRateMax = bytesReadRateMax;
290+
}
291+
292+
public void setBytesReadRateMaxLength(Long bytesReadRateMaxLength) {
293+
this.bytesReadRateMaxLength = bytesReadRateMaxLength;
294+
}
295+
256296
public void setBytesWriteRate(Long bytesWriteRate) {
257297
this.bytesWriteRate = bytesWriteRate;
258298
}
259299

300+
public void setBytesWriteRateMax(Long bytesWriteRateMax) {
301+
this.bytesWriteRateMax = bytesWriteRateMax;
302+
}
303+
304+
public void setBytesWriteRateMaxLength(Long bytesWriteRateMaxLength) {
305+
this.bytesWriteRateMaxLength = bytesWriteRateMaxLength;
306+
}
307+
260308
public void setIopsReadRate(Long iopsReadRate) {
261309
this.iopsReadRate = iopsReadRate;
262310
}
263311

312+
public void setIopsReadRateMax(Long iopsReadRateMax) {
313+
this.iopsReadRateMax = iopsReadRateMax;
314+
}
315+
316+
public void setIopsReadRateMaxLength(Long iopsReadRateMaxLength) {
317+
this.iopsReadRateMaxLength = iopsReadRateMaxLength;
318+
}
319+
264320
public void setIopsWriteRate(Long iopsWriteRate) {
265321
this.iopsWriteRate = iopsWriteRate;
266322
}
323+
324+
public void setIopsWriteRateMax(Long iopsWriteRateMax) {
325+
this.iopsWriteRateMax = iopsWriteRateMax;
326+
}
327+
328+
public void setIopsWriteRateMaxLength(Long iopsWriteRateMaxLength) {
329+
this.iopsWriteRateMaxLength = iopsWriteRateMaxLength;
330+
}
267331
}

0 commit comments

Comments
 (0)