Skip to content

VPC and Virtual Network Managers refactor. Part of the VPC Redundant Router work #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 160 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
f7a85d2
Rules and visitors for Load Balance Rules
Jul 3, 2014
cdd30b7
Adding new behaviour to the apply load balancing rules method. The wh…
wilderrodrigues Jul 4, 2014
2229d99
Extract general behavior to Router and Vpc delegates
Jul 10, 2014
a4a8232
Fix dependency problem. Extract and unify router deployment stuff
Jul 11, 2014
fdbf1a2
Adding Firewall Rules to comply with the Visitor pattern implementati…
Jul 13, 2014
f89f3b3
changing accessor modifier in instance variables
Jul 14, 2014
0e9e109
fixing checkstyles
wilderrodrigues Jul 14, 2014
3fbb2a1
finished firewall rules and load balancing rules; fixed all the injec…
wilderrodrigues Jul 14, 2014
f44def9
TODO
DaanHoogland Jul 14, 2014
492249d
adding static nat rules. Deploying new VMs is not working due to the …
wilderrodrigues Jul 14, 2014
8979acb
we have to check if VPC is null bfore calling it. VPC is not used in …
wilderrodrigues Jul 15, 2014
327cd3f
adding apache license headers
wilderrodrigues Jul 15, 2014
70af2e7
adding Ip Association and VPN Rules
wilderrodrigues Jul 15, 2014
8a4a74d
Fix offering setup
Jul 15, 2014
948b9c6
package rename
DaanHoogland Jul 15, 2014
224ef76
Temporary put state info in a state object
Jul 15, 2014
865abac
fixing the classes relationship; adding beans properly in the spring …
wilderrodrigues Jul 15, 2014
e2071f9
adding password to router rules; moving the advance code to the advan…
wilderrodrigues Jul 15, 2014
1bfd40e
Unify and encapsulate deployment flow methods and params
Jul 15, 2014
c571aa2
adding userdata to router and ssh pub key to router rules.
wilderrodrigues Jul 16, 2014
c40ecf2
making instance variables compliant with ACS convention
wilderrodrigues Jul 16, 2014
ee8b027
adding user data pwd rules
wilderrodrigues Jul 16, 2014
770c12b
adding DHCP entry rules
wilderrodrigues Jul 16, 2014
2abf343
fixing injection of beans with a relationship
wilderrodrigues Jul 16, 2014
565f77f
whitespace
DaanHoogland Jul 16, 2014
1cdcb1c
fixing the injection of the networkDao
wilderrodrigues Jul 16, 2014
d84929e
mv to better name
DaanHoogland Jul 16, 2014
bdef2f8
Deployment more OO - Objects with data and behavior
Jul 16, 2014
4f93ef2
replacing my IP by localhost to avoid problems with my environment
wilderrodrigues Jul 17, 2014
ee0389b
fixing import in virtual router element and checkstyle in dhcp entry …
wilderrodrigues Jul 17, 2014
4252825
commenting broken code in tests in order to run build adn tests other…
wilderrodrigues Jul 17, 2014
0ba539c
removing bean from the xml
wilderrodrigues Jul 17, 2014
4ee726e
adding new bean to spring context file; renaming package from "com" t…
wilderrodrigues Jul 17, 2014
1d0c83f
Missing dependencies are added
Jul 17, 2014
a0ded3d
Fixing null pointers during vpc router deployment
Jul 17, 2014
bf7fb4a
apply network acls; acls items to pvt gw; vpc ip association
wilderrodrigues Jul 17, 2014
7effc0a
fixing VPC IP Association and ACL rules. Have to rewrite in a better …
wilderrodrigues Jul 18, 2014
938d3df
Splitting Vpc and NonVpc deployment into phases & testing it
Jul 17, 2014
8673535
RouterDeployment and VPC. Improving code and Unit Testing
Jul 23, 2014
cfef413
rename networkMgr to networkMdl to prevent name clashes in mocks of
DaanHoogland Jul 23, 2014
6c41f16
More refactoring and testing in the same classes
Jul 27, 2014
7304a39
License headers
Jul 28, 2014
e29de5f
Replacing the old [Vpc}VirtualNetworkApplianceManager by the new ones;
wilderrodrigues Aug 18, 2014
d5a35ac
Complete tests for normal deployment and start vpc one
Jul 28, 2014
930ee56
Factor out prepareDeployment and update tests
Jul 29, 2014
af3189c
Increasing test coverage for Vpc Deployment
Jul 29, 2014
408cde6
Fix unnecessary changes Spring contexts
Aug 18, 2014
5d57236
Adding VpcRouterDeploymentDefinition Unit Tests
Aug 18, 2014
812e9e5
moving sendCommand to the NetworkGeneralHelper;
wilderrodrigues Aug 19, 2014
669e074
fixing check styles
wilderrodrigues Aug 19, 2014
40df9d4
Refactor to include network creation as actual deployment
Aug 19, 2014
1eadf84
adding applyStaticRoutes method to the network topology/visitor. it w…
wilderrodrigues Aug 19, 2014
bdde077
adding applyStaticRoutes to the new visitor pattern.
wilderrodrigues Aug 19, 2014
6353c74
refactor VpnRules onto BasicVpnRules and AdvancedVpnRules;
wilderrodrigues Aug 19, 2014
003fba6
DeployRouter includes nw creation following TellDontAsk principle
Aug 20, 2014
c7f6998
Whole router.deployment package got 97% coverage
Aug 20, 2014
0b8b22f
adding setupPrivateGateway to new style;
wilderrodrigues Aug 20, 2014
404f711
fixing the private gateway rules in order to comply with changes in t…
wilderrodrigues Aug 21, 2014
5e11fba
fixing check style issues
wilderrodrigues Aug 21, 2014
bac85e5
Refactor and test NetworkHelper#sendCommandsToRouterWithNoAnswers
Aug 21, 2014
5195790
Missing license headers
Aug 21, 2014
06c77f1
refactor all private methods in the virtual router appliance and VPC …
wilderrodrigues Aug 21, 2014
5162d24
Fix Spring collision of beans implementing NetworkHelper
Aug 21, 2014
808bbe3
auto wire the network helper
wilderrodrigues Aug 21, 2014
2e8879f
Refactor hypervisor retrieval from VpcNwHelper and NwHelper
Aug 21, 2014
bdcaaa1
Fixing NPE due to use of dependencies before Spring injection
Aug 22, 2014
a6eca45
fix dhcp subnet rules. we can create VMs again.
wilderrodrigues Aug 23, 2014
6737ec9
fixing nic plug unplug rule
wilderrodrigues Aug 25, 2014
780de53
merging cmd-visitor into cmd-visitor-rebase, with the upstream from A…
wilderrodrigues Sep 5, 2014
fc8fe2c
merging cmd-visitor into cmd-visitor-rebase, with the upstream from A…
wilderrodrigues Sep 5, 2014
8785851
Fix: VpcRouter has always PublicIp setup as it did before refactoring
Aug 28, 2014
a99f84c
making sure the instance variable _router in the Rules is being used …
wilderrodrigues Sep 2, 2014
66b9c3c
removing the root password becuase it was breaking the simulator test…
wilderrodrigues Sep 2, 2014
eaa86bb
Removing the VirtualNetworkStatus, it was not being used properly;
wilderrodrigues Sep 4, 2014
45ed14c
Adding fixes for the add user data and vpn rules
wilderrodrigues Sep 8, 2014
d971484
Changing the way the DAOs were being injected in the RuleApplier;
wilderrodrigues Sep 9, 2014
63afd36
fixing checkstyle in the virtual network manager. problem appeared af…
wilderrodrigues Sep 9, 2014
2d41f7b
Fixing the NetworkHelperImpl class. It was throwing a NPE due to a hy…
wilderrodrigues Sep 11, 2014
2dfc628
CLOUDSTACK-6278 Baremetal Advanced Networking support from commit id …
wilderrodrigues Sep 11, 2014
849a4a1
Rules and visitors for Load Balance Rules
Jul 3, 2014
8373006
Adding new behaviour to the apply load balancing rules method. The wh…
wilderrodrigues Jul 4, 2014
9880a03
Extract general behavior to Router and Vpc delegates
Jul 10, 2014
b963de0
Fix dependency problem. Extract and unify router deployment stuff
Jul 11, 2014
36df702
Adding Firewall Rules to comply with the Visitor pattern implementati…
Jul 13, 2014
40deb86
changing accessor modifier in instance variables
Jul 14, 2014
6c131fd
fixing checkstyles
wilderrodrigues Jul 14, 2014
8ff5b09
finished firewall rules and load balancing rules; fixed all the injec…
wilderrodrigues Jul 14, 2014
611edd1
TODO
DaanHoogland Jul 14, 2014
49b482b
adding static nat rules. Deploying new VMs is not working due to the …
wilderrodrigues Jul 14, 2014
89f0bb2
we have to check if VPC is null bfore calling it. VPC is not used in …
wilderrodrigues Jul 15, 2014
fa371e9
adding apache license headers
wilderrodrigues Jul 15, 2014
26f5d23
adding Ip Association and VPN Rules
wilderrodrigues Jul 15, 2014
28c0bf1
Fix offering setup
Jul 15, 2014
6c22f70
package rename
DaanHoogland Jul 15, 2014
f2281b6
Temporary put state info in a state object
Jul 15, 2014
986dbde
fixing the classes relationship; adding beans properly in the spring …
wilderrodrigues Jul 15, 2014
6664cc1
adding password to router rules; moving the advance code to the advan…
wilderrodrigues Jul 15, 2014
8a5459c
Unify and encapsulate deployment flow methods and params
Jul 15, 2014
de4a75b
adding userdata to router and ssh pub key to router rules.
wilderrodrigues Jul 16, 2014
9b31d02
making instance variables compliant with ACS convention
wilderrodrigues Jul 16, 2014
d9670a1
adding user data pwd rules
wilderrodrigues Jul 16, 2014
56723f2
adding DHCP entry rules
wilderrodrigues Jul 16, 2014
0bbccc1
fixing injection of beans with a relationship
wilderrodrigues Jul 16, 2014
f55746b
whitespace
DaanHoogland Jul 16, 2014
4e30701
fixing the injection of the networkDao
wilderrodrigues Jul 16, 2014
4537420
mv to better name
DaanHoogland Jul 16, 2014
b098c0e
Deployment more OO - Objects with data and behavior
Jul 16, 2014
c66bfa1
replacing my IP by localhost to avoid problems with my environment
wilderrodrigues Jul 17, 2014
7494bd6
fixing import in virtual router element and checkstyle in dhcp entry …
wilderrodrigues Jul 17, 2014
763f06e
commenting broken code in tests in order to run build adn tests other…
wilderrodrigues Jul 17, 2014
cd467bd
removing bean from the xml
wilderrodrigues Jul 17, 2014
6834fe0
adding new bean to spring context file; renaming package from "com" t…
wilderrodrigues Jul 17, 2014
af2f734
Missing dependencies are added
Jul 17, 2014
bab8b7e
Fixing null pointers during vpc router deployment
Jul 17, 2014
38dbd08
apply network acls; acls items to pvt gw; vpc ip association
wilderrodrigues Jul 17, 2014
e18521e
fixing VPC IP Association and ACL rules. Have to rewrite in a better …
wilderrodrigues Jul 18, 2014
44562f2
Splitting Vpc and NonVpc deployment into phases & testing it
Jul 17, 2014
a02ce1a
RouterDeployment and VPC. Improving code and Unit Testing
Jul 23, 2014
2becb1a
rename networkMgr to networkMdl to prevent name clashes in mocks of
DaanHoogland Jul 23, 2014
934b200
More refactoring and testing in the same classes
Jul 27, 2014
12b21df
License headers
Jul 28, 2014
b53d66a
Replacing the old [Vpc}VirtualNetworkApplianceManager by the new ones;
wilderrodrigues Aug 18, 2014
37b8706
Complete tests for normal deployment and start vpc one
Jul 28, 2014
450741d
Factor out prepareDeployment and update tests
Jul 29, 2014
da0c0db
Increasing test coverage for Vpc Deployment
Jul 29, 2014
07c459a
Fix unnecessary changes Spring contexts
Aug 18, 2014
5fd9fc9
Adding VpcRouterDeploymentDefinition Unit Tests
Aug 18, 2014
fccd3ff
moving sendCommand to the NetworkGeneralHelper;
wilderrodrigues Aug 19, 2014
b64ebba
fixing check styles
wilderrodrigues Aug 19, 2014
1768207
Refactor to include network creation as actual deployment
Aug 19, 2014
5d9b445
adding applyStaticRoutes method to the network topology/visitor. it w…
wilderrodrigues Aug 19, 2014
7c88411
adding applyStaticRoutes to the new visitor pattern.
wilderrodrigues Aug 19, 2014
790b112
refactor VpnRules onto BasicVpnRules and AdvancedVpnRules;
wilderrodrigues Aug 19, 2014
f22cf4d
DeployRouter includes nw creation following TellDontAsk principle
Aug 20, 2014
862a59a
Whole router.deployment package got 97% coverage
Aug 20, 2014
f2a1b8d
adding setupPrivateGateway to new style;
wilderrodrigues Aug 20, 2014
0e93702
fixing the private gateway rules in order to comply with changes in t…
wilderrodrigues Aug 21, 2014
cc560e8
fixing check style issues
wilderrodrigues Aug 21, 2014
bb85d48
Refactor and test NetworkHelper#sendCommandsToRouterWithNoAnswers
Aug 21, 2014
6500571
Missing license headers
Aug 21, 2014
453d7ec
refactor all private methods in the virtual router appliance and VPC …
wilderrodrigues Aug 21, 2014
734eda9
Fix Spring collision of beans implementing NetworkHelper
Aug 21, 2014
0b96c7b
auto wire the network helper
wilderrodrigues Aug 21, 2014
7235c23
Refactor hypervisor retrieval from VpcNwHelper and NwHelper
Aug 21, 2014
711f91c
Fixing NPE due to use of dependencies before Spring injection
Aug 22, 2014
c889bff
fix dhcp subnet rules. we can create VMs again.
wilderrodrigues Aug 23, 2014
4d36e73
fixing nic plug unplug rule
wilderrodrigues Aug 25, 2014
70a76c9
merging cmd-visitor into cmd-visitor-rebase, with the upstream from A…
wilderrodrigues Sep 5, 2014
2569413
merging cmd-visitor into cmd-visitor-rebase, with the upstream from A…
wilderrodrigues Sep 5, 2014
67328fb
Fix: VpcRouter has always PublicIp setup as it did before refactoring
Aug 28, 2014
8000f66
making sure the instance variable _router in the Rules is being used …
wilderrodrigues Sep 2, 2014
c4b44d3
removing the root password becuase it was breaking the simulator test…
wilderrodrigues Sep 2, 2014
e6be15c
Removing the VirtualNetworkStatus, it was not being used properly;
wilderrodrigues Sep 4, 2014
078f0af
Adding fixes for the add user data and vpn rules
wilderrodrigues Sep 8, 2014
08afc76
Changing the way the DAOs were being injected in the RuleApplier;
wilderrodrigues Sep 9, 2014
1f440e7
fixing checkstyle in the virtual network manager. problem appeared af…
wilderrodrigues Sep 9, 2014
7575262
Fixing the NetworkHelperImpl class. It was throwing a NPE due to a hy…
wilderrodrigues Sep 11, 2014
557e15e
CLOUDSTACK-6278 Baremetal Advanced Networking support from commit id …
wilderrodrigues Sep 11, 2014
ce471ed
Merge branch 'vpc-refactor-rvr-final' of https://github.com/schubergp…
wilderrodrigues Sep 11, 2014
09d0d6f
Fixing problem with DHCP Subnet Rules.
wilderrodrigues Sep 23, 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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,45 @@

<bean id="uploadMonitorImpl" class="com.cloud.storage.upload.UploadMonitorImpl" />
<bean id="usageServiceImpl" class="com.cloud.usage.UsageServiceImpl" />

<bean id="virtualNetworkApplianceManagerImpl"
class="com.cloud.network.router.VirtualNetworkApplianceManagerImpl" />

<bean id="vpcManagerImpl" class="com.cloud.network.vpc.VpcManagerImpl" >
<property name="vpcElements" value="#{vpcProvidersRegistry.registered}"></property>
</bean>

<bean id="vpcVirtualNetworkApplianceManagerImpl"
class="com.cloud.network.router.VpcVirtualNetworkApplianceManagerImpl" />


<bean id="virtualNetworkApplianceFactory"
class="com.cloud.network.rules.VirtualNetworkApplianceFactory" />

<bean id="topologyContext" class="org.apache.cloudstack.network.topology.NetworkTopologyContext" init-method="init" />

<bean id="basicNetworkTopology" class="org.apache.cloudstack.network.topology.BasicNetworkTopology" />
<bean id="advancedNetworkTopology" class="org.apache.cloudstack.network.topology.AdvancedNetworkTopology" />

<bean id="basicNetworkVisitor" class="org.apache.cloudstack.network.topology.BasicNetworkVisitor" />
<bean id="advancedNetworkVisitor" class="org.apache.cloudstack.network.topology.AdvancedNetworkVisitor" />

<bean id="commandSetupHelper"
class="com.cloud.network.router.CommandSetupHelper" />

<bean id="routerControlHelper"
class="com.cloud.network.router.RouterControlHelper" />

<bean id="networkHelper"
class="com.cloud.network.router.NetworkHelperImpl" />

<bean id="vpcNetworkHelper"
class="com.cloud.network.router.VpcNetworkHelperImpl" />

<bean id="nicProfileHelper"
class="com.cloud.network.router.NicProfileHelperImpl" />

<bean id="routerDeploymentDefinitionBuilder"
class="org.cloud.network.router.deployment.RouterDeploymentDefinitionBuilder" />

<bean id="ApiAsyncJobDispatcher" class="com.cloud.api.ApiAsyncJobDispatcher">
<property name="name" value="ApiAsyncJobDispatcher" />
Expand Down
312 changes: 203 additions & 109 deletions server/src/com/cloud/network/element/VirtualRouterElement.java

Large diffs are not rendered by default.

147 changes: 100 additions & 47 deletions server/src/com/cloud/network/element/VpcVirtualRouterElement.java

Large diffs are not rendered by default.

1,020 changes: 1,020 additions & 0 deletions server/src/com/cloud/network/router/CommandSetupHelper.java

Large diffs are not rendered by default.

81 changes: 81 additions & 0 deletions server/src/com/cloud/network/router/NetworkHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.network.router;

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

import org.cloud.network.router.deployment.RouterDeploymentDefinition;

import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.manager.Commands;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.InsufficientServerCapacityException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.exception.StorageUnavailableException;
import com.cloud.user.Account;
import com.cloud.user.User;
import com.cloud.vm.DomainRouterVO;
import com.cloud.vm.VirtualMachineProfile.Param;

public interface NetworkHelper {

public abstract boolean sendCommandsToRouter(VirtualRouter router,
Commands cmds) throws AgentUnavailableException;

public abstract void handleSingleWorkingRedundantRouter(
List<? extends VirtualRouter> connectedRouters,
List<? extends VirtualRouter> disconnectedRouters, String reason)
throws ResourceUnavailableException;

public abstract int getRealPriority(DomainRouterVO router);

public abstract NicTO getNicTO(VirtualRouter router, Long networkId,
String broadcastUri);

public abstract VirtualRouter destroyRouter(long routerId, Account caller,
Long callerUserId) throws ResourceUnavailableException,
ConcurrentOperationException;

/**
* Checks if the router is at the required version. Compares MS version and router version.
*
* @param router
* @return
*/
public abstract boolean checkRouterVersion(VirtualRouter router);

public abstract List<DomainRouterVO> startRouters(
RouterDeploymentDefinition routerDeploymentDefinition)
throws StorageUnavailableException, InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException;

public abstract DomainRouterVO startVirtualRouter(DomainRouterVO router,
User user, Account caller, Map<Param, Object> params)
throws StorageUnavailableException, InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException;

public abstract DomainRouterVO deployRouter(
RouterDeploymentDefinition routerDeploymentDefinition,
boolean startRouter)
throws InsufficientAddressCapacityException,
InsufficientServerCapacityException, InsufficientCapacityException,
StorageUnavailableException, ResourceUnavailableException;
}
Loading