Skip to content

Commit 2fd6fac

Browse files
committed
Merge pull request apache#898 from bvbharatk/CLOUDSTACK-8902
CLOUDSTACK-8902 Restart Network fails in EIP/ELB zoneThe restart network was failing when using external loadbalencer. The failure was because of a number format exception. When BroadcastDomainType.getValue(guestConfig.getBroadcastUri() is executed this returns a string untagged. We were trying to parse this as long so there was a number pointer exception. This happens only when the vlan uri is vlan://untagged. in other cases were there is a number instead of untagged (vlan tag) this used to succeed. Although we were trying to convert the number to long we were not really using it. we were converting the number to long and then back to string when creating the IpAddressTo. so I removed this unnecessary conversion in this case for fixing the issue at hand. I did a manual restart of the network and checked for this number format exception in a EIP/ELB setup. * pr/898: CLOUDSTACK-89027 Restart Network fails in EIP/ELB zone Signed-off-by: Remi Bergsma <github@remi.nl>
2 parents 6f2e6a7 + 3c61746 commit 2fd6fac

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ public boolean manageGuestNetworkWithExternalLoadBalancer(boolean add, Network g
10091009
}
10101010

10111011
// Send a command to the external load balancer to implement or shutdown the guest network
1012-
long guestVlanTag = Long.parseLong(BroadcastDomainType.getValue(guestConfig.getBroadcastUri()));
1012+
String guestVlanTag = BroadcastDomainType.getValue(guestConfig.getBroadcastUri());
10131013
String selfIp = null;
10141014
String guestVlanNetmask = NetUtils.cidr2Netmask(guestConfig.getCidr());
10151015
Integer networkRate = _networkModel.getNetworkRate(guestConfig.getId(), null);
@@ -1042,7 +1042,7 @@ public boolean manageGuestNetworkWithExternalLoadBalancer(boolean add, Network g
10421042
// It's a hack, using isOneToOneNat field for indicate if it's inline or not
10431043
boolean inline = _networkMgr.isNetworkInlineMode(guestConfig);
10441044
IpAddressTO ip =
1045-
new IpAddressTO(guestConfig.getAccountId(), null, add, false, true, String.valueOf(guestVlanTag), selfIp, guestVlanNetmask, null, networkRate, inline);
1045+
new IpAddressTO(guestConfig.getAccountId(), null, add, false, true, guestVlanTag, selfIp, guestVlanNetmask, null, networkRate, inline);
10461046
IpAddressTO[] ips = new IpAddressTO[1];
10471047
ips[0] = ip;
10481048
IpAssocCommand cmd = new IpAssocCommand(ips);

0 commit comments

Comments
 (0)