juju icon indicating copy to clipboard operation
juju copied to clipboard

Handle model migration/upgrade when using Fan networking method

Open nvinuesa opened this issue 1 year ago • 2 comments

Since we are removing the fan support on 4.0, and therefore the fanconfigurer worker and facades are being removed, we must ensure that 3.6->4.0 migrations continue working. By checking if the error is NotImplemented, we can avoid failing in the fanconfigurer worker and allow the migrations to continue.

Also to fix the fact that we need to do something with the models that currently use the fan networking, we have decided to prevent the migration/upgrade of models with the config container-networking-method=fan only if there are containers deployed. This is done by adding a new validation method on model migration/upgrade.

Checklist

  • [X] Code style: imports ordered, good names, simple structure, etc
  • [X] Comments saying why design decisions were made
  • [ ] ~Go unit tests, with comments saying what you're testing~
  • [ ] ~Integration tests, with comments saying what you're testing~
  • [ ] ~doc.go added or updated in changed packages~

QA steps

Blocked model

The first scenario is to try migrating a model that uses the Fan networking and has a container deployed. This migration should be blocked.

# (sudo snap install juju_4 --channel 4.0/edge)
juju_4 bootstrap aws c40
juju bootstrap aws c36                     
juju add-model m
juju model-config container-networking-method
fan
juju deploy ubuntu --to lxd
# Once it finished deploying, migrate it to c40:
juju migrate m c40
ERROR source prechecks failed: cannot migrate to controller due to issues:
"admin/m":
- cannot migrate models with container-networking-method=fan and containers deployed

Happy model

This scenario is almost the same, but instead of deploying ubuntu to a container, it's deployed to a machine and therefore the same migration isn't blocked:

# (sudo snap install juju_4 --channel 4.0/edge)
juju_4 bootstrap aws c40
juju bootstrap aws c36                     
juju add-model m
juju model-config container-networking-method
fan
juju deploy ubuntu 
# Once it finished deploying, migrate it to c40:
juju migrate m c40
Migration started with ID "53d9d006-ccd9-4b6b-8824-e7b084a5828e:0"

At this point, you should be able to check the correct status of the migrated model.

Links

Jira card: JUJU-6061

nvinuesa avatar May 27 '24 08:05 nvinuesa

This breaks 3.6 -> 3.6 migrations

$ juju bootstrap aws/eu-west-2 aws-dst
$ juju bootstrap aws/eu-west-2 aws-src
$ juju add-model m
$ juju deploy ubuntu --to lxd
$ juju migrate m aws-dst
ERROR source prechecks failed: cannot migrate to controller due to issues:
"admin/m":
- cannot migrate models with container-networking-method=fan and containers deployed

I imagine this was not the intention?

This check should maybe be a destination controller check? This pre-check means 3.6 needed knowledge of 4.0 implementation details.

Another problem is, as you point out in chat, this must target 3.6, which will mean 3.5 -> 4.0 migrations will be impossible (3.5 -> 4.0 migrations may be a bit a of utopia at this point, but I'd still like it if we could in theory fix it)

jack-w-shaw avatar Jun 03 '24 12:06 jack-w-shaw

We probably should also update the fan documentation. https://discourse.charmhub.io/t/fan-container-networking/1065

hpidcock avatar Jun 03 '24 21:06 hpidcock