# Create stack with restart:always

**URL:** <https://forums.suse.com/t/create-stack-with-restart-always/4471>\
**Category:** Rancher 1.x\
**Created:** [October 28, 2016, 7:58pm UTC](https://forums.suse.com/t/create-stack-with-restart-always/4471 "2016-10-28T19:58:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpfarher](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cpfarher/32/1821_2.png) [@cpfarher](https://forums.suse.com/u/cpfarher)\
**Post date:** [October 28, 2016, 7:58pm UTC](https://forums.suse.com/t/create-stack-with-restart-always/4471/1 "2016-10-28T19:58:20Z")

</div>

Hello, I have a problem when create a new **Stack** with rancher. My infrastructure is a **Host A** (where runs rancher server), and **Host B** (where deploy the system - rancher stack).

I create a stack uploading a docker-compose.yml or copying in it with the options `restart: always` in order to auto start container after restart de **host B.** If **host B** start and do not has connection to **Host A** (where Rancher Server runs), containers never starts in **host B**  
I checked that the container in `/var/lib/docker/containers/my_container/hostconfig.json` has `RestartPolicy: {Name: ""}`. I think this is wrong… It should be \> `RestartPolicy: {Name: "always"}.`…  
Also, when I upgrade the stack, Autostart option was selected with “always”, but I get the same result…

Is there any way to indicate in a stack of rancher that a container run always after restart the host, independenlty of the connection to the rancher server?  
Thank you

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [October 28, 2016, 11:16pm UTC](https://forums.suse.com/t/create-stack-with-restart-always/4471/2 "2016-10-28T23:16:05Z")

</div>

The restarting of containers created by services is managed by the rancher/server, for various reasons like ensuring that the network agent and related services are up before the container is started.

Standalone one-off containers have options that directly set the docker restart policy.

---

<div class="post-metadata">

**Author:** ![cpfarher](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cpfarher/32/1821_2.png) [@cpfarher](https://forums.suse.com/u/cpfarher)\
**Post date:** [October 31, 2016, 10:47am UTC](https://forums.suse.com/t/create-stack-with-restart-always/4471/3 "2016-10-31T10:47:32Z")

</div>

Hello Vincent, so, in conclusion, I can’t use stack and set the restart policy to “always”.  
The bad part is If I use standalone containers, I can’t deploy the stack created with the assigned tag to any host. This feature is very util.  
Also, I can not upgrade standalone containers from UI like the upgrade option in stack services  
Are there any other alternative?  
Thank You

---

<div class="post-metadata">

**Author:** ![scippio](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/scippio/32/2716_2.png) [@scippio](https://forums.suse.com/u/scippio)\
**Post date:** [August 22, 2017, 9:09am UTC](https://forums.suse.com/t/create-stack-with-restart-always/4471/4 "2017-08-22T09:09:32Z")

</div>

I have same problem… When server is not online and some hosts restarted… all is down ☹ So the “restart always” feature in rancher is not so useful… 😭

---

<div class="post-metadata">

**Author:** ![scippio](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/scippio/32/2716_2.png) [@scippio](https://forums.suse.com/u/scippio)\
**Post date:** [August 22, 2017, 9:50am UTC](https://forums.suse.com/t/create-stack-with-restart-always/4471/5 "2017-08-22T09:50:53Z")

</div>

I found the High Availability in rancher… I’ll explore it… Maybe this is the solution.
