mirror of https://github.com/apache/cloudstack.git
Fixing null pointers during vpc router deployment
This commit is contained in:
parent
bfd4316b58
commit
f23ba91ed1
|
|
@ -538,7 +538,7 @@ public class NetworkGeneralHelper {
|
|||
hypervisors.add(defaults);
|
||||
} else {
|
||||
//if there is no default hypervisor, get it from the cluster
|
||||
hypervisors = resourceMgr.getSupportedHypervisorTypes(dest.getDataCenter().getId(), true, routerDeploymentDefinition.getPodId());
|
||||
hypervisors = resourceMgr.getSupportedHypervisorTypes(dest.getDataCenter().getId(), true, routerDeploymentDefinition.getPlan().getPodId());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ public class RouterDeploymentDefinition {
|
|||
return dest.getPod();
|
||||
}
|
||||
public Long getPodId() {
|
||||
return dest.getPod().getId();
|
||||
return dest.getPod() == null ? null : dest.getPod().getId();
|
||||
}
|
||||
|
||||
public List<DomainRouterVO> getRouters() {
|
||||
|
|
@ -207,7 +207,6 @@ public class RouterDeploymentDefinition {
|
|||
this.plan = new DataCenterDeployment(dcId, podId, null, null, null, null);
|
||||
}
|
||||
|
||||
|
||||
public List<DomainRouterVO> deployVirtualRouter()
|
||||
throws InsufficientCapacityException,
|
||||
ConcurrentOperationException, ResourceUnavailableException {
|
||||
|
|
|
|||
|
|
@ -7,12 +7,10 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.dc.dao.VlanDao;
|
||||
import com.cloud.deploy.DataCenterDeployment;
|
||||
import com.cloud.deploy.DeployDestination;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
|
|
@ -22,7 +20,6 @@ import com.cloud.exception.ResourceUnavailableException;
|
|||
import com.cloud.exception.StorageUnavailableException;
|
||||
import com.cloud.network.IpAddress;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.NetworkModel;
|
||||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.Networks.IsolationType;
|
||||
import com.cloud.network.PhysicalNetwork;
|
||||
|
|
@ -30,11 +27,8 @@ import com.cloud.network.PhysicalNetworkServiceProvider;
|
|||
import com.cloud.network.VirtualRouterProvider;
|
||||
import com.cloud.network.VirtualRouterProvider.Type;
|
||||
import com.cloud.network.addr.PublicIp;
|
||||
import com.cloud.network.dao.IPAddressDao;
|
||||
import com.cloud.network.dao.IPAddressVO;
|
||||
import com.cloud.network.dao.PhysicalNetworkDao;
|
||||
import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
|
||||
import com.cloud.network.dao.VirtualRouterProviderDao;
|
||||
import com.cloud.network.router.VirtualNwStatus;
|
||||
import com.cloud.network.vpc.PrivateGateway;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
|
|
@ -53,27 +47,11 @@ import com.cloud.vm.VirtualMachineProfile.Param;
|
|||
public class VpcRouterDeploymentDefinition extends RouterDeploymentDefinition {
|
||||
private static final Logger logger = Logger.getLogger(VpcRouterDeploymentDefinition.class);
|
||||
|
||||
@Inject
|
||||
protected VpcDao vpcDao;
|
||||
@Inject
|
||||
protected VpcOfferingDao vpcOffDao;
|
||||
@Inject
|
||||
protected PhysicalNetworkDao pNtwkDao;
|
||||
@Inject
|
||||
protected VpcManager vpcMgr;
|
||||
@Inject
|
||||
protected PhysicalNetworkServiceProviderDao physicalProviderDao;
|
||||
@Inject
|
||||
protected VlanDao vlanDao;
|
||||
@Inject
|
||||
protected IPAddressDao ipAddressDao;
|
||||
@Inject
|
||||
protected NetworkOrchestrationService networkMgr;
|
||||
@Inject
|
||||
protected NetworkModel networkModel;
|
||||
@Inject
|
||||
protected VirtualRouterProviderDao vrProviderDao;
|
||||
|
||||
|
||||
protected Vpc vpc;
|
||||
|
||||
|
|
@ -86,6 +64,11 @@ public class VpcRouterDeploymentDefinition extends RouterDeploymentDefinition {
|
|||
this.vpc = vpc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vpc getVpc() {
|
||||
return this.vpc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVpcRouter() {
|
||||
return true;
|
||||
|
|
@ -238,4 +221,9 @@ public class VpcRouterDeploymentDefinition extends RouterDeploymentDefinition {
|
|||
this.routers = vpcHelper.getVpcRouters(this.getVpc().getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateDeploymentPlan() {
|
||||
final long dcId = this.dest.getDataCenter().getId();
|
||||
this.plan = new DataCenterDeployment(dcId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue