Skip to content

Commit 357ed69

Browse files
committed
Added support for storpool_qos service
1 parent 45daa1c commit 357ed69

11 files changed

Lines changed: 1015 additions & 60 deletions

File tree

engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreDriver.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.cloudstack.storage.command.CommandResult;
2323

2424
import com.cloud.host.Host;
25+
import com.cloud.offering.DiskOffering;
2526
import com.cloud.storage.StoragePool;
2627
import com.cloud.storage.Volume;
2728
import com.cloud.storage.Storage.StoragePoolType;
@@ -157,4 +158,10 @@ default boolean volumesRequireGrantAccessWhenUsed() {
157158
default boolean zoneWideVolumesAvailableWithoutClusterMotion() {
158159
return false;
159160
}
161+
162+
default boolean informStorageForDiskOfferingChange() {
163+
return false;
164+
}
165+
166+
default void updateStorageWithTheNewDiskOffering(Volume volume, DiskOffering newDiskOffering) {}
160167
}

plugins/storage/volume/storpool/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,46 @@ corresponding system disk offering.
345345

346346
CloudStack has no way to specify max BW. Do they want to be able to specify max BW only is sufficient.
347347

348+
================================================================================
349+
350+
StorPool provides the ‘storpool_qos’ service ([QoS user guide](https://kb.storpool.com/storpool_misc/qos.html#storpool-qos-user-guide)) that tracks and configures the storage tier for all volumes based on a specifically provided `qc` tag specifying the storage tier for each volume.
351+
352+
To manage the QoS limits with a `qc` tag, you have to add a `qc` tag resource detail to each disk offering to which a tier should be applied, with a key `SP_QOSCLASS` and the value from the configuration file for the `storpool_qos` service:
353+
354+
add resourcedetail resourceid={diskofferingid} details[0].key=SP_QOSCLASS details[0].value={the name of the tier from the config} resourcetype=DiskOffering
355+
356+
To change the tier via CloudStack, you can use the CloudStack API call `changeOfferingForVolume`. The size is required, but the user could use the current volume size. Example:
357+
358+
change offeringforvolume id={The UUID of the Volume} diskofferingid={The UUID of the disk offering} size={The current or a new size for the volume}
359+
360+
Users who were using the offerings to change the StorPool template via the `SP_TEMPLATE` detail, will continue to have this functionality but should use `changeOfferingForVolume` API call instead of:
361+
- `resizeVolume` API call for DATA disk
362+
- `scaleVirtualMachine` API call for ROOT disk
363+
364+
365+
If the disk offering has both `SP_TEMPLATE` and `SP_QOSCLASS` defined, the `SP_QOSCLASS` detail will be prioritised, setting the volume’s QoS using the respective ‘qc’ tag value. In case the QoS for a volume is changed manually, the ‘storpool_qos’ service will automatically reset the QoS limits following the ‘qc’ tag value once per minute.
366+
367+
<h4>Usage</h4>
368+
369+
Creating Disk Offering for each tier.
370+
371+
Go to Service Offerings > Disk Offering > Add disk offering.
372+
373+
Add disk offering detail with API call in CloudStack CLI.
374+
375+
add resourcedetail resourcetype=diskoffering resourceid=$UUID details[0].key=SP_QOSCLASS details[0].value=$Tier Name
376+
377+
378+
Creating VM with QoS
379+
380+
Deploy virtual machine: Go to Compute> Instances> Add Instances.
381+
- For the ROOT volume, choose the option `Override disk offering`. This will set the required `qc` tag from the disk offering (DO) detail.
382+
383+
Creating DATA disk with QoS
384+
- Create volume via GUI/CLI and choose a disk offering which has the required `SP_QOSCLASS` detail
385+
386+
To update the tier of a ROOT/DATA volume go to Storage> Volumes and select the Volume and click on the Change disk offering for the volume in the upper right corner.
387+
348388
## Supported operations for Volume encryption
349389

350390
Supported Virtual machine operations - live migration of VM to another host, virtual machine snapshots (group snapshot without memory), revert VM snapshot, delete VM snapshot
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package org.apache.cloudstack.storage.datastore.api;
2+
3+
import java.io.Serializable;
4+
import java.util.Map;
5+
6+
public class StorPoolVolume implements Serializable {
7+
8+
private static final long serialVersionUID = 1L;
9+
private transient String name;
10+
private Long size;
11+
private Map<String, String> tags;
12+
private String parent;
13+
private Long iops;
14+
private String template;
15+
private String baseOn;
16+
private String rename;
17+
private Boolean shrinkOk;
18+
19+
public StorPoolVolume() {
20+
}
21+
22+
public StorPoolVolume(String name, Long size, Map<String, String> tags, String parent, Long iops, String template,
23+
String baseOn, String rename, Boolean shrinkOk) {
24+
super();
25+
this.name = name;
26+
this.size = size;
27+
this.tags = tags;
28+
this.parent = parent;
29+
this.iops = iops;
30+
this.template = template;
31+
this.baseOn = baseOn;
32+
this.rename = rename;
33+
this.shrinkOk = shrinkOk;
34+
}
35+
36+
public String getName() {
37+
return name;
38+
}
39+
public void setName(String name) {
40+
this.name = name;
41+
}
42+
public Long getSize() {
43+
return size;
44+
}
45+
public void setSize(Long size) {
46+
this.size = size;
47+
}
48+
public Map<String, String> getTags() {
49+
return tags;
50+
}
51+
public void setTags(Map<String, String> tags) {
52+
this.tags = tags;
53+
}
54+
public String getParent() {
55+
return parent;
56+
}
57+
public void setParent(String parent) {
58+
this.parent = parent;
59+
}
60+
public Long getIops() {
61+
return iops;
62+
}
63+
public void setIops(Long iops) {
64+
this.iops = iops;
65+
}
66+
public String getTemplate() {
67+
return template;
68+
}
69+
public void setTemplate(String template) {
70+
this.template = template;
71+
}
72+
public String getBaseOn() {
73+
return baseOn;
74+
}
75+
public void setBaseOn(String baseOn) {
76+
this.baseOn = baseOn;
77+
}
78+
public String getRename() {
79+
return rename;
80+
}
81+
public void setRename(String rename) {
82+
this.rename = rename;
83+
}
84+
85+
public Boolean getShrinkOk() {
86+
return shrinkOk;
87+
}
88+
89+
public void setShrinkOk(Boolean shrinkOk) {
90+
this.shrinkOk = shrinkOk;
91+
}
92+
}

0 commit comments

Comments
 (0)