footloose icon indicating copy to clipboard operation
footloose copied to clipboard

How to update the nodes after changing the config?

Open brightzheng100 opened this issue 4 years ago • 2 comments

It may not be that common to update the config after footloose start -- you may argue that why not just delete and start again.

But there is a potential aha moment that you may think to add one or more extra node(s) after applying footloose start with a bunch of work that has been done.

How can I "refresh" the config, say by adding one more node? Is it a good idea to have such a footloose update command to do that magic?

brightzheng100 avatar Jun 07 '20 03:06 brightzheng100

Well, just did some experiment and here might be a potential workaround:

  1. update the footloose.yaml file with extra node;
  2. now footloose show will see that the "extra" node "hasn't been created";
  3. then footloose stop to stop all nodes;
  4. then footloose create to create again where footloose is smart enough to detect whether to create those new ones while marking the existing ones Machine xxx is already created..., which is cool;
  5. then footloose start to start all nodes;
  6. and guess what, the work is still in those old nodes without any loss!

But I believe we can streamline this process maybe.

brightzheng100 avatar Jun 07 '20 03:06 brightzheng100

As easy as this:

stelb@stelb-TUXEDO:/tmp/demo$ footloose config create
stelb@stelb-TUXEDO:/tmp/demo$ footloose create
INFO[0000] Creating SSH key: cluster-key ...            
INFO[0000] Docker Image: quay.io/footloose/centos7:0.6.3 present locally 
INFO[0000] Creating machine: cluster-node0 ...          

stelb@stelb-TUXEDO:/tmp/demo$ perl -i.bka -pe 's/: 1/: 2/' footloose.yaml 
stelb@stelb-TUXEDO:/tmp/demo$ footloose create
INFO[0000] Docker Image: quay.io/footloose/centos7:0.6.3 present locally 
INFO[0000] Creating machine: cluster-node0 ...          
INFO[0000] Machine cluster-node0 is already created...  
INFO[0000] Creating machine: cluster-node1 ...          

If you change more than just the machine count, e.g. adding volumes this cannot be done like this.

stelb avatar Jun 08 '20 17:06 stelb