GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
811 stars 263 forks source link

Disk full condition can wipe out a project file #2114

Open BrentBaccala opened 2 years ago

BrentBaccala commented 2 years ago

This is GNS3 2.2.34 (from the GNS3 PPA) on Ubuntu 18.04.6 LTS.

I ran out of disk space on the gns3 partition while I had one project open in the GUI. I switched to another project (hoping to delete one of the nodes there), but couldn't open the project because of the disk full condition. So I switched the GUI back to the first project.

The .gns3, .gns3.backup, and .gns3.tmp files for the second project (that I tried to open and failed), are now all zero-length files.

BrentBaccala commented 2 years ago

I was able to recover the data on the project's Ubuntu nodes using the following procedure:

  1. Fix the disk full condition
  2. grep in the qemu.log files in the project's qemu directories to find the command lines that were used to start each node, and from this figure out which hda_disk.qcow2 file corresponded to each node
  3. Use the GNS3/upload-image.py script in https://github.com/BrentBaccala/NPDC to upload the qcow2 file to the GNS3 server as an image
  4. Use the GNS3/add-appliance.py script (same repository) to create an appliance file using the uploaded image as its disk template
  5. Import the appliance into the GNS3 GUI
  6. Clone the appliance as a node and boot it

The resulting nodes have a disk backed by the recovered disk image, which is itself backed by the original node's backing file, so make sure not to delete the original node's backing file.