Skip to content

Commit 4e77f68

Browse files
Storage plugin for Dell EMC PowerFlex/ScaleIO (formerly VxFlexOS)
1 parent c732865 commit 4e77f68

File tree

115 files changed

+6665
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+6665
-337
lines changed

agent/conf/agent.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ hypervisor.type=kvm
143143
# This parameter specifies a directory on the host local storage for temporary storing direct download templates
144144
#direct.download.temporary.download.location=/var/lib/libvirt/images
145145

146+
# This parameter specifies a directory on the host local storage for creating and hosting the config drives
147+
#host.cache.location=/var/cache/cloud
148+
146149
# set the rolling maintenance hook scripts directory
147150
#rolling.maintenance.hooks.dir=/etc/cloudstack/agent/hooks.d
148151

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import com.cloud.agent.api.LogLevel;
2424
import com.cloud.agent.api.storage.OVFPropertyTO;
25+
import com.cloud.network.element.NetworkElement;
2526
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
2627
import com.cloud.utils.Pair;
2728
import com.cloud.vm.VirtualMachine;
@@ -76,6 +77,7 @@ public class VirtualMachineTO {
7677
String configDriveLabel = null;
7778
String configDriveIsoRootFolder = null;
7879
String configDriveIsoFile = null;
80+
NetworkElement.Location configDriveLocation = NetworkElement.Location.SECONDARY;
7981

8082
Double cpuQuotaPercentage = null;
8183

@@ -353,6 +355,18 @@ public void setConfigDriveIsoFile(String configDriveIsoFile) {
353355
this.configDriveIsoFile = configDriveIsoFile;
354356
}
355357

358+
public boolean isConfigDriveOnHostCache() {
359+
return (this.configDriveLocation == NetworkElement.Location.HOST);
360+
}
361+
362+
public NetworkElement.Location getConfigDriveLocation() {
363+
return configDriveLocation;
364+
}
365+
366+
public void setConfigDriveLocation(NetworkElement.Location configDriveLocation) {
367+
this.configDriveLocation = configDriveLocation;
368+
}
369+
356370
public Map<String, String> getGuestOsDetails() {
357371
return guestOsDetails;
358372
}

api/src/main/java/com/cloud/network/element/NetworkElement.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
*/
4040
public interface NetworkElement extends Adapter {
4141

42+
enum Location {
43+
SECONDARY, PRIMARY, HOST
44+
}
45+
4246
Map<Service, Map<Capability, String>> getCapabilities();
4347

4448
/**

api/src/main/java/com/cloud/storage/Storage.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public static enum StoragePoolType {
135135
OCFS2(true, false),
136136
SMB(true, false),
137137
Gluster(true, false),
138+
PowerFlex(true, true),
138139
ManagedNFS(true, false);
139140

140141
private final boolean shared;

api/src/main/java/com/cloud/storage/Volume.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
import com.cloud.utils.fsm.StateObject;
3030

3131
public interface Volume extends ControlledEntity, Identity, InternalIdentity, BasedOn, StateObject<Volume.State>, Displayable {
32+
33+
// Managed storage volume parameters (specified in the compute/disk offering for PowerFlex)
34+
String BANDWIDTH_LIMIT_IN_MBPS = "bandwidthLimitInMbps";
35+
String IOPS_LIMIT = "iopsLimit";
36+
3237
enum Type {
3338
UNKNOWN, ROOT, SWAP, DATADISK, ISO
3439
};

api/src/main/java/com/cloud/vm/VirtualMachineProfile.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
import java.util.Map;
2121

2222
import com.cloud.agent.api.to.DiskTO;
23+
import com.cloud.host.Host;
2324
import com.cloud.hypervisor.Hypervisor.HypervisorType;
25+
import com.cloud.network.element.NetworkElement;
2426
import com.cloud.offering.ServiceOffering;
2527
import com.cloud.template.VirtualMachineTemplate;
2628
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
@@ -54,6 +56,10 @@ public interface VirtualMachineProfile {
5456

5557
void setConfigDriveIsoFile(String isoFile);
5658

59+
NetworkElement.Location getConfigDriveLocation();
60+
61+
void setConfigDriveLocation(NetworkElement.Location location);
62+
5763
public static class Param {
5864

5965
public static final Param VmPassword = new Param("VmPassword");
@@ -100,6 +106,10 @@ public boolean equals(Object obj) {
100106
}
101107
}
102108

109+
Long getHostId();
110+
111+
void setHost(Host host);
112+
103113
String getHostName();
104114

105115
String getInstanceName();

api/src/main/java/com/cloud/vm/VmDetailConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public interface VmDetailConstants {
5656
String PASSWORD = "password";
5757
String ENCRYPTED_PASSWORD = "Encrypted.Password";
5858

59+
String CONFIG_DRIVE_LOCATION = "configDriveLocation";
60+
5961
// VM import with nic, disk and custom params for custom compute offering
6062
String NIC = "nic";
6163
String NETWORK = "network";

api/src/main/java/org/apache/cloudstack/alert/AlertService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
// under the License.
1717
package org.apache.cloudstack.alert;
1818

19-
import com.cloud.capacity.Capacity;
20-
import com.cloud.exception.InvalidParameterValueException;
21-
2219
import java.util.HashSet;
2320
import java.util.Set;
2421

22+
import com.cloud.capacity.Capacity;
23+
import com.cloud.exception.InvalidParameterValueException;
24+
2525
public interface AlertService {
2626
public static class AlertType {
2727
private static Set<AlertType> defaultAlertTypes = new HashSet<AlertType>();
@@ -69,6 +69,7 @@ private AlertType(short type, String name, boolean isDefault) {
6969
public static final AlertType ALERT_TYPE_OOBM_AUTH_ERROR = new AlertType((short)29, "ALERT.OOBM.AUTHERROR", true);
7070
public static final AlertType ALERT_TYPE_HA_ACTION = new AlertType((short)30, "ALERT.HA.ACTION", true);
7171
public static final AlertType ALERT_TYPE_CA_CERT = new AlertType((short)31, "ALERT.CA.CERT", true);
72+
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
7273

7374
public short getType() {
7475
return type;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,8 @@ public class ApiConstants {
819819
public static final String BOOT_MODE = "bootmode";
820820
public static final String BOOT_INTO_SETUP = "bootintosetup";
821821

822+
public static final String POOL_TYPE ="pooltype";
823+
822824
public enum BootType {
823825
UEFI, BIOS;
824826

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
// under the License.
1717
package org.apache.cloudstack.api.command.admin.offering;
1818

19+
import java.util.Collection;
20+
import java.util.HashMap;
1921
import java.util.LinkedHashSet;
2022
import java.util.List;
23+
import java.util.Map;
2124
import java.util.Set;
2225

2326
import org.apache.cloudstack.api.APICommand;
@@ -30,6 +33,7 @@
3033
import org.apache.cloudstack.api.response.DomainResponse;
3134
import org.apache.cloudstack.api.response.ZoneResponse;
3235
import org.apache.commons.collections.CollectionUtils;
36+
import org.apache.commons.collections.MapUtils;
3337
import org.apache.log4j.Logger;
3438

3539
import com.cloud.offering.DiskOffering;
@@ -151,6 +155,9 @@ public class CreateDiskOfferingCmd extends BaseCmd {
151155
since = "4.14")
152156
private String cacheMode;
153157

158+
@Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, description = "details to specify disk offering parameters")
159+
private Map details;
160+
154161
/////////////////////////////////////////////////////
155162
/////////////////// Accessors ///////////////////////
156163
/////////////////////////////////////////////////////
@@ -273,6 +280,20 @@ public String getCacheMode() {
273280
return cacheMode;
274281
}
275282

283+
public Map<String, String> getDetails() {
284+
Map<String, String> detailsMap = new HashMap<>();
285+
if (MapUtils.isNotEmpty(details)) {
286+
Collection<?> props = details.values();
287+
for (Object prop : props) {
288+
HashMap<String, String> detail = (HashMap<String, String>) prop;
289+
for (Map.Entry<String, String> entry: detail.entrySet()) {
290+
detailsMap.put(entry.getKey(),entry.getValue());
291+
}
292+
}
293+
}
294+
return detailsMap;
295+
}
296+
276297
/////////////////////////////////////////////////////
277298
/////////////// API Implementation///////////////////
278299
/////////////////////////////////////////////////////

0 commit comments

Comments
 (0)