Model migrations fail if cloud names don't match

Bug #1650251 reported by Menno Finlay-Smits
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Christian Muirhead

Bug Description

Users can define their own clouds and model migrations can fail a cloud names isn't defined on the target even if they underlying substrate is actually the same.

When trying to migrate a LXD based model (using the "localhost" cloud) to another LXD controller using the "lxd" cloud the following error resulted:

ERROR juju.worker.migrationmaster:baed22 model data transfer failed, failed to import model into target controller: updating cloud credentials: cloud "localhost" not found (not found)

description: updated
Revision history for this message
Christian Muirhead (2-xtian) wrote :

Looking in the database, the clouds collection for each controller has one item, named "localhost" or "lxd" depending on how it was bootstrapped. When a model exported from the lxd controller is imported to the localhost one, the import code tries to find the lxd cloud and can't. Rather than trying to fix it at this point where there's not really enough context, it would make more sense to ensure that both controllers get a cloud named "localhost" whether they were bootstrapped with "localhost" (the cloud name) or "lxd" (the provider name).

The bootstrap code tries to find the cloud by the name given (which fails for lxd) and then tries it as the provider name. If it finds the provider by name, it should ask the provider for the default cloud name (similar to what it does for regions) and use that instead of just passing on the provider name as the cloud name.

Revision history for this message
Christian Muirhead (2-xtian) wrote :

Add this behaviour to bootstrap and the lxd provider.

PR: https://github.com/juju/juju/pull/6735

Changed in juju:
status: New → In Progress
assignee: nobody → Christian Muirhead (2-xtian)
Revision history for this message
Christian Muirhead (2-xtian) wrote :
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
milestone: 2.1.0 → 2.1-rc1
Curtis Hovey (sinzui)
Changed in juju:
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.