I’d like to start on a fresh rancher stack due to too much testing on my current environment. However I’ve one host (and their containers) that I can’t interrupt because the services on it are in production.
So my goal is to create a new rancher-server from scratch and I wanna know how to unlink my critical host from the current rancher-server and link it to the new one ?
Two important points:
my old and new rancher will use custom address space (10.42/16 is already use
the containers on my critical host have been create using the stack feature of rancher
You can destroy the agent container, rm -rf /var/lib/rancher/state, and register it to the new server. The containers will continue to run, but Stack/Service definitions are in the database so they will just show up as standalone containers. I would add that host first, as bad things™ will probably happen if an IP is duplicated on import.
But really if they’re that critical you should probably have a tested way to re-create them from scratch/backup… what happens if that host lights on fire right now?
Thanks for your feedback. In fact my host (where the containers live) don’t gonna move. Only rancher-server will change. I notice your approach and if I’m right the only think I’ll lost is the service/stack definition. I suppose there are no way to create a newstack (in the new rancher-server installation) and import the orphelin containers ?
Your second proposal to recreate container from schratch could be okay, all there containers use convoy (with devicemapper), so I’ll try this approach maybe.