Creating a volume made my vm re-deploy into the wrong region

Hi! I had an app re-deploy into the wrong region when I created a volume.

Fly version

fly v0.0.325 darwin/arm64 Commit: da2b638 BuildDate: 2022-04-28T04:26:35Z

I have an app setup with the allowed region as syd.

> fly regions list
Region Pool:
syd
Backup Region:

I’ve done about 40 deploys so far and all have them have been fine, and all automatically re-deployed in syd.

I just created a volume in syd to attempt to start trying postgres. The volume appeared to be created successfully.

Status before volume creation

> fly status
App
  Name     = sp-api
  Owner    = personal
  Version  = 38
  Status   = running
  Hostname = sp-api.fly.dev

Instances
ID      	PROCESS	VERSION	REGION	DESIRED	STATUS 	HEALTH CHECKS     	RESTARTS	CREATED
31eba679	app    	38     	syd   	run    	running	1 total, 1 passing	0       	8h47m ago

Volume creation

> fly vol create db_test_vol -s 1 -r syd
        ID: vol_ypkl7vz8j1evqg60
      Name: db_test_vol
       App: sp-api
    Region: syd
      Zone: af82
   Size GB: 1
 Encrypted: true
Created at: 05 May 22 12:03 UTC

However, my app redeployed upon creating the volume, into the nrt region, as confirmed in the dash and via cli

> fly status
App
  Name     = sp-api
  Owner    = personal
  Version  = 39
  Status   = running
  Hostname = sp-api.fly.dev

Instances
ID      	PROCESS	VERSION	REGION	DESIRED	STATUS 	HEALTH CHECKS     	RESTARTS	CREATED
16ade667	app    	39     	nrt   	run    	running	1 total, 1 passing	0       	56s ago

My questions are

  1. Why did this happen, did I enter a command wrong?
  2. How can I prevent it happening in future

Thank you!

Hi Trent,

Did you attach the volume to the correct region? I had the same issue in syd as detailed at Deployment region seems random

Hey martin, thanks for replying.

I created the volume in sydney but I have intentionally not attached it to anything yet. I want to make a postgres cluster and attach the volume to it.

I think part of my mistake was trying to create the volume manually, rather than via the pg create command. I’ll delete it and try using the pg create.

Still a little confused about the random region selection though, and why an unused volume forces the app to deploy into another region.

Okay I think I understand slightly more now.

Postgres on fly is it’s own “app”. My original “app” (webserver) doesn’t get a postgres db, it connects(attaches) to a completely separate app that just happens to be a postgres db.

The random region thing is still weird though. At least ask me where it should go/tell me it’s happening when creating a volume :smile: ?

The random region thing is a little weird, and it’s on our radar to fix. The current way to work around this is to mount the app to a volume in a particular region; this thread does a good job of explaining this:

Hope this comes in handy for your project!

Thanks Eli :slight_smile: In hindsight I won’t need a volume for the app.

Ideally if I’m setting up a multi region webserver and multi region postgres… they are deployed into the same regions :smiley: is there anything on the roadmap to make that more explicit?