415 Commits

Author SHA1 Message Date
Remi Bergsma
738b78886e Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9118 - Adds integration test to cover routers state.
  CLOUDSTACK-9118 - Improves the existing checkrouter.sh script
2015-12-08 20:12:09 +01:00
Wilder Rodrigues
f81a29351d CLOUDSTACK-9118 - Improves the existing checkrouter.sh script 2015-12-08 11:06:35 +01:00
Remi Bergsma
e08294a95f Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9106 - Makes Enum name compliant with Java code conventions.
  CLOUDSTACK-9106 - Adds a test to cover the changes in the applyVpnUsers() method
  CLOUDSTACK-9106 - Makes the router commands call more consistent.
  CLOUDSTACK-9106 - Enables private gateway tests on Redundant VPCs
  CLOUDSTACK-9106 - Refactor the createPrivateNicProfileForGateway() method
  CLOUDSTACK-9106 - Reduces the amount of iterations through the routers of a VPC
  Add support for not (re)starting server after cloud-setup-management.

Closed PRs that will not be considered for merge:
This closes #1158
This closes #1097
2015-12-07 21:36:36 +01:00
Wilder Rodrigues
24dafc2cc2 CLOUDSTACK-9106 - Refactor the createPrivateNicProfileForGateway() method
- Use the router to retrieve the instance ID
    - Check if the VPC is redundant in order to reuse the private gateway address.
    - Brings the private gateways interfaces up.
2015-12-07 10:30:18 +01:00
Remi Bergsma
58ba44a1c0 Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9097 Make public ip work immediately
  debian: allow rules to pick ACS_BUILD_OPTS from env
2015-12-04 11:05:23 +01:00
Remi Bergsma
4f6ff6ca08 Merge pull request #1163 from remibergsma/arping-to-gw
Send arping to the gateway instead of our own addressWe need to send an Unsolicited ARP to the gateway, instead of our own address. We now encounter problems when people deploy/destroy/deploy and get the same public ip.

Packets arrive, but with incorrect / cached mac and are ignored by the routervm kernel.
Run arping manually to update the arp-cache on the gateway and things start to work.

Then we discovered the `arping` is actually done, but sent to its own address. Therefore the gateway doesn't pick it up. We only saw this happening when rapid deploy tools are used, like Terraform that do deploy/destroy/deploy and might get the same ip but on a new router having a new mac.

```
2015-12-03 18:07:25,589  CsHelper.py execute:160 Executing: arping -c 1 -I eth1 -A -U -s 192.168.23.8 192.168.23.1
```

The integration tests seem happy, although the full run is still ongoing:

```
=== TestName: test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | Status : SUCCESS ===
```

Thanks @sspans for helping trouble shoot this. Ping @wilderrodrigues can you review please?

* pr/1163:
  CLOUDSTACK-9097 Make public ip work immediately

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-04 10:44:48 +01:00
Remi Bergsma
7e902cd505 Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9075 - Uses the same vlan since it should have been already released
  CLOUDSTACK-9075 - Adds VPC static routes test
  CLOUDSTACK-9075 - Covers Private GW ACL with Redundant VPCs
  CLOUDSTACK-9075 - Add method to get list of Physical Networks per zone
  CLOUDSTACK-6276 Removing unused parameter in integration test for projects
  CLOUDSTACK-6276 Removing unused parameter in integration test
  CLOUDSTACK-6276 Fixing affinity groups for projects
2015-12-03 20:42:41 +01:00
Remi Bergsma
90e01c95a2 CLOUDSTACK-9097 Make public ip work immediately
We need to send an Unsolicited ARP to the gateway, instead of our own address. We now encounter problems when people deploy/destroy/deploy and get the same public ip.
2015-12-03 19:30:06 +01:00
Wilder Rodrigues
6d9a3d82f9 CLOUDSTACK-9075 - Uses the same vlan since it should have been already released
- After the first test is done, the clean up will delete the whole VPC, also releasing the VLAN that was in use.
2015-12-02 10:36:53 +01:00
Wilder Rodrigues
a17fa48de1 CLOUDSTACK-9075 - Adds VPC static routes test
- Adds redundant VPC tests
   - Adds support to Static Routes on VPC private gatways
   - Removes the route configuration in case static route is deleted.
2015-12-02 10:36:52 +01:00
Remi Bergsma
76f430cfc3 Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9015 - Delete public IP in order to get both IP and NAT rule removed.
  CLOUDSTACK-9015 - Add test to cover the rVPC routers stop/start/reboot scenario
  CLOUDSTACK-9015 - Make sure the Backup router can talk to the Master router after a stop/start/reboot
2015-11-19 18:02:13 +01:00
Remi Bergsma
791f9dfe5f Merge pull request #1084 from ekholabs/improvement/remove_scripts-CLOUDSTACK-9067
CLOUDSTACK-9067 - As I developer I want to remove all the unused router-shell scripts from ACSThis PR removes the unused shell scripts that were present in the ACS project. Those script were replaced by the.

Some of the scripts are used by the HyperV Resource, which were hardcoded. I took the opportunity to use the Java constants over there as well, so the next one touching the code will know they exist and won't hardcode anything.

The following task were applied:

* Remove the shell files and the Java constants that were mapping them;
* Apply the use of the Java constants to the HyperV Resource class;
* Wrap the String.format() method in the StringUtils so we can test the changes in the HyperV Resource class.

The last point was added because I do not have a HyperV test environment. Hence, I wanted to make sure the tiny code I changed is covered at least by unit tests.

* pr/1084:
  CLOUDSTACK-9067 - Replaces hardcoded paths with the VRScripts constants.
  CLOUDSTACK-9067 - Fomatting the code of HypervDirectConnectResource class
  CLOUDSTACK-9067 - Remove old script file from the project

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-19 17:58:42 +01:00
Remi Bergsma
78e5518741 Merge pull request #1070 from ekholabs/fix/rVPC-CLOUDSTACK-9015
[4.6.1] CLOUDSTACK-9015 - Redundant VPC Virtual Router's state is BACKUP & BACKUP or MASTER & MASTERThis PR closes #1064

All the details can be found in the original PR, which won't be merged because it was created agains master. Once this PR is closed, the original one will be also closed.

* pr/1070:
  CLOUDSTACK-9015 - Delete public IP in order to get both IP and NAT rule removed.
  CLOUDSTACK-9015 - Add test to cover the rVPC routers stop/start/reboot scenario
  CLOUDSTACK-9015 - Make sure the Backup router can talk to the Master router after a stop/start/reboot

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-19 17:52:30 +01:00
Wilder Rodrigues
6477bd8ff7 CLOUDSTACK-9067 - Remove old script file from the project
- Java constants also removed
   - Project still compiling and all unit tests passing.
2015-11-17 15:58:22 +01:00
Wilder Rodrigues
cd05a252fb CLOUDSTACK-9015 - Make sure the Backup router can talk to the Master router after a stop/start/reboot
- Stop KeepaliveD/ConntrackD if the eth2 (guest) interface is not configured and UP
   - Only setup the redundancy after all the router configuration is done
   - Open the FW for the VRRP communitation
     - 224.0.0.18 and 225.0.0.50
   - Set keepalived.conf.templ by default to use interface eth2 (guest)
     - It will be reconfigured anyway, but having eth2 there is more clear
2015-11-12 18:13:51 +01:00
dsclose
8a7deefe64 CLOUDSTACK-9058
Respond with "saved_password" if no password is to be issued.
2015-11-12 08:05:57 +00:00
Wilder Rodrigues
79dabfdae4 CLOUDSTACK-8925 - Implement the default egress DENY/ALLOW properly
- Make tests work with right IP and rules
   - Add egress rule for port 53 protocol UDP when testing default egress DENY on RVR
2015-11-04 13:48:04 +01:00
Wilder Rodrigues
caa0b4071c CLOUDSTACK-8925 - Drop the traffic when default egress is set to false
- The DROP rule should be appended and the other rules inserted.
2015-11-02 21:45:03 +01:00
Wei Zhou
9f7f42330a CLOUDSTACK-9013: Virtual router failed to start on KVM
This fix a typo of commit 4a177031b055f3649e3b4a00c80eddb5cafa1dd7
2015-10-30 20:04:56 +01:00
Remi Bergsma
323a2aaa2a Merge pull request #981 from serbaut/repopulate-dhcphost
CLOUDSTACK-8993: DHCP fails with "no address available" when an IP is reused

Repopulate /etc/dhcphosts.txt to remove old entries with the same IP address.

* pr/981:
  CLOUDSTACK-8993: DHCP fails with "no address available" when an IP is reused

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-29 15:56:54 +01:00
Wilder Rodrigues
b2aa1f8417 CLOUDSTACK-8957 - Implement password server in configure.py 2015-10-29 07:14:51 +01:00
Wilder Rodrigues
7d40814ba1 CLOUDSTACK-8991 - Process the IPs that have been removed 2015-10-28 19:51:57 +01:00
Joakim Sernbrant
f413f69985 CLOUDSTACK-8993: DHCP fails with "no address available" when an IP is reused
Repopulate /etc/dhcphosts.txt to remove old entries with the same IP address.
2015-10-28 15:05:59 +01:00
Wilder Rodrigues
7197cf2e24 CLOUDSTACK-8991 - Remove public IP form interface in case add = false 2015-10-27 19:46:13 +01:00
Wilder Rodrigues
a01720b25b CLOUDSTACK-8935 - Filter the DNS list because it might contain 1 None entry which breaks the code. 2015-10-23 16:45:36 +02:00
Wilder Rodrigues
5ca32dfc82 CLOUDSTACK-8935 - Check if the key is available in the dictionary
- This will fix the cleanup problems.
2015-10-22 14:52:07 +02:00
Wilder Rodrigues
3725b3ee30 CLOUDSTACK-8935 - Add a check to avoid exception related to None value 2015-10-22 13:03:06 +02:00
Wilder Rodrigues
698171d210 CLOUDSTACK-8933 - Replace infinite loop by a for loop
- The loop will also sleep in between iterations, waiting for a couple of seconds and being multiplied by factor 2 per iteration
2015-10-21 11:10:37 +02:00
Bharat Kumar
ac68f2a116 CLOUDSTACK-8933 SSVm and CPVM do not survive a reboot from API 2015-10-20 10:50:14 +02:00
Wilder Rodrigues
fb33cb28ab CLOUDSTACK-8952 - Make the checkrouter.sh compatible with RVR as well 2015-10-17 15:52:28 +02:00
Wilder Rodrigues
2a747ca735 CLOUDSTACK-8952 - Reduce retried from 20 to 5
- We do not need to retry that much
2015-10-17 12:20:42 +02:00
Wilder Rodrigues
5b3c99031f CLOUDSTACK-8952 - Do not rely in the router state on the json file to report back to ACS
- If we stop/start a router, the state in the file will still say MASTER, when it is actually not
   - Checking the state based on the interface (eth1) state
   - Once master.py is called by keepalived, save the state in the json file to BACKUP just to make sure it's also written there
2015-10-17 12:20:41 +02:00
Wilder Rodrigues
41f4d8b58a CLOUDSTACK-8952 - Make the check for master more reliable
- Do not use the API call because it will read what is in the database, that might not have been updated yet
     * Check the status in the router directly instead
   - Remove all the sleeps
2015-10-17 12:20:41 +02:00
Wilder Rodrigues
c7671f3cdd CLOUDSTACK-8952 - Restart dnsmasq everytime the configure.py runs 2015-10-17 12:20:41 +02:00
Wilder Rodrigues
2b286ecd73 CLOUDSTACK-8952 - Make sure the calls to CsFile use the new logic of commit/is_changed methods
- We now have to check if the file changed before commiting. Doesn't make sense to write on disk if there was nono change.
2015-10-17 12:20:40 +02:00
Wilder Rodrigues
1886c4a1b3 CLOUDSTACK-8952 - Make sure we restart dnsmasq if the configuration file changes
- It was working before because the Routers were restarting about 10 times for each operation
     e.g. adding a VM to a network ot acquiring a new IP.
   - Adding stat_rules of internal LB to iptables
     We needed one extra rule in the INPUT chain
2015-10-17 12:20:40 +02:00
Wilder Rodrigues
d762dc8579 CLOUDSTACK-8952 - The public interface was comming UP in the Backup router
- There were too many places trying to put the pub interface UP. I centralised it now.
2015-10-17 12:20:40 +02:00
Wilder Rodrigues
b4920aa028 CLOUDSTACK-8952 - Do not restart conntrackd unless it's needed
- With the keepalived fixed they should not be needed anymore. So first reducing them drasticaly
   - I am now making a backup of the template file, write to the template file and compare it with the existing configuration
   - The template file is recovered afer the process
   - I also check if the process is running
   - I fixed a bug in the compare method
   - I am now updating the configuration variable once the file content is flushed to disk
2015-10-17 12:20:40 +02:00
Wilder Rodrigues
5a216056b5 CLOUDSTACK-8952 - Do not replace the conntrackd config file unless it's needed
- With the new logic, the file will be replaced when the router starts, becasue the default
     conntrackd config file will be different.
2015-10-17 12:20:39 +02:00
Wilder Rodrigues
08b983fe02 CLOUDSTACK-8952 - Remove the '--vrrp' search criteria form the CsProcess constructor call
- There is no such process, which makes the CsProcess.find return false and restart keepalived all the time.
2015-10-17 12:20:39 +02:00
Wilder Rodrigues
f35a16c19e CLOUDSTACK-8947 - Adding some logging to better understand whay is happening with the Processes 2015-10-14 07:44:39 +02:00
Wilder Rodrigues
80b51a7972 CLOUDSTACK-8947 - Adding some logging to better understand what's happening with the rules 2015-10-14 07:44:39 +02:00
Wilder Rodrigues
59bd935f3e CLOUDSTACK-8947 - Configure the firewall when the load balancer is setup
- Only restart HAproxy if it's not running yet
2015-10-14 07:44:38 +02:00
Wilder Rodrigues
4a177031b0 CLOUDSTACK-8947 - Avoid multiple entries in the FW_EGRESS_RULES table 2015-10-14 07:44:38 +02:00
Wilder Rodrigues
052c0dc4c9 CLOUDSTACK-8947 - Open the input chain to IP when loadbalancer is configured
- Also remove the chain rule when it is removed.
2015-10-14 07:44:38 +02:00
Wilder Rodrigues
cbd6464b88 CLOUDSTACK-8947 - FW_EGRESS should be added only to filter table 2015-10-14 07:44:37 +02:00
Wilder Rodrigues
cd8c3e97f5 CLOUDSTACK-8934 - Fix the AclIP class to make it configure the default FW policy 2015-10-11 14:57:33 +02:00
Wilder Rodrigues
b4dc392bfd CLOUDSTACK-8934 - Fix default EGRESS rules for isolated networks
- The default is Accept and will be changed based on the configuration of the offering.

CLOUDSTACK-8934 - The default egress is set as Deny in the router.

   - We had to change it on the Java side in order to make the apply it once the default is defined as allowed on the net offering
2015-10-11 14:57:32 +02:00
Wilder Rodrigues
45642b8382 CLOUDSTACK-8934 - Add default gateway when the public interface is up again 2015-10-11 14:57:12 +02:00
Wilder Rodrigues
9fe040e96d CLOUDSTACK-8915 - Copy the conntrackd configuration every time _redundant_on() function is called
- Also refactored the copy() function under CsHelper.py
2015-10-06 16:41:15 +02:00