vip_cidr is not read from network in MAAS, it's left at a default of /24

Bug #1498605 reported by David Britton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Server
Fix Released
High
Данило Шеган
15.07
Fix Released
High
Данило Шеган
Cisco-odl
Fix Released
Medium
Данило Шеган
percona-cluster (Juju Charms Collection)
Fix Released
High
Данило Шеган

Bug Description

I'm not sure the errors that this could cause, but the broadcast address will be computed incorrectly, for one.

This appears to apply to the mysql hacluster only. The other services have the correct cidr_netmask set (255.255.0.0), which is a longhand of the cidr itself.

The other services, I'm not sure how they get the subnetmask set correctly. It's probalby worth looking into how they do.

Some useful commands:

sudo crm configure show
sudo crm configure edit
ip addr
sudo crm resource show
sudo crm status

It's a bit unconfirmed, but this appears to have a caused a clustering issue with mysql. Basically only one out of every 3 `nova list` commands would work, the others would get 500 errors. Fixing this setting in the charm, and then manually with `sudo crm configure edit` appears to have addressed the issue.

Related branches

David Britton (dpb)
Changed in landscape:
milestone: none → 15.07
tags: removed: kanban
David Britton (dpb)
description: updated
description: updated
David Britton (dpb)
description: updated
Changed in landscape:
milestone: 15.07 → none
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I did a fresh deploy and mysql was the only service with an incorrect netmask for the vip ip (in the output of ip addr):
19: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:16:3e:93:77:4b brd ff:ff:ff:ff:ff:ff
    inet 10.96.8.45/16 brd 10.96.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.96.10.9/24 brd 10.96.10.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fe93:774b/64 scope link
       valid_lft forever preferred_lft forever

Note that the vip (10.9) also has the same scope as the other IP, instead of "scope global secondary" like the other services. For example:
15: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:16:3e:27:ec:c4 brd ff:ff:ff:ff:ff:ff
    inet 10.96.8.143/16 brd 10.96.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.96.10.108/16 brd 10.96.255.255 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fe27:ecc4/64 scope link
       valid_lft forever preferred_lft forever

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

percona-cluster (mysql) is the "only" charm (of those I checked) that will take the vip_cidr charm config option and apply as is:

    vip_cidr = config('vip_cidr')
(...)
        vip_params = 'params ip="%s" cidr_netmask="%s" nic="%s"' % \
                     (vip, vip_cidr, vip_iface)

Others do something differently, and try to detect the right netmask before taking the cidr from the charm config option.

Like openstack-dashboard:
        netmask = (get_netmask_for_address(vip) or
                   config('vip_cidr'))

My observations:
a) maybe percona-cluster should be changed and also try to auto-detect the netmask, following the same pattern
b) maybe landscape should be setting vip_cidr in all cases. We know the cidr (we have to, since it's an argument to the MAAS API call that reserves a VIP). But all these charms other than percona-cluster would keep ignoring it and try the autodetect route first
c) maybe the charms should only be doing autodetection of the netmask if vip_cidr was NOT provided, i.e., it's at the charm config default value. If vip_cidr was set, then just use that.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I attached a branch that does (a), fwiw.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Download full text (3.3 KiB)

A deployment done with that branch worked, mysql/0 (the leader) has the correct netmask for the secondary IP, and it's also listed as a secondary now:

$ juju ssh mysql/0
Warning: Permanently added '10.96.10.114' (ECDSA) to the list of known hosts.
Warning: Permanently added '10.96.9.16' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-63-generic x86_64)

 * Documentation: https://help.ubuntu.com/

 System information disabled due to load higher than 4.0

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

ubuntu@juju-machine-0-lxc-5:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
25: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:16:3e:a6:8d:6b brd ff:ff:ff:ff:ff:ff
    inet 10.96.9.16/16 brd 10.96.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.96.10.109/16 brd 10.96.255.255 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fea6:8d6b/64 scope link
       valid_lft forever preferred_lft forever

$ juju status mysql --format=tabular
[Services]
NAME STATUS EXPOSED CHARM
hacluster-mysql false cs:trusty/hacluster-23
landscape-client false cs:trusty/landscape-client-12
mysql unknown false cs:~ahasenack/trusty/percona-cluster-autodetect-vip-0

[Units]
ID WORKLOAD-STATE AGENT-STATE VERSION MACHINE PORTS PUBLIC-ADDRESS MESSAGE
mysql/0 unknown idle 1.24.5 0/lxc/5 10.96.9.16
  hacluster-mysql/0 unknown idle 1.24.5 10.96.9.16
  landscape-client/30 unknown idle 1.24.5 10.96.9.16
mysql/1 unknown idle 1.24.5 2/lxc/5 10.96.8.230
  hacluster-mysql/1 unknown idle 1.24.5 10.96.8.230
  landscape-client/32 unknown idle 1.24.5 10.96.8.230
mysql/2 unknown idle 1.24.5 4/lxc/5 10.96.9.11
  hacluster-mysql/2 unknown idle 1.24.5 10.96.9.11
  landscape-client/36 unknown idle 1.24.5 10.96.9.11

[Machines]
ID STATE VERSION DNS INS-ID SERIES HARDWARE
0 started 1.24.5 squier.scapestack /MAAS/api/1.0/nodes/node-60c21846-546c-11e4-821d-2c59e54ace74/ trusty arch=amd64 cpu-cores=4 mem=16384M
2 started 1.24.5 hendel.scapestack /MAAS/api/1.0/nodes/node-f7bd8a1c-39ec-...

Read more...

Revision history for this message
Данило Шеган (danilo) wrote :

After discussing with James, we've agreed to make percona-cluster charm behave the same as other charms.

We are keeping the autodetect-first, default to explicitely provided value in the config if autodetection fails: there are reasons (customers) for that, though it does seem weird.

information type: Proprietary → Public
Changed in percona-cluster (Juju Charms Collection):
assignee: nobody → Данило Шеган (danilo)
status: New → In Progress
James Page (james-page)
Changed in percona-cluster (Juju Charms Collection):
status: In Progress → Fix Committed
Changed in percona-cluster (Juju Charms Collection):
importance: Undecided → High
milestone: none → 15.10
Changed in landscape:
milestone: none → 15.08
Revision history for this message
Данило Шеган (danilo) wrote :

Committed to r9086 of release-29 branch for Landscape.

Revision history for this message
Данило Шеган (danilo) wrote :

release-29 merged into lp:landscape r9247.

Changed in landscape:
status: New → Fix Committed
Changed in landscape:
assignee: nobody → Данило Шеган (danilo)
Changed in landscape:
status: Fix Committed → Fix Released
milestone: 15.08 → 15.07
James Page (james-page)
Changed in percona-cluster (Juju Charms Collection):
status: Fix Committed → Fix Released
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.