<div dir="ltr">There is an edge case to that: when you remove a machine and add a new one an ID cannot be reused.<div><br></div><div>I believe it's just auto-increment in the database: one does not reuse auto-incremented IDs for efficiency (otherwise you have to implement "find first available unused ID" functionality).</div><div><br></div><div>So, if there is a machine "1" in the model which gets deleted and a --to 1 placement directive in a new bundle with --use-existing-machines flag passed, this new machine will get a new ID (depending on how many placement directives like that already exist and implementation it may not be <lastid> + 1).</div><div><br></div><div>I think this edge case can stay as is because you've already hacked an initial model further at this point - just modify your add-on bundle to reflect the model state.</div><div><br></div><div>But a clean deployment is an important case to consider in my view.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Best Regards,<div>Dmitrii Shcherbakov</div><div><br></div><div><div style="color:rgb(136,136,136);font-size:12.8px"><span style="color:rgb(68,68,68);font-size:12.8px">Field Software Engineer</span><br style="color:rgb(68,68,68);font-size:12.8px"><span style="font-size:12.8px">IRC (freenode): Dmitrii-Sh</span><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Nov 10, 2017 at 4:13 PM, roger peppe <span dir="ltr"><<a href="mailto:roger.peppe@canonical.com" target="_blank">roger.peppe@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10 November 2017 at 10:40, Dmitrii Shcherbakov<br>
<span class=""><<a href="mailto:dmitrii.shcherbakov@canonical.com">dmitrii.shcherbakov@<wbr>canonical.com</a>> wrote:<br>
> This might not be an ideal example after all. However, I encountered<br>
> something else in this case - final model machine IDs are not the same as I<br>
> would expect while looking at the bundle.<br>
<br>
</span>I'd've thought that --use-existing-machines might solve that case, but...<br>
I guess it depends if --use-existing-machines also guarantees that any new<br>
machines created will have machine ids that match the ones in the bundle.<br>
<br>
If not, I guess it probably should.<br>
</blockquote></div><br></div>