Skip to content

Commit f47cfc6

Browse files
author
Sheng Yang
committed
CLOUDSTACK-7186: Revert "CLOUDSTACK-7182: NPE while trying to deploy VMs in parallel in isolated network"
This reverts commit 47d6a64, which broke VPC completely.
1 parent 45c9f03 commit f47cfc6

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ protected NicTO toNicTO(NicVO nic, NicProfile profile, NetworkVO config) {
925925

926926
boolean isNetworkImplemented(NetworkVO network) {
927927
Network.State state = network.getState();
928-
if (state == Network.State.Implemented) {
928+
if (state == Network.State.Implemented || state == Network.State.Implementing) {
929929
return true;
930930
} else if (state == Network.State.Setup) {
931931
DataCenterVO zone = _dcDao.findById(network.getDataCenterId());
@@ -1277,19 +1277,7 @@ public int compare(NicVO nic1, NicVO nic2) {
12771277
});
12781278

12791279
for (NicVO nic : nics) {
1280-
Pair<NetworkGuru, NetworkVO> implemented = null;
1281-
if (vmProfile.getVirtualMachine().getType() != Type.DomainRouter) {
1282-
implemented = implementNetwork(nic.getNetworkId(), dest, context);
1283-
} else {
1284-
// At the time of implementing network (using implementNetwork() method), if the VR needs to be deployed then
1285-
// it follows the same path of regular VM deployment. This leads to a nested call to implementNetwork() while
1286-
// preparing VR nics. This flow creates issues in dealing with network state transitions. The original call
1287-
// puts network in "Implementing" state and then the nested call again tries to put it into same state resulting
1288-
// in issues. In order to avoid it, implementNetwork() call for VR is replaced with below code.
1289-
NetworkVO network = _networksDao.findById(nic.getNetworkId());
1290-
NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
1291-
implemented = new Pair<NetworkGuru, NetworkVO>(guru, network);
1292-
}
1280+
Pair<NetworkGuru, NetworkVO> implemented = implementNetwork(nic.getNetworkId(), dest, context);
12931281
if (implemented == null || implemented.first() == null) {
12941282
s_logger.warn("Failed to implement network id=" + nic.getNetworkId() + " as a part of preparing nic id=" + nic.getId());
12951283
throw new CloudRuntimeException("Failed to implement network id=" + nic.getNetworkId() + " as a part preparing nic id=" + nic.getId());

0 commit comments

Comments
 (0)