Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
1a85213
Rules and visitors for Load Balance Rules
Jul 3, 2014
f28426e
Extract general behavior to Router and Vpc delegates
Jul 10, 2014
24b230d
Fix dependency problem. Extract and unify router deployment stuff
Jul 11, 2014
65d7e07
Adding Firewall Rules to comply with the Visitor pattern implementati…
Jul 13, 2014
3457d0f
changing accessor modifier in instance variables
Jul 14, 2014
bbce7d9
fixing checkstyles
wilderrodrigues Jul 14, 2014
4b1112a
finished firewall rules and load balancing rules; fixed all the injec…
wilderrodrigues Jul 14, 2014
f17a0b8
TODO
DaanHoogland Jul 14, 2014
fb8973f
adding static nat rules. Deploying new VMs is not working due to the …
wilderrodrigues Jul 14, 2014
7e98e3e
we have to check if VPC is null bfore calling it. VPC is not used in …
wilderrodrigues Jul 15, 2014
f965fb9
adding apache license headers
wilderrodrigues Jul 15, 2014
6b2d35c
adding Ip Association and VPN Rules
wilderrodrigues Jul 15, 2014
563f853
Fix offering setup
Jul 15, 2014
e1866bf
package rename
DaanHoogland Jul 15, 2014
a982532
Temporary put state info in a state object
Jul 15, 2014
87f0e68
fixing the classes relationship; adding beans properly in the spring …
wilderrodrigues Jul 15, 2014
299c42c
adding password to router rules; moving the advance code to the advan…
wilderrodrigues Jul 15, 2014
631b561
Unify and encapsulate deployment flow methods and params
Jul 15, 2014
f0189ac
adding userdata to router and ssh pub key to router rules.
wilderrodrigues Jul 16, 2014
b9ffe23
making instance variables compliant with ACS convention
wilderrodrigues Jul 16, 2014
8f313ca
adding user data pwd rules
wilderrodrigues Jul 16, 2014
d153296
fixing injection of beans with a relationship
wilderrodrigues Jul 16, 2014
c76952b
whitespace
DaanHoogland Jul 16, 2014
e99b5b0
fixing the injection of the networkDao
wilderrodrigues Jul 16, 2014
95395f9
Deployment more OO - Objects with data and behavior
Jul 16, 2014
869f0ad
replacing my IP by localhost to avoid problems with my environment
wilderrodrigues Jul 17, 2014
0b78731
fixing import in virtual router element and checkstyle in dhcp entry …
wilderrodrigues Jul 17, 2014
e35fded
commenting broken code in tests in order to run build adn tests other…
wilderrodrigues Jul 17, 2014
8437c2f
removing bean from the xml
wilderrodrigues Jul 17, 2014
bfd4316
adding new bean to spring context file; renaming package from "com" t…
wilderrodrigues Jul 17, 2014
f23ba91
Fixing null pointers during vpc router deployment
Jul 17, 2014
b97f2b0
apply network acls; acls items to pvt gw; vpc ip association
wilderrodrigues Jul 17, 2014
325026d
fixing VPC IP Association and ACL rules. Have to rewrite in a better …
wilderrodrigues Jul 18, 2014
8852153
Splitting Vpc and NonVpc deployment into phases & testing it
Jul 17, 2014
f3c0417
RouterDeployment and VPC. Improving code and Unit Testing
Jul 23, 2014
6fac126
More refactoring and testing in the same classes
Jul 27, 2014
a83f579
License headers
Jul 28, 2014
12b0d18
Replacing the old [Vpc}VirtualNetworkApplianceManager by the new ones;
wilderrodrigues Aug 18, 2014
d2d9157
Complete tests for normal deployment and start vpc one
Jul 28, 2014
240a539
Factor out prepareDeployment and update tests
Jul 29, 2014
0d81cf0
Increasing test coverage for Vpc Deployment
Jul 29, 2014
95d32b4
Fix unnecessary changes Spring contexts
Aug 18, 2014
16ad412
moving sendCommand to the NetworkGeneralHelper;
wilderrodrigues Aug 19, 2014
00dc8a7
fixing check styles
wilderrodrigues Aug 19, 2014
2da3ced
Refactor to include network creation as actual deployment
Aug 19, 2014
b96035f
adding applyStaticRoutes method to the network topology/visitor. it w…
wilderrodrigues Aug 19, 2014
adebaf2
adding applyStaticRoutes to the new visitor pattern.
wilderrodrigues Aug 19, 2014
3d4ddb7
DeployRouter includes nw creation following TellDontAsk principle
Aug 20, 2014
b9bff84
Whole router.deployment package got 97% coverage
Aug 20, 2014
01edc8e
adding setupPrivateGateway to new style;
wilderrodrigues Aug 20, 2014
e08cb11
fixing check style issues
wilderrodrigues Aug 21, 2014
2802d3b
Refactor and test NetworkHelper#sendCommandsToRouterWithNoAnswers
Aug 21, 2014
b5e96af
Missing license headers
Aug 21, 2014
546e563
refactor all private methods in the virtual router appliance and VPC …
wilderrodrigues Aug 21, 2014
65fb216
auto wire the network helper
wilderrodrigues Aug 21, 2014
cd8cada
Refactor hypervisor retrieval from VpcNwHelper and NwHelper
Aug 21, 2014
02c7525
Fixing NPE due to use of dependencies before Spring injection
Aug 22, 2014
5f51a06
fix dhcp subnet rules. we can create VMs again.
wilderrodrigues Aug 23, 2014
b7c193a
fixing nic plug unplug rule
wilderrodrigues Aug 25, 2014
ee9068b
merging cmd-visitor into cmd-visitor-rebase, with the upstream from A…
wilderrodrigues Sep 5, 2014
64eed6c
Fix: VpcRouter has always PublicIp setup as it did before refactoring
Aug 28, 2014
dc5fefc
making sure the instance variable _router in the Rules is being used …
wilderrodrigues Sep 2, 2014
251e7ff
removing the root password becuase it was breaking the simulator test…
wilderrodrigues Sep 2, 2014
f2f4732
Removing the VirtualNetworkStatus, it was not being used properly;
wilderrodrigues Sep 4, 2014
60eea3b
Adding fixes for the add user data and vpn rules
wilderrodrigues Sep 8, 2014
9f801d1
Changing the way the DAOs were being injected in the RuleApplier;
wilderrodrigues Sep 9, 2014
025ff72
fixing checkstyle in the virtual network manager. problem appeared af…
wilderrodrigues Sep 9, 2014
4e21948
Fixing the NetworkHelperImpl class. It was throwing a NPE due to a hy…
wilderrodrigues Sep 11, 2014
3ac2e22
CLOUDSTACK-6278 Baremetal Advanced Networking support from commit id …
wilderrodrigues Sep 11, 2014
c81b338
Applying the latest chances from the VPC Refactor branch onto the new…
wilderrodrigues Sep 29, 2014
db86bdf
Applygin fix from commit ID aaeadc5c44e3fe16a1deea5348b085b08b5f4f4d
wilderrodrigues Sep 30, 2014
2ed64b2
Applying fix from commit id 6b8e0baa21e6cffc62eb2d35eecc7aeb2087d1c1
wilderrodrigues Oct 14, 2014
1e87d7b
Fixing checkstyle.
wilderrodrigues Oct 14, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Extract general behavior to Router and Vpc delegates
Conflicts:
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
  • Loading branch information
Antonio Fornie authored and wilderrodrigues committed Oct 14, 2014
commit f28426e1a2a1274d19b1bf1d2e5b94c8e3e5ab23
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@
class="com.cloud.network.rules.VirtualNetworkApplianceFactory" />
<bean id="routerControlHelper"
class="com.cloud.network.router.RouterControlHelper" />
<bean id="networkGeneralHelper"
class="com.cloud.network.router.NetworkGeneralHelper" />
<bean id="vpcVirtualNetworkHelper"
class="com.cloud.network.router.VpcVirtualNetworkHelperImpl" />


<bean id="ApiAsyncJobDispatcher" class="com.cloud.api.ApiAsyncJobDispatcher">
Expand Down
738 changes: 738 additions & 0 deletions server/src/com/cloud/network/router/NetworkGeneralHelper.java

Large diffs are not rendered by default.

1,322 changes: 500 additions & 822 deletions server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions server/src/com/cloud/network/router/VirtualNwStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.cloud.network.router;

import com.cloud.user.Account;

public class VirtualNwStatus {

public static String instance = "";

public static Account account = null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@
public interface VpcVirtualNetworkApplianceManager extends VirtualNetworkApplianceManager, VpcVirtualNetworkApplianceService {

/**
*
* @param vpc
* @param dest
* @param owner
* @param params
* @param isRedundant
* @return
* @throws InsufficientCapacityException
* @throws ConcurrentOperationException
* @throws ResourceUnavailableException
*/
List<DomainRouterVO> deployVirtualRouterInVpc(Vpc vpc, DeployDestination dest, Account owner, Map<Param, Object> params, boolean isRedundant) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException;

/**
*
* @param vpc
* @param dest
* @param owner
Expand All @@ -49,7 +65,7 @@ public interface VpcVirtualNetworkApplianceManager extends VirtualNetworkApplian
* @throws ResourceUnavailableException
*/
List<DomainRouterVO> deployVirtualRouterInVpc(Vpc vpc, DeployDestination dest, Account owner, Map<Param, Object> params) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException;
ConcurrentOperationException, ResourceUnavailableException;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand;
import com.cloud.agent.api.to.IpAddressTO;
import com.cloud.agent.api.to.NetworkACLTO;
import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.manager.Commands;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenterVO;
Expand Down Expand Up @@ -172,19 +171,29 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
@Inject
EntityManager _entityMgr;

@Inject
protected NetworkGeneralHelper nwHelper;
@Inject
protected VpcVirtualNetworkHelper vpcHelper;

@Override
public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
_itMgr.registerGuru(VirtualMachine.Type.DomainRouter, this);
return super.configure(name, params);
}

@Override
public List<DomainRouterVO> deployVirtualRouterInVpc(Vpc vpc, DeployDestination dest, Account owner, Map<Param, Object> params) throws InsufficientCapacityException,
public List<DomainRouterVO> deployVirtualRouterInVpc(Vpc vpc, DeployDestination dest, Account owner,
Map<Param, Object> params) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException {
return this.deployVirtualRouterInVpc(vpc, dest, owner, params, false);
}

List<DomainRouterVO> routers = findOrDeployVirtualRouterInVpc(vpc, dest, owner, params);

return startRouters(params, routers);
@Override
public List<DomainRouterVO> deployVirtualRouterInVpc(Vpc vpc, DeployDestination dest, Account owner,
Map<Param, Object> params, final boolean isRedundant) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException {
return this.vpcHelper.deployVirtualRouterInVpc(vpc, dest, owner, params, isRedundant);
}

@DB
Expand Down Expand Up @@ -334,7 +343,7 @@ protected DomainRouterVO deployVpcRouter(Account owner, DeployDestination dest,

LinkedHashMap<Network, List<? extends NicProfile>> networks = createVpcRouterNetworks(owner, isRedundant, plan, new Pair<Boolean, PublicIp>(true, sourceNatIp),vpcId);
DomainRouterVO router =
super.deployRouter(owner, dest, plan, params, isRedundant, vrProvider, svcOffId, vpcId, networks, true, _vpcMgr.getSupportedVpcHypervisors());
nwHelper.deployRouter(owner, dest, plan, params, isRedundant, vrProvider, svcOffId, vpcId, networks, true, _vpcMgr.getSupportedVpcHypervisors());

return router;
}
Expand Down Expand Up @@ -478,12 +487,6 @@ private void createVpcAssociatePublicIPCommands(final VirtualRouter router, fina
}
}

protected NicTO getNicTO(final VirtualRouter router, Long networkId, String broadcastUri) {
NicProfile nicProfile = _networkModel.getNicProfile(router, networkId, broadcastUri);

return _itMgr.toNicTO(nicProfile, router.getHypervisorType());
}

@Override
public boolean associatePublicIP(Network network, final List<? extends PublicIpAddress> ipAddress, List<? extends VirtualRouter> routers)
throws ResourceUnavailableException {
Expand Down Expand Up @@ -677,7 +680,7 @@ private void createNetworkACLsCommands(List<? extends NetworkACLItem> rules, Vir
}
}

SetNetworkACLCommand cmd = new SetNetworkACLCommand(rulesTO, getNicTO(router, guestNetworkId, null));
SetNetworkACLCommand cmd = new SetNetworkACLCommand(rulesTO, nwHelper.getNicTO(router, guestNetworkId, null));
cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId()));
cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, getRouterIpInNetwork(guestNetworkId, router.getId()));
cmd.setAccessDetail(NetworkElementCommand.GUEST_VLAN_TAG, guestVlan);
Expand Down Expand Up @@ -752,7 +755,7 @@ public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile prof
}
}
PlugNicCommand plugNicCmd =
new PlugNicCommand(getNicTO(router, publicNic.getNetworkId(), publicNic.getBroadcastUri().toString()), router.getInstanceName(), router.getType());
new PlugNicCommand(nwHelper.getNicTO(router, publicNic.getNetworkId(), publicNic.getBroadcastUri().toString()), router.getInstanceName(), router.getType());
cmds.addCommand(plugNicCmd);
VpcVO vpc = _vpcDao.findById(router.getVpcId());
NetworkUsageCommand netUsageCmd =
Expand All @@ -778,7 +781,7 @@ public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile prof
for (Pair<Nic, Network> nicNtwk : guestNics) {
Nic guestNic = nicNtwk.first();
//plug guest nic
PlugNicCommand plugNicCmd = new PlugNicCommand(getNicTO(router, guestNic.getNetworkId(), null), router.getInstanceName(), router.getType());
PlugNicCommand plugNicCmd = new PlugNicCommand(nwHelper.getNicTO(router, guestNic.getNetworkId(), null), router.getInstanceName(), router.getType());
cmds.addCommand(plugNicCmd);
if (!_networkModel.isPrivateGateway(guestNic.getNetworkId())) {
//set guest network
Expand Down Expand Up @@ -920,7 +923,7 @@ public boolean setupPrivateGateway(PrivateGateway gateway, VirtualRouter router)
Network network = _networkModel.getNetwork(gateway.getNetworkId());
NicProfile requested = createPrivateNicProfileForGateway(gateway);

if (!checkRouterVersion(router)) {
if (!nwHelper.checkRouterVersion(router)) {
s_logger.warn("Router requires upgrade. Unable to send command to router: " + router.getId());
return false;
}
Expand Down
27 changes: 27 additions & 0 deletions server/src/com/cloud/network/router/VpcVirtualNetworkHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.cloud.network.router;

import java.util.List;
import java.util.Map;

import com.cloud.deploy.DeployDestination;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.vpc.Vpc;
import com.cloud.network.vpc.VpcGateway;
import com.cloud.user.Account;
import com.cloud.vm.DomainRouterVO;
import com.cloud.vm.NicProfile;
import com.cloud.vm.VirtualMachineProfile.Param;

public interface VpcVirtualNetworkHelper {

List<DomainRouterVO> deployVirtualRouterInVpc(Vpc vpc,
DeployDestination dest, Account owner, Map<Param, Object> params, boolean isRedundant)
throws InsufficientCapacityException, ConcurrentOperationException,
ResourceUnavailableException;

NicProfile createPrivateNicProfileForGateway(VpcGateway privateGateway);

List<DomainRouterVO> getVpcRouters(long vpcId);
}
Loading