juju addmodel takes time to see the space in MaaS

Bug #1662264 reported by Ashley Lai
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Witold Krecicki

Bug Description

There is a delay in juju to see the space in MaaS after add-model. This can be reproduced by running a script that add-model and deploy right after it. I can't reproduce when I run each command manually. When it does not work it complaints that the space is not valid.

Larry Michel (lmic)
tags: added: oil oil-2.0
Revision history for this message
Ashley Lai (alai) wrote :

I forgot to mention that I tested this in beta5.

Ashley Lai (alai)
tags: removed: oil-2.0
tags: added: oil-2.0
removed: oil
Changed in juju:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Anastasia (anastasia-macmood) wrote :

We are discussing how to improve this experience.

Currently, we run spaces discovery as part of model initialization: there is a worker that starts up once its dependencies are available. However, there are number of different workers that run at this same time. It's possible that space discovery worker waits for other workers to come up.

Revision history for this message
John A Meinel (jameinel) wrote :

from what I can tell, there is going to be a delay as the workers start for a new model, and then it takes ~5s for the various queries to execute against maas and be turned into DB records.

Arguably we should not return from AddModel before its really ready to be used. We could potentially pre-seed the spaces known about in the model if we know the credentials, etc match an existing model. We could also just do some hypothetical direct "model.EnsureComplete()" as part of creating the model, before returning the reference to the new object.

Certainly we switched 'bootstrap' to be synchronous for the same reason (it isn't very useful to do bootstrap and try to do the next step when nothing will actually work yet).

I doubt we can get this in for 2.1 final, but we can focus on it early in 2.2.

Changed in juju:
importance: Medium → High
milestone: none → 2.2.0
Larry Michel (lmic)
tags: added: cdo-qa-blocker
Ryan Beisner (1chb1n)
tags: added: uosci
Revision history for this message
Anastasia (anastasia-macmood) wrote :

We will not be able to address this in 2.2 due to capacity and time constraints - I am moving it into the next milestone: 2.3.

Meanwhile, as a workaround, please add a sleep in the script to ensure that there is sufficient time for space discovery after a model has been added. From comment # 3, anything over 5s should work :D

Changed in juju:
milestone: 2.2-beta1 → 2.3-alpha1
Witold Krecicki (wpk)
Changed in juju:
assignee: nobody → Witold Krecicki (wpk)
Tim Penhey (thumper)
Changed in juju:
milestone: 2.3-alpha1 → 2.2-rc1
Witold Krecicki (wpk)
Changed in juju:
status: Triaged → In Progress
Revision history for this message
Witold Krecicki (wpk) wrote :
Witold Krecicki (wpk)
Changed in juju:
status: In Progress → Fix Committed
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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