CLOUDSTACK-4025. NPE observed during VM start.

NPE was hit during VM start because the network it was to be deployed in didn't get implemented - Handling this failure.
This commit is contained in:
Likitha Shetty 2013-08-07 13:21:57 +05:30
parent 23aaeafd21
commit 74293f77e0

View File

@ -2080,6 +2080,10 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
for (NicVO nic : nics) {
Pair<NetworkGuru, NetworkVO> implemented = implementNetwork(nic.getNetworkId(), dest, context);
if (implemented.first() == null) {
s_logger.warn("Failed to implement network id=" + nic.getNetworkId() + " as a part of preparing nic id=" + nic.getId());
throw new CloudRuntimeException("Failed to implement network id=" + nic.getNetworkId() + " as a part preparing nic id=" +nic.getId());
}
NetworkVO network = implemented.second();
NicProfile profile = prepareNic(vmProfile, dest, context, nic.getId(), network);