Cannot attach new machine to existing volume

My app is backed by a mysql database running as its own app with a persistent volume. There were issues today, and I first tried swapping out the database app instance by scaling to 0 and then scaling back to 1. When I do that, however, I get the following error:

me@mymacbook fly-mysql % fly scale count 1
App ‘xyz’ is going to be scaled according to this plan:
+1 machines for group ‘app’ on region ‘ewr’ of size ‘shared-cpu-1x’
1 unattached volumes to be assigned to group ‘app’ in region ‘ewr’
? Scale app xyz? Yes
Executing scale plan
Error: failed to launch VM: insufficient resources to create new machine with existing volume ‘vol_123456’ (Request ID: 12345-ewr)

Since I’m unable to attach a new machine to the volume that has all my data on it, I tried forking the volume. This seems to have succeeded, and I was able to stand up a new machine with the forked volume attached:

fly machine run mysql:5.7 --region ewr --volume vol_9876543:/data --memory 512 --app pigskin-mysql

I’m able to use the expected root password to access mysql on the forked volume, but my application’s database with all of the actual data is not present, nor is the non-root user that should be there. I’d appreciate any insight into either how to attach a new machine to the original volume or to debug the forked volume.

I was finally able to get a machine up and running with the forked volume attached by doing this:

Create a machine with an empty volume:
fly scale count 1 --with-new-volumes --region ewr

Clone the machine and attach the forked mysql volume:
fly machine clone new_machine_id --app myapp --attach-volume vol_blahblah2:/data

1 Like

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