Netplan and Keepalived not work

Bug #1820245 reported by Ronan Lanore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Expired
Undecided
Unassigned
netplan.io (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

When configure keepalvied with LVS round robin and DR.

* No round robin on virtual server all packet sent to first server
* No stats on ipvsadm

Linux xxx.foo.bar 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

```
ii ipvsadm 1:1.28-3build1 amd64 Linux Virtual Server support programs
ii keepalived 1:1.3.9-1ubuntu0.18.04.1 amd64 Failover and monitoring daemon for LVS clusters
```

Revision history for this message
Evgeniy Yablokov (eyablokov) wrote :

Can you provide configs, please? Cause I've it working.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Evgeniy Yablokov:

Could you also please send me configs (after sanitizing them for IPs you don't want to share, etc.)? I'd be quite curious to see how you did your setup, how it works, etc.

There are some known issues, especially in running 'netplan apply' which might cause netwrokd to blast away the addresses.

Changed in netplan:
status: New → Incomplete
Changed in netplan.io (Ubuntu):
status: New → Incomplete
Revision history for this message
Ronan Lanore (ronan-lanore) wrote :
Download full text (4.7 KiB)

here config of keepalive

```
# Global Configuration
global_defs {
  notification_email {
    <email address hidden>
  }
  notification_email_from <email address hidden>
  smtp_server smtp_server smtp.foo.bar
  smtp_connect_timeout 30
  router_id fqdn_of_host
}

# describe virtual service ip
vrrp_instance front-loadbalancer {
  state MASTER
  interface ens192
  virtual_router_id 164
  priority 100
  authentication {
    auth_type PASS
    auth_pass XXXXXXX
  }
  virtual_ipaddress {
    aa.bb.cc.dd
  }
  # Invoked to master transition
  notify_master "/etc/keepalived/bypass_ipvs.sh del aa.bb.cc.dd"
  # Invoked to slave transition
  notify_backup "/etc/keepalived/bypass_ipvs.sh add aa.bb.cc.dd"
  # Invoked to fault transition
  notify_fault "/etc/keepalived/bypass_ipvs.sh add aa.bb.cc.dd"
  # Invoked to stop transition
  notify_stop "/etc/keepalived/bypass_ipvs.sh add aa.bb.cc.dd"
}

# describe virtual mail server
virtual_server aa.bb.cc.dd 10514 {
  delay_loop 5
  lb_algo rr
  lb_kind DR
  protocol TCP

  real_server dd.cc.bb.aa1 10514 {
    MISC_CHECK {
      misc_path "/usr/bin/curl -XGET http://dd.cc.bb.aa1:9601"
      misc_timeout 10
    }

  }
  real_server dd.cc.bb.aa2 10514 {
    MISC_CHECK {
      misc_path "/usr/bin/curl -XGET http://dd.cc.bb.aa2:9601"
      misc_timeout 10
    }

  }
}

virtual_server aa.bb.cc.dd 10514 {
  delay_loop 5
  lb_algo rr
  lb_kind DR
  #persistence_timeout 50
  ops
  protocol UDP

  real_server dd.cc.bb.aa1 10514 {
    MISC_CHECK {
      misc_path "/usr/bin/curl -XGET http://dd.cc.bb.aa1:9601"
      misc_timeout 10
    }
  }
  real_server dd.cc.bb.aa2 10514 {
    MISC_CHECK {
      misc_path "/usr/bin/curl -XGET http://dd.cc.bb.aa2:9601"
      misc_timeout 10
    }
  }
}

```

and bypass script
```
#! /bin/bash
#set -x
#
# Gael Charriere <email address hidden>
# 10.11.2008
#
# Invoked by keepalived from master/slave
# to slave/master transition to add or remove
# a PREROUTING rule
#
# Essential for slave to redirect incoming
# service packet to localhost. Otherwise a
# loop can appear between master and slave.
#
# The routing table is consulted when a packet
# that creates a new connection is encountered.
# PREROUTING rule alters packets as soon as they come in.
# REDIRECT statement redirects the packet to the machine
# itself by changing the destination IP to the primary
# address of the incoming interface (locally-generated
# packets are mapped to the 127.0.0.1 address).

# Check number of command line args
EXPECTED_ARGS=2
if [ $# -ne $EXPECTED_ARGS ]; then
  echo "Usage: $0 {add|del} ipaddress"
  exit 1
fi

# Check if second arg is a valid ip address
VIP=$2
OLD_IFS=$IFS
IFS="."
VIP=( $VIP )
IFS=$OLD_IFS
# Check that ip has 4 parts
if [ ${#VIP[@]} -ne 4 ]; then
  echo "IP address must have 4 parts"
  echo "Usage: $0 {add|del} ipaddress"
  exit 1
fi

# Check that each parts is a number which
# varies between 0 and 255
for oct in ${VIP[@]} ; do
  echo $oct | egrep "^[0-9]+$" >/dev/null 2>&1
  if [ $? -ne 0 ]; then
    echo "$oct: Not numeric"
    echo "Usage: $0 {add|del} ipaddress"
    exit 1
  else
    if [ $oct -lt 0 -o $oct -gt 255 ]; then
      echo "$oct: Out of range"
      echo "Usage: $0 {add|del} ipaddr...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for netplan.io (Ubuntu) because there has been no activity for 60 days.]

Changed in netplan.io (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for netplan because there has been no activity for 60 days.]

Changed in netplan:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.