restartNetwork: don't try to disassoc the sourceNat IP on the domR

This commit is contained in:
Alena Prokharchyk 2011-12-05 17:28:08 -08:00
parent 84394ac3d4
commit d836699209
3 changed files with 10 additions and 5 deletions

View File

@ -75,4 +75,6 @@ public interface IpAddress extends ControlledEntity {
* @return database id.
*/
long getId();
void setState(IpAddress.State state);
}

View File

@ -176,4 +176,9 @@ public class PublicIp implements PublicIpAddress {
public Long getPhysicalNetworkId() {
return _vlan.getPhysicalNetworkId();
}
@Override
public void setState(State state) {
_addr.setState(state);
}
}

View File

@ -2365,9 +2365,9 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
if (ipList == null) {
ipList = new ArrayList<PublicIpAddress>();
}
//domR doesn't support release for sourceNat IP address
//domR doesn't support release for sourceNat IP address; so reset the state
if (ipAddress.isSourceNat() && ipAddress.getState() == IpAddress.State.Releasing) {
continue;
ipAddress.setState(IpAddress.State.Allocated);
}
ipList.add(ipAddress);
vlanIpMap.put(vlanTag, ipList);
@ -2412,8 +2412,6 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
if (!firstIP || add) {
firstIP = false;
}
}
IpAssocCommand cmd = new IpAssocCommand(ipsToSend);
cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, router.getPrivateIpAddress());
@ -2689,7 +2687,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
// Have to resend all already associated ip addresses
createAssociateIPCommands(router, ipAddress, cmds, 0);
try{
try{
result = sendCommandsToRouter(router, cmds);
connectedRouters.add(router);
} catch (AgentUnavailableException e) {