weizhouapache commented on a change in pull request #5873:
URL: https://github.com/apache/cloudstack/pull/5873#discussion_r786717941
##########
File path: server/src/main/java/com/cloud/network/NetworkServiceImpl.java
##########
@@ -2065,10 +2071,14 @@ public boolean restartNetwork(Long networkId, boolean
cleanup, boolean makeRedun
public boolean restartNetwork(RestartNetworkCmd cmd) throws
ConcurrentOperationException, ResourceUnavailableException,
InsufficientCapacityException {
// This method restarts all network elements belonging to the network
and re-applies all the rules
Long networkId = cmd.getNetworkId();
+ NetworkVO network = getNetworkVO(cmd.getNetworkId(),"Nework to restart
not found %s", String.valueOf(networkId));
boolean cleanup = cmd.getCleanup();
+ if (network.getVpcId() != null && cleanup) {
+ throwInvalidIdException("Cannot restart a VPC tier with cleanup,
please restart the whole VPC", network.getUuid(), "network tier");
Review comment:
should throw `InvalidIdException` or another exception ?
##########
File path: server/src/main/java/com/cloud/network/NetworkServiceImpl.java
##########
@@ -2065,10 +2071,14 @@ public boolean restartNetwork(Long networkId, boolean
cleanup, boolean makeRedun
public boolean restartNetwork(RestartNetworkCmd cmd) throws
ConcurrentOperationException, ResourceUnavailableException,
InsufficientCapacityException {
// This method restarts all network elements belonging to the network
and re-applies all the rules
Long networkId = cmd.getNetworkId();
+ NetworkVO network = getNetworkVO(cmd.getNetworkId(),"Nework to restart
not found %s", String.valueOf(networkId));
boolean cleanup = cmd.getCleanup();
+ if (network.getVpcId() != null && cleanup) {
Review comment:
should remove guest nic and re-add guest nic, or forbid the behavior ?
each option has pros and cons.
if restarting vpc tier is forbidden, UI needs to be updated as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]