Confused about volumes

How do I make sure that I have enough volumes when new machines are created.

So with this command I will have three volumes waiting to be attached, correct ?

fly volume create primary_volume -r lax -n 3

What happens when machine 4 is spinned up ?

How are you spinning up your machines? Manually via the console, or via the GraphQL/REST APIs?

I see our current config has 2 machines. We deployed them with:

flyctl deploy --config ./app/fly.prd.toml --dockerfile ./app/Dockerfile -t $FLY_API_TOKEN_APP

Our toml file has:

auto_stop_machines = ‘stop’
auto_start_machines = true
min_machines_running = 0

I am not sure why we have 2 machines allocated. I would think we would just have 1. Do you just need to add volumes as you increase your scale count ?

Yes, I think that’s the default, to produce some resilience to physical box failure. But you can do flyctl scale count 1 if you just want one machine, and then (as far as I understand it) it won’t change on subsequent deploys unless you change the scaling yourself.

I would guess that if you add --volume-initial-size 1 to your deploy then it will add a new 1GB volume when you scale.

I also noticed that this help is available on the flyctl scale command:

--with-new-volumes New machines each get a new volumes even if there are unattached volumes available

So that would be worth trying as well!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.