405 Commits

Author SHA1 Message Date
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
Wilder Rodrigues
260ff836b6 CLOUDSTACK-8915 - Reverting changes from commit id 1a02773b556a0efa277cf18cd099fc62a4e27706
- That's not the place to fix the default routes for redundant VPC,
   - Adding tests to cover PF and FW in isolated networks
     * Will still add some tests for egress as well
2015-10-06 16:41:14 +02:00
Wilder Rodrigues
3d34e4a52c CLOUDSTACK-8915 - Reverting changes from commit id 18dbc0c4cbe506ad698bc513c901dc2d0e48159f
- If the file is always copied, it will result in restarting keepalived everytime which makes the routers transit between master/backup
2015-10-06 16:41:13 +02:00
Wilder Rodrigues
094d29d7cd CLOUDSTACK-8915 - VRRP needs a cidr in order to work properly
- The cidr was replaced by the single IP, which broke the feature.
   - Wait during transition from master to backup otherwise the test fails due to wronge state
2015-10-06 16:41:13 +02:00
Wilder Rodrigues
0c752eab60 CLOUDSTACK-8915 - Rearrenging a bit the default route code in order to make it more clear 2015-10-06 16:41:13 +02:00
Wilder Rodrigues
c17fb0ff28 CLOUDSTACK-8915 - Add the default route only on address that have not been configured yet.
- In case of rVPC we experienced the wrong route being added to the VPC tiers
2015-10-06 16:41:12 +02:00
Wilder Rodrigues
09e05f2a06 Fixing the index out of bounds error in the check_if_link_up() function 2015-09-26 20:43:15 +02:00
Remi Bergsma
d83995e23c small cleanups 2015-09-26 20:33:21 +02:00
Wilder Rodrigues
a8fa3374da Fixing the defaut route for VPC routers 2015-09-26 20:30:49 +02:00
Wilder Rodrigues
595fa50b3b Formatting the get_gateway() method in the CsDatabag.py file 2015-09-25 16:11:32 +02:00
Wilder Rodrigues
3cfc4cff80 Fixing the dhcpsrvr iptables file
- Instead of changing the router type in a local variable, lets have a dedicated file for the dhcpsrvr routers
   - The file is called iptables-dhcpsrvr, just like we have iptables-vpcrouter and iptables-router
2015-09-25 16:10:43 +02:00