Rolling restart

Is there a way to trigger a rolling restart? I just ran a fly restart and was surprised to see all of my VMs restart at once which dropped customer traffic for ~20s.

As a workaround you could trigger a new rolling deploy.

I’ve found that doing a “no-op” deploy causes fly to merely tag the existing VMs with the new release version. When I’m just changing config that’s what I want, but it would sure be nice to have a way to replace/restart the VMs without having to do things like add a random text file to the image.

It is possible to restart an individual VM using the GraphQL API, so it’s possible for an application to iterate through your VMs and trigger restarts one by one, but I don’t know if this is a feature available on the CLI. Adding a comment line in a file in your code would trigger a redeploy and might be the only way for now.

flyctl restart does what you want.

@michael That’s the command I ran that caused my VMs to all restart at the same time.

Edit: Unless you’re saying there’s a difference between flyctl restart and fly restart?

I’ve also observed that flyctl restart performs a pretty quick restart that might drop traffic for 10 - 20 seconds. If you want direct control over the cadence of the restart you can use flyctl vm restart [vm-ID] to restart the VMs individually by ID.

Seems like your only option for now is some kind of insignificant change to trick fly into doing a full rolling deploy of your “new version”. Maybe a comment somewhere in your code you can toggle part of :joy: .

Here’s my workaround for now:

Rolling Restart

  1. fly status --json | jq '.Allocations[].IDShort' - Lists the active VMs
  2. For each VM one at a time : fly vm restart <ID>
  3. You can monitor the progress of each VM with: fly vm status <ID>

Will restart drop in-flight requests?

This is reported as fixed in the latest logbook!

1 Like