Can't start a machine created using a snapshot volume

Hi,
I’ve deleted a file and I need a backup. I would like to restore a snapshot from a few days ago and get the file in question. My app runs on one machine.

This is what I’ve done:

  • I’ve created a volume using the target snapshot (same region as the original volume).
  • I’ve created a new machine that uses this volume (same region as the original volume).

fly machines run ubuntu:22.04
-a -r <REGION_OF_VOL>
-v <VOL_ID>:/db
–vm-size shared-cpu-1x --memory 512
–entrypoint /bin/sleep --cmd 86400

Response:

Success! A Machine has been successfully launched
State: created
Attempting to start machine…
==> Monitoring health checks
No health checks found

Then I’ve tried to connect to this machine, but I always get this error:

Error: host unavailable at XXXXXX: host was not found in DNS

I’ve tried forking, waiting, redoing, nothing works. Is there a way to get this working?

I have finally made it work using a different command: clone.

  1. Create a new volume from snapshot, using the same region as the original volume:
fly volumes create db_data \
  --snapshot-id <SNAPSHOT_ID> \
  --size 1 \
  -a <APP_NAME>
  -r <REGION>
  1. Fork it (not sure if actually necessary, but it works this way):

fly volumes fork <SNAPSHOT_BASED_VOLUME_ID> -a <APP_NAME>

  1. Create a new machine to attach to this forked volume:

fly machine clone <ORIGINAL_MACHINE_ID> \ --region <REGION> --attach-volume <FORK_BASED_VOLUME_ID>:<ROOT_FOLDER>

Check fly.toml to see the root_folder. In this case, it would be /db.

  1. ssh to the new machine:

fly ssh console -a <APP_NAME> -s <CLONED_MACHINE_ID>

Hope this saves someone’s time.

2 Likes

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