Skip to content

Commit 8a485b9

Browse files
FunsDaanHoogland
authored andcommitted
CLOUDSTACK-6967: Initial OVM3 drop
Signed-off-by: Sebastien Goasguen <runseb@gmail.com> (cherry picked from commit ed47763) Conflicts: api/src/com/cloud/network/NetworkService.java api/src/org/apache/cloudstack/api/ApiConstants.java api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java plugins/pom.xml server/src/com/cloud/network/NetworkServiceImpl.java server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java server/test/com/cloud/vpc/MockNetworkManagerImpl.java ui/scripts/docs.js
1 parent bbcffbb commit 8a485b9

36 files changed

Lines changed: 354 additions & 47 deletions

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*/
@@ -57,6 +58,8 @@ public static HypervisorType getType(String hypervisor) {
5758
return HypervisorType.Simulator;
5859
} else if (hypervisor.equalsIgnoreCase("Ovm")) {
5960
return HypervisorType.Ovm;
61+
} else if (hypervisor.equalsIgnoreCase("Ovm3")) {
62+
return HypervisorType.Ovm3;
6063
} else if (hypervisor.equalsIgnoreCase("LXC")) {
6164
return HypervisorType.LXC;
6265
} else if (hypervisor.equalsIgnoreCase("Any")) {
@@ -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
@@ -379,6 +379,7 @@ public class ApiConstants {
379379
public static final String LOCAL_STORAGE_ENABLED = "localstorageenabled";
380380
public static final String GUEST_IP_TYPE = "guestiptype";
381381
public static final String XENSERVER_NETWORK_LABEL = "xenservernetworklabel";
382+
public static final String OVM3_NETWORK_LABEL = "ovm3networklabel";
382383
public static final String KVM_NETWORK_LABEL = "kvmnetworklabel";
383384
public static final String VMWARE_NETWORK_LABEL = "vmwarenetworklabel";
384385
public static final String HYPERV_NETWORK_LABEL = "hypervnetworklabel";
@@ -461,6 +462,9 @@ public class ApiConstants {
461462
public static final String VSM_CONFIG_MODE = "vsmconfigmode";
462463
public static final String VSM_CONFIG_STATE = "vsmconfigstate";
463464
public static final String VSM_DEVICE_STATE = "vsmdevicestate";
465+
public static final String OVM3_POOL = "ovm3pool";
466+
public static final String OVM3_CLUSTER = "ovm3cluster";
467+
public static final String OVM3_VIP = "ovm3vip";
464468
public static final String VCENTER = "vcenter";
465469
public static final String ADD_VSM_FLAG = "addvsmflag";
466470
public static final String END_POINT = "endpoint";

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")
@@ -75,6 +75,22 @@ public class AddClusterCmd extends BaseCmd {
7575
@Parameter(name = ApiConstants.ALLOCATION_STATE, type = CommandType.STRING, description = "Allocation state of this cluster for allocation of new resources")
7676
private String allocationState;
7777

78+
@Parameter(name = ApiConstants.OVM3_POOL, type = CommandType.STRING, required = false, description = "Ovm3 native pooling enabled for cluster")
79+
private String ovm3pool;
80+
@Parameter(name = ApiConstants.OVM3_CLUSTER, type = CommandType.STRING, required = false, description = "Ovm3 native OCFS2 clustering enabled for cluster")
81+
private String ovm3cluster;
82+
@Parameter(name = ApiConstants.OVM3_VIP, type = CommandType.STRING, required = false, description = "Ovm3 vip to use for pool (and cluster)")
83+
private String ovm3vip;
84+
public String getOvm3Pool() {
85+
return ovm3pool;
86+
}
87+
public String getOvm3Cluster() {
88+
return ovm3cluster;
89+
}
90+
public String getOvm3Vip() {
91+
return ovm3vip;
92+
}
93+
7894
@Parameter(name = ApiConstants.VSM_USERNAME, type = CommandType.STRING, required = false, description = "the username for the VSM associated with this cluster")
7995
private String vsmusername;
8096

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
@@ -65,6 +65,11 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
6565
description = "The network name label of the physical device dedicated to this traffic on a KVM host")
6666
private String kvmLabel;
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
@Parameter(name = ApiConstants.VMWARE_NETWORK_LABEL,
6974
type = CommandType.STRING,
7075
description = "The network name label of the physical device dedicated to this traffic on a VMware host")
@@ -102,6 +107,10 @@ public String getKvmLabel() {
102107
return kvmLabel;
103108
}
104109

110+
public String getOvm3Label() {
111+
return ovm3Label;
112+
}
113+
105114
public String getVmwareLabel() {
106115
return vmwareLabel;
107116
}
@@ -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
@@ -55,6 +55,11 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
5555
description = "The network name label of the physical device dedicated to this traffic on a KVM host")
5656
private String kvmLabel;
5757

58+
@Parameter(name = ApiConstants.OVM3_NETWORK_LABEL,
59+
type = CommandType.STRING,
60+
description = "The network name of the physical device dedicated to this traffic on an OVM3 host")
61+
private String ovm3Label;
62+
5863
@Parameter(name = ApiConstants.VMWARE_NETWORK_LABEL,
5964
type = CommandType.STRING,
6065
description = "The network name label of the physical device dedicated to this traffic on a VMware host")
@@ -81,6 +86,10 @@ public String getKvmLabel() {
8186
return kvmLabel;
8287
}
8388

89+
public String getOvm3Label() {
90+
return ovm3Label;
91+
}
92+
8493
public String getVmwareLabel() {
8594
return vmwareLabel;
8695
}
@@ -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
@@ -48,6 +48,10 @@ public class TrafficTypeResponse extends BaseResponse {
4848
@Param(description = "The network name label of the physical device dedicated to this traffic on a KVM host")
4949
private String kvmNetworkLabel;
5050

51+
@SerializedName(ApiConstants.OVM3_NETWORK_LABEL)
52+
@Param(description = "The network name of the physical device dedicated to this traffic on an OVM3 host")
53+
private String ovm3NetworkLabel;
54+
5155
@SerializedName(ApiConstants.VMWARE_NETWORK_LABEL)
5256
@Param(description = "The network name label of the physical device dedicated to this traffic on a VMware host")
5357
private String vmwareNetworkLabel;
@@ -93,6 +97,10 @@ public String getKvmLabel() {
9397
return kvmNetworkLabel;
9498
}
9599

100+
public String getOvm3Label() {
101+
return ovm3NetworkLabel;
102+
}
103+
96104
public String getHypervLabel() {
97105
return hypervNetworkLabel;
98106
}
@@ -109,6 +117,10 @@ public void setKvmLabel(String kvmLabel) {
109117
this.kvmNetworkLabel = kvmLabel;
110118
}
111119

120+
public void setOvm3Label(String ovm3Label) {
121+
this.ovm3NetworkLabel = ovm3Label;
122+
}
123+
112124
public void setVmwareLabel(String vmwareNetworkLabel) {
113125
this.vmwareNetworkLabel = vmwareNetworkLabel;
114126
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ label.affinity.groups=Affinity Groups
378378
label.affinity=Affinity
379379
label.agent.password=Agent Password
380380
label.agent.username=Agent Username
381+
label.agent.port=Agent Port
382+
label.ovm3.vip=Master Vip IP
383+
label.ovm3.pool=Native Pooling
384+
label.ovm3.cluster=Native Clustering
381385
label.agree=Agree
382386
label.alert=Alert
383387
label.algorithm=Algorithm

0 commit comments

Comments
 (0)