<div dir="ltr">I think this is a good case for API WG as statuses of entities should be consistent among OpenStack APIs. As I recall, we are mixing two different statuses for environments. The first dimension for environment status is its content status: NEW, CONFIGURING, READY<div>The second dimension is deployment status after Murano engine executes deployment action for this environment with statuses: NOT DEPLOYED, DEPLOYING, SUCCESS, FAIL</div><div><br></div><div>Thanks</div><div>Gosha<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 12, 2015 at 7:38 AM, Andrew Pashkin <span dir="ltr"><<a href="mailto:apashkin@mirantis.com" target="_blank">apashkin@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Initiall my interest to that problem was caused by the bug [1] due to whose<br>
once environment was deployed with failure it stays forever with that status<br>
even if it have been deployed sucessfully later.<br>
<br>
For now status determination happens in three stages:<br>
<br>
- If at least one of all sessions of env, regardless of version, is in<br>
  DEPLOYING/DELETING or DEPLOY_FAILURE/DELETE_FAILURE states - state of that<br>
  session taken as state of environment. Sessions prioritized by version and<br>
  midification date.<br>
- If there is no such sessions, but  at least one is in OPENED state -<br>
  environment state will be PENDING.<br>
- Otherwise environment will have READY status.<br>
<br>
Accordingly to that - once session was deployed with failure - it stays<br>
in that<br>
status even if it was deployed successfully later.<br>
<br>
In UI statuses are taken directly from API except another "calculated"<br>
status<br>
NEW. Environment matches status NEW if it has version = 0 and it has<br>
apps with<br>
status 'pending' [2].<br>
<br>
After discussion inside Mirantis Murano team we came to these thoughts:<br>
- We need to remove statuses that does not related to deployment (PENDING).<br>
- Introduce NEVER_DEPLOYED (or NEW) status.<br>
- Change READY to DEPLOYED.<br>
- Possibly we need to keep state in Environment table in DB and no<br>
calculate it<br>
  queriyng session every time.<br>
<br>
PENDING status was needed to indicate that another user do something<br>
with the<br>
environment. But it was decided, that this information must be placed<br>
somwhere<br>
else, to not be in coflict with deployment status. Another proposal was to<br>
additionaly show if environment has some "dirty"/not-deployed changes in it.<br>
<br>
First of all let's discuss quick fix of the alghorithm of Environment status<br>
matching [3]. I propose to take status of last modified session as<br>
status of an<br>
environment.<br>
<br>
At second let's discuss overall situation and more extensive changes that we<br>
might want introduce.<br>
<br>
<br>
[1] <a href="https://bugs.launchpad.net/murano/+bug/1413260" target="_blank">https://bugs.launchpad.net/murano/+bug/1413260</a><br>
[2]<br>
<a href="https://github.com/stackforge/murano-dashboard/blob/master/muranodashboard/environments/api.py#L140-140" target="_blank">https://github.com/stackforge/murano-dashboard/blob/master/muranodashboard/environments/api.py#L140-140</a><br>
[3]<br>
<a href="https://github.com/stackforge/murano/blob/017d25f49e60e18365a50756f524e15f8d4fa78a/murano/db/services/environments.py#L62" target="_blank">https://github.com/stackforge/murano/blob/017d25f49e60e18365a50756f524e15f8d4fa78a/murano/db/services/environments.py#L62</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
With kind regards, Andrew Pashkin.<br>
cell phone - <a href="tel:%2B7%20%28985%29%20898%2057%2059" value="+79858985759">+7 (985) 898 57 59</a><br>
Skype - waves_in_fluids<br>
e-mail - <a href="mailto:apashkin@mirantis.com">apashkin@mirantis.com</a><br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><font color="#999999"><span style="background-color:rgb(255,255,255)">Georgy Okrokvertskhov<br>
Architect,<br><span style="font-family:arial;font-size:small">OpenStack Platform Products,</span><br>
Mirantis</span><br>
<a href="http://www.mirantis.com/" target="_blank">http://www.mirantis.com</a><br>
Tel. +1 650 963 9828<br>
Mob. +1 650 996 3284</font><br></div></div>
</div></div></div>