Skip to content

Commit e350f1e

Browse files
Turn a single VPC into a redundant VPC
- when restarting a VPC, the user can check the option Make Redundant in order to change the VPC offering and make it redundant
1 parent 87d4171 commit e350f1e

19 files changed

Lines changed: 82 additions & 22 deletions

File tree

‎api/src/com/cloud/network/vpc/VpcService.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,12 @@ public Pair<List<? extends Vpc>, Integer> listVpcs(Long id, String vpcName, Stri
127127
* Restarts the VPC. VPC gets shutdown and started as a part of it
128128
*
129129
* @param id
130+
* @param cleanUp
131+
* @param makeredundant
130132
* @return
131133
* @throws InsufficientCapacityException
132134
*/
133-
boolean restartVpc(long id, boolean cleanUp) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
135+
boolean restartVpc(long id, boolean cleanUp, boolean makeredundant) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
134136

135137
/**
136138
* Returns a Private gateway found in the VPC by id

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class ApiConstants {
4848
public static final String IP6_CIDR = "ip6cidr";
4949
public static final String CIDR_LIST = "cidrlist";
5050
public static final String CLEANUP = "cleanup";
51+
public static final String MAKEREDUNDANTE = "makeredundant";
5152
public static final String CLUSTER_ID = "clusterid";
5253
public static final String CLUSTER_NAME = "clustername";
5354
public static final String CLUSTER_TYPE = "clustertype";
@@ -450,7 +451,7 @@ public class ApiConstants {
450451
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_NAME = "vsmdevicename";
451452
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_STATE = "vsmdevicestate";
452453
// Would we need to have a capacity field for Cisco N1KV VSM? Max hosts managed by it perhaps? May remove this
453-
// later.
454+
// later.
454455
public static final String EXTERNAL_SWITCH_MGMT_DEVICE_CAPACITY = "vsmdevicecapacity";
455456
public static final String CISCO_NEXUS_VSM_NAME = "vsmname";
456457
public static final String VSM_USERNAME = "vsmusername";

‎api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public class RestartVPCCmd extends BaseAsyncCmd {
5151
@Parameter(name = ApiConstants.CLEANUP, type = CommandType.BOOLEAN, required = false, description = "If cleanup old network elements")
5252
private Boolean cleanup;
5353

54+
@Parameter(name = ApiConstants.MAKEREDUNDANTE, type = CommandType.BOOLEAN, required = false, description = "Turn a single VPC into a redundant one.")
55+
private Boolean makeredundant;
56+
5457
/////////////////////////////////////////////////////
5558
/////////////////// Accessors ///////////////////////
5659
/////////////////////////////////////////////////////
@@ -66,6 +69,13 @@ public Boolean getCleanup() {
6669
return true;
6770
}
6871

72+
public Boolean getMakeredundant() {
73+
if (makeredundant != null) {
74+
return makeredundant;
75+
}
76+
return true;
77+
}
78+
6979
/////////////////////////////////////////////////////
7080
/////////////// API Implementation///////////////////
7181
/////////////////////////////////////////////////////
@@ -87,7 +97,7 @@ public long getEntityOwnerId() {
8797
@Override
8898
public void execute() {
8999
try {
90-
final boolean result = _vpcService.restartVpc(getId(), getCleanup());
100+
final boolean result = _vpcService.restartVpc(getId(), getCleanup(), getMakeredundant());
91101
if (result) {
92102
final SuccessResponse response = new SuccessResponse(getCommandName());
93103
setResponseObject(response);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ label.cidr.list=Source CIDR
450450
label.CIDR.of.destination.network=CIDR of destination network
451451
label.cidr=CIDR
452452
label.clean.up=Clean up
453+
label.make.redundant=Make redundant
453454
label.clear.list=Clear list
454455
label.close=Close
455456
label.cloud.console=Cloud Management Console

‎client/WEB-INF/classes/resources/messages_ar.properties‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ label.change.value=\u062a\u063a\u064a\u0631 \u0627\u0644\u0642\u064a\u0645\u0629
4747
label.CIDR.list=\u0642\u0627\u0626\u0645\u0629 CIDR
4848
label.CIDR.of.destination.network=CIDR \u0627\u0644\u062e\u0627\u0635 \u0628\u0627\u0644\u0634\u0628\u0643\u0629 \u0627\u0644\u0645\u0648\u062c\u0647\u0629.
4949
label.clean.up=\u062a\u0646\u0638\u064a\u0641
50+
label.make.redundant=\u062c\u0639\u0644 \u0632\u0627\u0626\u062f\u0629 \u0639\u0646 \u0627\u0644\u062d\u0627\u062c\u0629
5051
label.clear.list=\u0645\u0633\u062d \u0627\u0644\u0642\u0627\u0626\u0645\u0629
5152
label.configuration=\u0627\u0644\u062a\u0643\u0648\u064a\u0646
5253
label.configure.network.ACLs=\u0636\u0628\u0637 \u0634\u0628\u0643\u0629 ACLs

‎client/WEB-INF/classes/resources/messages_es.properties‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ label.cidr=CIDR
332332
label.cidr.list=fuente CIDR
333333
label.CIDR.list=Lista CIDR
334334
label.clean.up=Limpiar
335+
label.make.redundant=\u0068\u0061\u0063\u0065\u0072 \u0072\u0065\u0064\u0075\u006e\u0064\u0061\u006e\u0074\u0065
335336
label.clear.list=Limpiar lista
336337
label.close=Cerrar
337338
label.cloud.console=Cloud Management Console

‎client/WEB-INF/classes/resources/messages_fr_FR.properties‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ label.cisco.nexus1000v.password=Mot de passe Nexus 1000v
455455
label.cisco.nexus1000v.username=Identifiant Nexus 1000v
456456
label.ciscovnmc.resource.details=D\u00e9tails ressource CiscoVNMC
457457
label.clean.up=Nettoyage
458+
label.make.redundant=\u006c\u0069\u0063\u0065\u006e\u0063\u0069\u0065\u0072
458459
label.clear.list=Purger la liste
459460
label.close=Fermer
460461
label.cloud.console=Console d\\'Administration du Cloud

‎client/WEB-INF/classes/resources/messages_ja_JP.properties‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ label.cidr.list=\u9001\u4fe1\u5143 CIDR
445445
label.CIDR.of.destination.network=\u5b9b\u5148\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e CIDR
446446
label.cidr=CIDR
447447
label.clean.up=\u30af\u30ea\u30fc\u30f3 \u30a2\u30c3\u30d7\u3059\u308b
448+
label.make.redundant=\u5197\u9577\u5316
448449
label.clear.list=\u4e00\u89a7\u306e\u6d88\u53bb
449450
label.close=\u9589\u3058\u308b
450451
label.cloud.console=\u30af\u30e9\u30a6\u30c9\u7ba1\u7406\u30b3\u30f3\u30bd\u30fc\u30eb

‎client/WEB-INF/classes/resources/messages_ko_KR.properties‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ label.CIDR.list=CIDR \ubaa9\ub85d
375375
label.cidr.list=\uc804\uc1a1\uc6d0 CIDR
376376
label.CIDR.of.destination.network=\ub300\uc0c1 \ub124\ud2b8\uc6cc\ud06c CIDR
377377
label.clean.up=\uc0ad\uc81c\ud558\uae30
378+
label.make.redundant=\uc911\ubcf5 \ud655\uc778
378379
label.clear.list=\ubaa9\ub85d \uc0ad\uc81c
379380
label.close=\ub2eb\uae30
380381
label.cloud.console=\ud074\ub77c\uc6b0\ub4dc \uad00\ub9ac \ucf58\uc194

‎client/WEB-INF/classes/resources/messages_nb_NO.properties‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ label.cidr=CIDR
314314
label.CIDR.list=CIDR liste
315315
label.cidr.list=Kilde-CIDR
316316
label.clean.up=Rydd opp
317+
label.make.redundant=\u0067\u006a\u00f8\u0072\u0065 \u006f\u0076\u0065\u0072\u0066\u006c\u00f8\u0064\u0069\u0067
317318
label.clear.list=T\u00f8m liste
318319
label.close=Lukk
319320
label.cloud.console=Cloud

0 commit comments

Comments
 (0)