Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Recreate container without dataloss #894

Open
2 tasks done
rvbcrs opened this issue Feb 17, 2025 · 4 comments
Open
2 tasks done

[Question]: Recreate container without dataloss #894

rvbcrs opened this issue Feb 17, 2025 · 4 comments
Labels
question Further information is requested

Comments

@rvbcrs
Copy link

rvbcrs commented Feb 17, 2025

Is your question not already answered in the FAQ?

  • I made sure the question is not listed in the FAQ.

Is this a general question and not a technical issue?

  • I am sure my question is not about a technical issue.

Question

I have a question, I started testing the container and uploaded data to it. When I change a parameter in the compose file and do a compose up, the container is recreated and all data is lost.
Is there a way to keep the data when the container is recreated?

@rvbcrs rvbcrs added the question Further information is requested label Feb 17, 2025
@kroese
Copy link
Collaborator

kroese commented Feb 17, 2025

Normally this should not happen. But maybe you have some setting enabled that automaticly removes volumes after stopping?

In any case you can use a normal directory instead of a volume:

volumes:
  - /var/dsm:/storage

That way you can see all the files and make sure they are not deleted after stopping.

@rvbcrs
Copy link
Author

rvbcrs commented Feb 18, 2025

Normally this should not happen. But maybe you have some setting enabled that automaticly removes volumes after stopping?

In any case you can use a normal directory instead of a volume:

volumes:

  • /var/dsm:/storage
    That way you can see all the files and make sure they are not deleted after stopping.

I did not change the path, this is what is in my compose up file:

services:
  dsm:
    container_name: dsm
    image: vdsm/virtual-dsm
    environment:
      DISK_SIZE: "2000G"
      DISK_FMT: "qcow2"
      RAM_SIZE: "32G"
      CPU_CORES: "10"
    devices:
      - /dev/kvm
      - /dev/net/tun
    cap_add:
      - NET_ADMIN
    ports:
      - 5000:5000
      - 5001:5001
    volumes:
      - /var/dsm:/storage
    restart: always
    stop_grace_period: 2m

So I was very confused that after I changed something and did a compose up, the container started as a fresh install I had to give a name to the device and set a username and password and everything was gone.
Could it be that I'm running the container on Unraid?

@kroese
Copy link
Collaborator

kroese commented Feb 18, 2025

Yes it might have something to do with Unraid, I think the path /var/dsm is not a good location there.

There is a community app called virtual-dsm in the Unraid app store that has all the correct settings configured for this container, so it might be better to use it instead of a compose file.

@rvbcrs
Copy link
Author

rvbcrs commented Feb 18, 2025

Great, I have installed that one! Somehow missed it :) Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants