411 Commits

Author SHA1 Message Date
Remi Bergsma
d7b7171870 Merge pull request #1235 from remibergsma/fix-passwd-server-logging
CLOUDSTACK-9155 make sure logrotate is effective for cloud.logMany processes on the VRs log to cloud.log. When log rotate kicks in, the file is rotated but the scripts still write to the old inode (cloud.log.1 after rotate). Tis quickly fills up the tiny log partition.

Using 'copytruncate' is a small tradeoff, there is a slight change of missing a log entry, but in the old situation nothing ended up in cloud.log after rotate (except for stuff that was (re)started) so I think this is the best solution until we properly rewrite the script to either use their own script or syslog.

More details: https://issues.apache.org/jira/browse/CLOUDSTACK-9155

* pr/1235:
  CLOUDSTACK-9155 make sure logrotate is effective

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-13 14:30:07 +01:00
Remi Bergsma
636efa2da3 CLOUDSTACK-9155 make sure logrotate is effective
Many processes on the VRs log to cloud.log. When logrotate
kicks in, the file is rotated but the scripts still write
to the old inode (cloud.log.1 after rotate). Tis quickly
fills up the tiny log partition.

Using 'copytruncate' is a tradeoff, there is a slight
change of missing a log entry, but in the old situation
we were missing all of them after logrotate.
2015-12-13 12:07:20 +01:00
Wilder Rodrigues
2bebb7f8a3 CLOUDSTACK-9151 - Removes the replacement of the VRID in the CsRedundant file
- Just like with RVRs, use the VRID 51 instead of making it dependent on the VPCID
   - Reason: arbitary unique number 0..255 used to differentiate multiple instances of vrrpd running on the same NIC (and hence same socket). virtual_router_id 51
2015-12-12 16:26:00 +01:00
Wilder Rodrigues
f81a29351d CLOUDSTACK-9118 - Improves the existing checkrouter.sh script 2015-12-08 11:06:35 +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
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
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
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
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