Page MenuHomePhabricator

Reimage cookbook sets off Pybal alerts when using `--move-vlan` without `--conftool` on hosts
Open, LowPublic

Description

Hello IF,

We've been reimaging some WDQS hosts in T430880. What we have found is that if we reimage hosts with the --move-vlan flag enabled WITHOUT depooling the host † it sets off PyBal alerts such as

PROBLEM - PyBal IPVS diff check on lvs2013 is CRITICAL: (CRITICAL: Mismatch between IPVS and PyBal https://wikitech.wikimedia.org/wiki/PyBal

I triggered this at least twice by reimaging wdqs2018 and wdqs2019. Are you able to add a warning that shows when the --move-vlan flag is used, or some other mitigation?

Thanks for taking a look!

Update: I depooled wdqs1013 before reimaging and it seems like the alerts still fired. From #wikimedia-traffic IRC today:

[06:14:31]  <ryankemper> Could someone do a rolling pybal restart on `lvs1019`/`lvs1020`? After `wdqs1013`’s VLAN move, DNS changed from `10.64.32.105` to `10.64.171.13`, but pybal is still probing the old IP and therefore keeps the host down/not pooled. Readiness checks are passing on the new IP (T430880)
[06:14:38]  <ryankemper> No immediate service impact; wdqs1013 is the only affected backend, and the other 10 backends in eqiad/wdqs-main remain healthy
[14:08:49]  <inflatador> ryankemper sukhe FYI I definitely depooled that one prior to reimage `RI=wdqs1013; sudo cumin --force ${RI}* 'depool'; sudo cookbook sre.hosts.reimage --os bookworm ${RI} --move-vlan`

Did I depool the server incorrectly, or is this happening even when the host is depooled?

† Sadly, I always assumed the reimage cookbooks depooled the hosts automatically.

Event Timeline

@bking my understanding is that the host changes IP address so IPVS/Pybal need to be fixed to list the new value. What is the use case of not using depool before a reimage?

@elukey As I stated above, I always believed the cookbooks depooled the hosts automatically, and I only became aware of the flag to depool yesterday. I admit it's a bad assumption on my part, but based on my discussion in IRC yesterday I know I'm not the only one.

Since the reimage cookbook invites you to use --move-vlan, I would say that the cookbook should explain the risks associated with using that flag as well. I accept full responsibility for not depooling the host, but if there's a way to avoid setting off alerts that other teams have to respond to, I think we should try it.

@elukey I was thinking about this in the shower this morning and I may have finally grasped the meaning behind your comment "What is the use case of not using depool before a reimage?" Honestly, there does not really seem to be a use case for not depooling. Would you accept a patch to the reimage cookbook that defaults to depooling the host?

bking changed the task status from Open to In Progress.Thu, Jul 23, 7:35 PM
bking changed the task status from In Progress to Open.
bking triaged this task as Medium priority.
bking lowered the priority of this task from Medium to Low.

Okay, I think I figured out what's going on here.

Setting pooled=inactive is the only way to avoid the pybal/LVS mismatch, which otherwise happens deterministically.

As such with respect to this ticket, the fix is the following:

When --move-vlan is supplied for a host with Conftool objects, it must enable --conftool and require --conftool-value=inactive before changing the address

(because there's an edge case where someone could supply --conftool --conftool-value=no - I don't know if anyone has ever actually done that, but we should guard against it all the same)

Here's a table of live observations from T430880, which shows that the issue only manifests if we don't set pooled=inactive (i.e. it *does* manifest on pooled=no):

image.png (1,516×332 px, 67 KB)


Alright, on to tracing the actual mechanism:

(1) DNS gets resolved inside initialize()
(2) And the initialize() itself is only called in the branch where a new host is detected
(3) And we only hit that branch when the host was absent from the config pybal assembled:
pooled=inactive is what makes it absent, because it decodes to the same sentinel as a deleted key, and the caller then deletes those keys from the config
pooled=no leaves the host present but disabled, so we take the merge branch instead and the object keeps the address it resolved when it was first built

bking renamed this task from Reimage cookbook sets off Pybal alerts when using `--move-vlan` on pooled hosts to Reimage cookbook sets off Pybal alerts when using `--move-vlan` without `--conftool` on hosts.Mon, Jul 27, 2:22 PM