Changing app volume

Hi! Is there a way to shrink the volume? I accidentally attached more than necessary volume size to my grafana instance :smile:
Maybe there is a way I can spawn new instance attach smaller volume, copy data from bigger one and destroy old volume + instance

Also not really related question, but don’t wanna spam with topics:
Can I disallow connecting to my web server via *.fly.io, or firewall it somehow so I can reach it only when I proxy traffic via wireguard.

p.s.
hopefully these questions make sense. I’m just figuring out the whole thing for the first time

Volumes can’t be shrunk, but your idea to copy to a new instance should work.

First, you might want to temporarily point grafana to another directory like /tmp so your copy doesn’t conflict with the running process.

Then create the new volume in the same region and scale your app up with fly scale count 2.

Then grab the private IPs with fly ips private, and use [netcat]How To Copy A File Using Netcat) or scp to copy the files.

Finally, scale back down to 1 and destroy the old volume.

To hide your app from the internet, just leave an empty [[services]] block in your fly.toml (while still leaving the section header). This will close any open ports to your application.

1 Like

Thank you very much, will try that

Regarding hiding the app, should have also specified that I still want to reach my app from the internet via attached custom domain.

Although this question is mostly out of interest - "can I do it at all? :thinking: " rather than necessity

Ah, OK. appname.fly.dev will lead to the same place as your custom domain, so it’s unrelated to proxying with wireguard. Right now you can’t “turn off” the CNAME but you could block access in your app to anything but the custom domain.

1 Like