bug 9578: when deploy dhcp in Basic zone, put pod information to deploymentPlan

status 9578: resolved fixed
This commit is contained in:
alena 2011-04-26 13:22:42 -07:00
parent 6e39019b6a
commit 4290abb57c
5 changed files with 18 additions and 5 deletions

View File

@ -202,6 +202,10 @@ public class NicProfile {
return networkRate;
}
public ReservationStrategy getStrategy() {
return strategy;
}
public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri, Integer networkRate) {
this.id = nic.getId();
this.networkId = network.getId();

View File

@ -1215,6 +1215,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
nic.setNetmask(profile.getNetmask());
nic.setGateway(profile.getGateway());
nic.setAddressFormat(profile.getFormat());
if (profile.getStrategy() != null) {
nic.setReservationStrategy(profile.getStrategy());
}
updateNic(nic, network.getId(), 1);
} else {
profile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), networkRate);

View File

@ -90,8 +90,10 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru {
if (nic == null) {
nic = new NicProfile(ReservationStrategy.Start, null, null, null, null);
} else {
} else if (nic.getIp4Address() == null) {
nic.setStrategy(ReservationStrategy.Start);
} else {
nic.setStrategy(ReservationStrategy.Create);
}
return nic;
@ -102,6 +104,7 @@ public class DirectPodBasedNetworkGuru extends DirectNetworkGuru {
throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException {
if (nic.getIp4Address() == null) {
getIp(nic, dest.getPod(), vm, network);
nic.setStrategy(ReservationStrategy.Create);
}
}

View File

@ -808,7 +808,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
assert guestNetwork.getState() == Network.State.Implemented || guestNetwork.getState() == Network.State.Setup || guestNetwork.getState() == Network.State.Implementing : "Network is not yet fully implemented: "
+ guestNetwork;
DataCenterDeployment plan = new DataCenterDeployment(dcId);
DataCenterDeployment plan = null;
DataCenter dc = _dcDao.findById(dcId);
DomainRouterVO router = null;
Long podId = dest.getPod().getId();
@ -816,8 +816,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
// In Basic zone and Guest network we have to start domR per pod, not per network
if ((dc.getNetworkType() == NetworkType.Basic || guestNetwork.isSecurityGroupEnabled()) && guestNetwork.getTrafficType() == TrafficType.Guest) {
router = _routerDao.findByNetworkAndPod(guestNetwork.getId(), podId);
plan = new DataCenterDeployment(dcId, podId, null, null, null);
} else {
router = _routerDao.findByNetwork(guestNetwork.getId());
plan = new DataCenterDeployment(dcId);
}
if (router == null) {

View File

@ -99,7 +99,7 @@ public class NicVO implements Nic {
@Column(name="strategy")
@Enumerated(value=EnumType.STRING)
ReservationStrategy strategy;
ReservationStrategy reservationStrategy;
@Enumerated(value=EnumType.STRING)
@Column(name="vm_type")
@ -250,7 +250,7 @@ public class NicVO implements Nic {
public void setReservationStrategy(ReservationStrategy strategy) {
this.strategy = strategy;
this.reservationStrategy = strategy;
}
public void setDeviceId(int deviceId) {
@ -277,7 +277,7 @@ public class NicVO implements Nic {
@Override
public ReservationStrategy getReservationStrategy() {
return strategy;
return reservationStrategy;
}
@Override