{"action":"created","issue":{"url":"https://api.github.com/repos/deis/deis/issues/3605","labels_url":"https://api.github.com/repos/deis/deis/issues/3605/labels{/name}","comments_url":"https://api.github.com/repos/deis/deis/issues/3605/comments","events_url":"https://api.github.com/repos/deis/deis/issues/3605/events","html_url":"https://github.com/deis/deis/issues/3605","id":72298206,"number":3605,"title":"Failure to create a container leaves others created","user":{"login":"mboersma","id":73019,"avatar_url":"https://avatars.githubusercontent.com/u/73019?v=3","gravatar_id":"","url":"https://api.github.com/users/mboersma","html_url":"https://github.com/mboersma","followers_url":"https://api.github.com/users/mboersma/followers","following_url":"https://api.github.com/users/mboersma/following{/other_user}","gists_url":"https://api.github.com/users/mboersma/gists{/gist_id}","starred_url":"https://api.github.com/users/mboersma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mboersma/subscriptions","organizations_url":"https://api.github.com/users/mboersma/orgs","repos_url":"https://api.github.com/users/mboersma/repos","events_url":"https://api.github.com/users/mboersma/events{/privacy}","received_events_url":"https://api.github.com/users/mboersma/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/deis/deis/labels/scheduler","name":"scheduler","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-30T22:23:39Z","updated_at":"2015-04-30T23:51:08Z","closed_at":null,"body":"If `deis scale cmd=5` creates 4 containers but fails on the 5th, it raises an exception and leaves 4 containers in the \"created\" state, not running. The code in question is here: https://github.com/deis/deis/blob/master/controller/api/models.py#L272-L292\r\n\r\nIt would be more intuitive and useful behavior if instead Deis made a \"best effort\" to start whichever containers it was able to create. In this particular case we used `deis limits:set -c cmd=1024` to ensure some containers wouldn't be created due to resource limitations, then scaled up, and were left with this:\r\n```console\r\n$ deis info\r\n=== zigzag-drumroll Application\r\n{\r\n  \"updated\": \"2015-04-30T22:05:12UTC\", \r\n  \"uuid\": \"0c0dd591-5d9c-45c4-914d-52d703886cb3\", \r\n  \"created\": \"2015-04-30T21:53:21UTC\", \r\n  \"url\": \"zigzag-drumroll.local5.deisapp.com\", \r\n  \"owner\": \"test\", \r\n  \"id\": \"zigzag-drumroll\", \r\n  \"structure\": {\r\n    \"cmd\": 1\r\n  }\r\n}\r\n\r\n=== zigzag-drumroll Processes\r\n\r\n--- cmd: \r\ncmd.1 created (v3)\r\ncmd.2 created (v3)\r\ncmd.3 created (v3)\r\ncmd.4 created (v3)\r\ncmd.5 destroyed (v3)\r\n```"},"comment":{"url":"https://api.github.com/repos/deis/deis/issues/comments/98003753","html_url":"https://github.com/deis/deis/issues/3605#issuecomment-98003753","issue_url":"https://api.github.com/repos/deis/deis/issues/3605","id":98003753,"user":{"login":"mboersma","id":73019,"avatar_url":"https://avatars.githubusercontent.com/u/73019?v=3","gravatar_id":"","url":"https://api.github.com/users/mboersma","html_url":"https://github.com/mboersma","followers_url":"https://api.github.com/users/mboersma/followers","following_url":"https://api.github.com/users/mboersma/following{/other_user}","gists_url":"https://api.github.com/users/mboersma/gists{/gist_id}","starred_url":"https://api.github.com/users/mboersma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mboersma/subscriptions","organizations_url":"https://api.github.com/users/mboersma/orgs","repos_url":"https://api.github.com/users/mboersma/repos","events_url":"https://api.github.com/users/mboersma/events{/privacy}","received_events_url":"https://api.github.com/users/mboersma/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T23:51:08Z","updated_at":"2015-04-30T23:51:08Z","body":"It's not hard to fix the models.py code to start the containers which were created successfully, which fixes this case. The tricky part is bubbling up the particular errors so the `deis` CLI can see that some containers started, but also know why some were not."}}