71 Commits

Author SHA1 Message Date
Ronald van Zantvoort
d14a484374 VR CsAddress fixes:
* cleanup imports,
* fix to_str(),
* improve & fix service post_config logic
* don't arpPing when there's no gateway
2016-06-07 13:03:09 +02:00
Will Stevens
d9429f6add Merge pull request #1471 from remibergsma/47_lower_interface_wait
Lower the time we wait for interfaces to appearWaiting for interfaces is tricky. They might never appear.. for example when we have entries in `/etc/cloudstack/ips.json` that haven't been plugged yet. Waiting this long makes everything horribly slow (every vm, interface, static route, etc, etc, will hit this wait, for every device). We've seen CloudStack send an `ip_assoc.json` command for `eth1` public nic only and then the router goes crazy waiting for all other interfaces that were there before reboot and aren't there. If only the router would return to the mgt server a success of `eth1`, it would get the command for `eth2` etc etc. Obviously, a destroy works much faster because no state services, so no knowledge of previous devices so no waits :-)

After a stop/start the router has state in `/etc/cloudstack/ips.json` and every commands waits. Eventually hitting the hardcoded 120 sec timeout.

* pr/1471:
  lower the time we wait for interfaces to appear

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-26 15:49:50 -04:00
Remi Bergsma
74f60df828 Revert "Merge pull request #1482 from remibergsma/iptables-fix"
Seems to have a license issue so reverting for now.

This reverts commit 9a20ab8bcbbd39aa012a0ec5a65e66bcc737ee0e, reversing
changes made to 7a0b37a29a8be14011427dcf61bf3ea86e47dbf4.
2016-05-19 11:04:46 +02:00
Will Stevens
9a20ab8bcb Merge pull request #1482 from remibergsma/iptables-fix
Restore iptables at once using iptables-restore instead of calling iptables numerous timesThis makes handling the firewall rules about 50-60 times faster because it is generated in memory and then loaded once. It's work by @borisroman see PR #1400. Reopened it here because I think this is a great improvement.

* pr/1482:
  Resolve conflict as forceencap is already in master
  Split the cidr lists so we won't hit the iptables-resture limits
  Check the existence of 'forceencap' parameter before use
  Do not load previous firewall rules as we replace everyhing anyway
  Wait for dnsmasq to finish restart
  Remove duplicate spaces, and thus duplicate rules.
  Restore iptables at once using iptables-restore instead of calling iptables numerous times
  Add iptables copnversion script.

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-18 15:50:20 -04:00
Wilder Rodrigues
c41edc1fe6 CLOUDSTACK-9287 - Refactor the interface state configuration
- This also refactors the CsAddress in order to offer better readability in a couple of methods.
2016-04-09 21:14:25 +02:00
Remi Bergsma
057b54aa3e CLOUDSTACK-9287 - Make sure private gw interface is not used for default gw 2016-04-09 21:13:47 +02:00
Wilder Rodrigues
d93b008deb CLOUDSTACK-9287 - Put private gateway interface down on backup router 2016-04-09 21:13:35 +02:00
Remi Bergsma
3636ad1114 lower the time we wait for interfaces to appear
They might never appear.. for example when we have entries in
/etc/cloudstack/ips.json that haven't been plugged yet. Waiting
this long makes everything horribly slow (every vm, interface,
static route, etc, etc, will hit this wait, for every device).
2016-04-07 20:52:33 +02:00
Boris Schrijver
b857f79fcb Restore iptables at once using iptables-restore instead of calling iptables numerous times 2016-02-05 12:02:57 +01:00
Wilder Rodrigues
f5a6dee8dd CLOUDSTACK-9187 - Makes code ready for more something like ethXXXX, if we ever get that far
- Adds log info to NetworkOrchestrator in order to make the work of the Net-Scavenger more visible.
2015-12-22 14:52:07 +01:00
Wilder Rodrigues
c99d6f18c9 CLOUDSTACK-9187 - Fixes interface allocation to VRRP instances 2015-12-22 14:52:06 +01:00
Wilder Rodrigues
7988f51ac0 CLOUDSTACK-9154 - Returns the guest iterface that is marked as added
- Force a restart of keepalived if conntrackd is not running or configuration has changed
2015-12-22 14:52:05 +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
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
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
Wilder Rodrigues
7d40814ba1 CLOUDSTACK-8991 - Process the IPs that have been removed 2015-10-28 19:51:57 +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
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
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
45642b8382 CLOUDSTACK-8934 - Add default gateway when the public interface is up again 2015-10-11 14:57:12 +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
Wilder Rodrigues
a8fa3374da Fixing the defaut route for VPC routers 2015-09-26 20:30:49 +02:00
Jayapal
746a5dc48e CLOUDSTACK-8891: Fixed default iptables rules on VR for guest traffic 2015-09-24 12:49:43 +05:30
Bharat Kumar
b66dcda49f CLOUDSTACK-8799 fixed for vpc networks. 2015-09-11 14:57:32 +02:00
Bharat Kumar
1a02773b55 CLOUDSTACK-8799 fixed the defalut routes
CLOUDSTACK-8799 made changes to fix CsRedundant.py
2015-09-11 14:57:32 +02:00
wilderrodrigues
f5e5f4d002 CLOUDSTACK-8688 - default policies for INPUT and FORWARD should be set to DROP instead of ACCEPT
- In order to be able to access the routers via the link local interface, we have to add a rules with NEW and ESTABLISHED state
2015-08-31 12:43:04 +02:00
Michael Andersen
a9eb4ba5c9 Fixed defaultroute on VPC routers in CsRoute and CsAddress
Refactored CsRoute
2015-08-24 13:35:29 +02:00
Michael Andersen
bb93a61ee7 pep8 cleanup 2015-08-24 13:35:01 +02:00
wilderrodrigues
20be22c698 CLOUDSTACK-8616 - Removing the Priority form KeepaliveD configuration
- We use no preempt mode with state set as EQUAL to both nodes, no need to have Priotities setup
   - Do not add IPs as comments to the configuration. If a new guest interface is added, the file will change anyway.
     - This was used in the past when keepalived would restart for each new interface added
   - Removed the long sleep form the tests: we now sleep 5 seconds per PF rule added

CLOUDSTACK-8616 - Fix keepalived.ts/2 files comparison

   - Add call to set_fault() in case of router transits to that state
   - Removing commented out code

CLOUDSTACK-8616 - Fixing check_heartbeat.sh.templ

CLOUDSTACK-8616 - Call set_fault from the check_heartbeat.sh script

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-16 13:14:48 +02:00
Ian Southam
b7b54f1680 Fixes to enable test to succeed. Small change to Marvin to be able to override retries
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-08 11:19:12 +02:00
wilderrodrigues
cb2b9e870b Fixing the communication with VM via Public IP
- Pub IP port forwarding and static NAT fixed for single VPCs
   - Pub IP port forwarding fixed for redundant VPCs

[wip] fix static NAT for redundant VPCs

This closes #150
2015-04-08 16:04:55 +02:00
Ian Southam
7bfccd699b Fixed Port forwarding (DNAT/SNAT) for isolated networks
Fixed failure on using eth10 (which CS now supports)
Refactored CSForward to us CsInterface object instead of teh way it was kludged together
Fixed hex conversion for device numbers and iptables marks
2015-03-16 11:40:12 +01:00
Ian Southam
6fc680be71 Fixed password server respawning issue
Some changes to isolated network acl generation
2015-03-16 11:40:11 +01:00
Ian Southam
585f5f7000 ACL issues
ACL order issues
Do not block multicast traffic for vrrp
Many smaller bug fixes
checkrouter provided in /opt/cloud/bin
2015-03-16 11:40:10 +01:00
Ian Southam
c1ec5b0b16 nat rules added to incorrect interface 2015-03-16 11:40:07 +01:00
Ian Southam
baa758accc Utterley stupid 2015-03-16 11:40:06 +01:00
Ian Southam
aa6fdf853b A tab got in there somehow! 2015-03-16 11:40:05 +01:00
Ian Southam
b3da2c54c2 Add network stats for isalated networks 2015-03-16 11:40:04 +01:00
Ian Southam
57d3ffaef8 Fixed password server, fixed more firewall issues
Fixed issues with real IP and not virtual (gateway) IP being opened on the firewall
DNS now works on the vms
2015-03-16 11:40:03 +01:00
Ian Southam
9e82281cc1 Fixed rules for dhcp towards v,
Fixed fw rules for a bunch of things
Bring public interface up if no tier has been defined
2015-03-16 11:39:58 +01:00
Ian Southam
7a9a356094 Switch control interface for vrrp to guest network
Fix rRouter that was deleting the gateway interface
2015-03-16 11:39:57 +01:00
Ian Southam
87d4171c53 Who changed my condition!
De Morgans laws chaps
The negation of a conjunction is the disjunction of the negations.
The negation of a disjunction is the conjunction of the negations.
2015-03-16 11:39:56 +01:00
Ian Southam
bf6e3fa8b2 Fixed CsAddress destroying the VIP address on a redundant router
Taken quite a bit of code out of CsRedundant
Fixed public IP in keepalived when there is no guest network
2015-03-16 11:39:53 +01:00
Ian Southam
f5ef75ee7e Vrrp will fail if your own code keeps killing it off 2015-03-16 11:39:51 +01:00
wilderrodrigues
62d586e2af Reverting the changes on CsAddress done in commit 374946e07748dd3ad659381c7d88e5e4140e4eeb 2015-03-16 11:39:50 +01:00
wilderrodrigues
bd7799401b Removing guest interfaces form the VRRP list
Removing the not is_redundant from the check that put interfaces UP.
  - it now checks only "not is_public"
2015-03-16 11:39:50 +01:00
wilderrodrigues
0be56a5ff6 Fixing the timout )ssh hanging) on the CsApp.py file
Adding kill_all() method on the CsProcess.py file (not being used yet)
Changing a bit the logic in the merge.py

The changes in the logic might be reverted, but they are causing no harm now.
2015-03-16 11:39:50 +01:00