Skip to content

Commit c27c694

Browse files
Funsyadvr
authored andcommitted
hypervisors: add OVM3 plugin that supports OVM 3.2.1/3.3.x
This is a plugin that puts in ovm3 support ranging from 3.3.1 to 3.3.2. Basic functionality is in here, advanced networking etc.. Snapshots only work when a VM is stopped now due to the semantics of OVM's raw image implementation (so snapshots should work on a storage level underneath the hypervisor shrug) This closes #113 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent ff9ab5c commit c27c694

File tree

107 files changed

+18183
-44
lines changed

Some content is hidden

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

107 files changed

+18183
-44
lines changed

api/src/com/cloud/hypervisor/Hypervisor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public static enum HypervisorType {
3131
BareMetal,
3232
Simulator,
3333
Ovm,
34+
Ovm3,
3435
LXC,
3536

3637
Any; /*If you don't care about the hypervisor type*/
@@ -61,6 +62,8 @@ public static HypervisorType getType(String hypervisor) {
6162
return HypervisorType.LXC;
6263
} else if (hypervisor.equalsIgnoreCase("Any")) {
6364
return HypervisorType.Any;
65+
} else if (hypervisor.equalsIgnoreCase("Ovm3")) {
66+
return HypervisorType.Ovm3;
6467
} else {
6568
return HypervisorType.None;
6669
}
@@ -81,6 +84,8 @@ public static ImageFormat getSupportedImageFormat(HypervisorType hyperType) {
8184
return ImageFormat.OVA;
8285
} else if (hyperType == HypervisorType.Ovm) {
8386
return ImageFormat.RAW;
87+
} else if (hyperType == HypervisorType.Ovm3) {
88+
return ImageFormat.RAW;
8489
} else {
8590
return null;
8691
}

api/src/com/cloud/network/NetworkService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ Pair<List<? extends PhysicalNetworkServiceProvider>, Integer> listNetworkService
111111
long findPhysicalNetworkId(long zoneId, String tag, TrafficType trafficType);
112112

113113
PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficType, String isolationMethod, String xenLabel, String kvmLabel, String vmwareLabel,
114-
String simulatorLabel, String vlan, String hypervLabel);
114+
String simulatorLabel, String vlan, String hypervLabel, String ovm3label);
115115

116116
PhysicalNetworkTrafficType getPhysicalNetworkTrafficType(Long id);
117117

118-
PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel, String hypervLabel);
118+
PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel, String hypervLabel, String ovm3label);
119119

120120
boolean deletePhysicalNetworkTrafficType(Long id);
121121

api/src/com/cloud/network/PhysicalNetworkTrafficType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ public interface PhysicalNetworkTrafficType extends InternalIdentity, Identity {
3939
String getSimulatorNetworkLabel();
4040

4141
String getHypervNetworkLabel();
42+
43+
String getOvm3NetworkLabel();
4244
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ public class ApiConstants {
384384
public static final String KVM_NETWORK_LABEL = "kvmnetworklabel";
385385
public static final String VMWARE_NETWORK_LABEL = "vmwarenetworklabel";
386386
public static final String HYPERV_NETWORK_LABEL = "hypervnetworklabel";
387+
public static final String OVM3_NETWORK_LABEL = "ovm3networklabel";
387388
public static final String NETWORK_SERVICE_PROVIDER_ID = "nspid";
388389
public static final String SERVICE_LIST = "servicelist";
389390
public static final String CAN_ENABLE_INDIVIDUAL_SERVICE = "canenableindividualservice";
@@ -614,6 +615,9 @@ public class ApiConstants {
614615
public static final String STRECHED_L2_SUBNET = "strechedl2subnet";
615616
public static final String NETWORK_SPANNED_ZONES = "zonesnetworkspans";
616617
public static final String PHYSICAL_SIZE = "physicalsize";
618+
public static final String OVM3_POOL = "ovm3pool";
619+
public static final String OVM3_CLUSTER = "ovm3cluster";
620+
public static final String OVM3_VIP = "ovm3vip";
617621

618622
public enum HostDetails {
619623
all, capacity, events, stats, min;

api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class AddClusterCmd extends BaseCmd {
6666
@Parameter(name = ApiConstants.HYPERVISOR,
6767
type = CommandType.STRING,
6868
required = true,
69-
description = "hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")
69+
description = "hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator,Ovm3")
7070
private String hypervisor;
7171

7272
@Parameter(name = ApiConstants.CLUSTER_TYPE, type = CommandType.STRING, required = true, description = "type of the cluster: CloudManaged, ExternalManaged")
@@ -108,6 +108,22 @@ public class AddClusterCmd extends BaseCmd {
108108
description = "Name of virtual switch used for public traffic in the cluster. This would override zone wide traffic label setting.")
109109
private String vSwitchNamePublicTraffic;
110110

111+
@Parameter(name = ApiConstants.OVM3_POOL, type = CommandType.STRING, required = false, description = "Ovm3 native pooling enabled for cluster")
112+
private String ovm3pool;
113+
@Parameter(name = ApiConstants.OVM3_CLUSTER, type = CommandType.STRING, required = false, description = "Ovm3 native OCFS2 clustering enabled for cluster")
114+
private String ovm3cluster;
115+
@Parameter(name = ApiConstants.OVM3_VIP, type = CommandType.STRING, required = false, description = "Ovm3 vip to use for pool (and cluster)")
116+
private String ovm3vip;
117+
public String getOvm3Pool() {
118+
return ovm3pool;
119+
}
120+
public String getOvm3Cluster() {
121+
return ovm3cluster;
122+
}
123+
public String getOvm3Vip() {
124+
return ovm3vip;
125+
}
126+
111127
public String getVSwitchTypeGuestTraffic() {
112128
return vSwitchTypeGuestTraffic;
113129
}

api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
7575
description = "The network name label of the physical device dedicated to this traffic on a Hyperv host")
7676
private String hypervLabel;
7777

78+
@Parameter(name = ApiConstants.OVM3_NETWORK_LABEL,
79+
type = CommandType.STRING,
80+
description = "The network name of the physical device dedicated to this traffic on an OVM3 host")
81+
private String ovm3Label;
82+
7883
@Parameter(name = ApiConstants.VLAN, type = CommandType.STRING, description = "The VLAN id to be used for Management traffic by VMware host")
7984
private String vlan;
8085

@@ -115,6 +120,10 @@ public String getSimulatorLabel() {
115120
return null;
116121
}
117122

123+
public String getOvm3Label() {
124+
return ovm3Label;
125+
}
126+
118127
public void setVlan(String vlan) {
119128
this.vlan = vlan;
120129
}
@@ -162,7 +171,7 @@ public void execute() {
162171
public void create() throws ResourceAllocationException {
163172
PhysicalNetworkTrafficType result =
164173
_networkService.addTrafficTypeToPhysicalNetwork(getPhysicalNetworkId(), getTrafficType(), getIsolationMethod(), getXenLabel(), getKvmLabel(), getVmwareLabel(),
165-
getSimulatorLabel(), getVlan(), getHypervLabel());
174+
getSimulatorLabel(), getVlan(), getHypervLabel(), getOvm3Label());
166175
if (result != null) {
167176
setEntityId(result.getId());
168177
setEntityUuid(result.getUuid());

api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
6565
description = "The network name label of the physical device dedicated to this traffic on a Hyperv host")
6666
private String hypervLabel;
6767

68+
@Parameter(name = ApiConstants.OVM3_NETWORK_LABEL,
69+
type = CommandType.STRING,
70+
description = "The network name of the physical device dedicated to this traffic on an OVM3 host")
71+
private String ovm3Label;
72+
6873
/////////////////////////////////////////////////////
6974
/////////////////// Accessors ///////////////////////
7075
/////////////////////////////////////////////////////
@@ -89,6 +94,10 @@ public String getHypervLabel() {
8994
return hypervLabel;
9095
}
9196

97+
public String getOvm3Label() {
98+
return ovm3Label;
99+
}
100+
92101
/////////////////////////////////////////////////////
93102
/////////////// API Implementation///////////////////
94103
/////////////////////////////////////////////////////
@@ -105,7 +114,7 @@ public long getEntityOwnerId() {
105114

106115
@Override
107116
public void execute() {
108-
PhysicalNetworkTrafficType result = _networkService.updatePhysicalNetworkTrafficType(getId(), getXenLabel(), getKvmLabel(), getVmwareLabel(), getHypervLabel());
117+
PhysicalNetworkTrafficType result = _networkService.updatePhysicalNetworkTrafficType(getId(), getXenLabel(), getKvmLabel(), getVmwareLabel(), getHypervLabel(), getOvm3Label());
109118
if (result != null) {
110119
TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
111120
response.setResponseName(getCommandName());

api/src/org/apache/cloudstack/api/response/ClusterResponse.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public class ClusterResponse extends BaseResponse {
8282
@Param(description = "The memory overcommit ratio of the cluster")
8383
private String memoryovercommitratio;
8484

85+
@SerializedName("ovm3vip")
86+
@Param(description = "Ovm3 VIP to use for pooling and/or clustering")
87+
private String ovm3vip;
88+
8589
public String getId() {
8690
return id;
8791
}
@@ -185,4 +189,12 @@ public void setMemoryOvercommitRatio(String memoryovercommitratio) {
185189
public String getMemoryOvercommitRatio() {
186190
return memoryovercommitratio;
187191
}
192+
193+
public void setOvm3Vip(String ovm3vip) {
194+
this.ovm3vip = ovm3vip;
195+
}
196+
197+
public String getOvm3Vip() {
198+
return ovm3vip;
199+
}
188200
}

api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public class TrafficTypeResponse extends BaseResponse {
5656
@Param(description = "The network name label of the physical device dedicated to this traffic on a HyperV host")
5757
private String hypervNetworkLabel;
5858

59+
@SerializedName(ApiConstants.OVM3_NETWORK_LABEL)
60+
@Param(description = "The network name of the physical device dedicated to this traffic on an OVM3 host")
61+
private String ovm3NetworkLabel;
62+
5963
@Override
6064
public String getObjectId() {
6165
return this.id;
@@ -116,4 +120,12 @@ public void setVmwareLabel(String vmwareNetworkLabel) {
116120
public String getVmwareLabel() {
117121
return vmwareNetworkLabel;
118122
}
123+
124+
public String getOvm3Label() {
125+
return ovm3NetworkLabel;
126+
}
127+
128+
public void setOvm3Label(String ovm3Label) {
129+
this.ovm3NetworkLabel = ovm3Label;
130+
}
119131
}

client/WEB-INF/classes/resources/messages.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ label.affinity.group=Affinity Group
387387
label.affinity.groups=Affinity Groups
388388
label.affinity=Affinity
389389
label.agent.password=Agent Password
390+
label.agent.port=Agent Port
390391
label.agent.username=Agent Username
391392
label.agree=Agree
392393
label.alert=Alert
@@ -924,6 +925,9 @@ label.optional=Optional
924925
label.order=Order
925926
label.os.preference=OS Preference
926927
label.os.type=OS Type
928+
label.ovm3.vip=Master Vip IP
929+
label.ovm3.pool=Native Pooling
930+
label.ovm3.cluster=Native Clustering
927931
label.owned.public.ips=Owned Public IP Addresses
928932
label.owner.account=Owner Account
929933
label.owner.domain=Owner Domain

0 commit comments

Comments
 (0)