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

Read-only file operations on instance snapshots #1174

Open
vic-t opened this issue Sep 1, 2024 · 3 comments
Open

Read-only file operations on instance snapshots #1174

vic-t opened this issue Sep 1, 2024 · 3 comments
Labels
API Changes to the REST API Documentation Documentation needs updating Feature New feature, not a bug Maybe Undecided whether in scope for the project
Milestone

Comments

@vic-t
Copy link

vic-t commented Sep 1, 2024

It would be great if lxc file mount could be used on container snapshots, too. This would be particularly helpful in situations where lxc file mount is used to make a backup of data in a running container that is currently being accessed.

See discussion on https://discuss.linuxcontainers.org/t/backup-specific-files-in-container-from-host/15638

( I created this issue for LXD last year. Since I switched to Incus in the meantime, I thought it may be worth it to copy it over.)

@stgraber stgraber changed the title lxc file mount support for instance snapshots Read-only file operations on instance snapshots Sep 1, 2024
@stgraber stgraber added this to the later milestone Sep 1, 2024
@stgraber stgraber added Documentation Documentation needs updating Feature New feature, not a bug API Changes to the REST API Maybe Undecided whether in scope for the project labels Sep 1, 2024
@stgraber
Copy link
Member

stgraber commented Sep 1, 2024

That would be interesting to get but it may not always be possible or at least not without some odd workarounds.

One big limitation will be that we'd only be able to offer it for containers. Virtual machine file operations depend on a running agent in the virtual machine.

For storage backends, this shouldn't be too hard to get working on dir, btrfs and zfs. LVM and Ceph will be harder. It should be fine when the filesystem is ext4 but when it's xfs or btrfs, the kernel usually won't let us mount it as the internal identifier will clash with the main mount.

One workaround for this is to not access the snapshot directly but instead create a temporary volume from the snapshot, then alter the uuid within that volume (can take a while as for btrfs, this is encoded throughout the whole btree) and finally access that temporary volume, destroying it after use.

@vic-t
Copy link
Author

vic-t commented Sep 2, 2024

Is it absolutely necessary to have feature parity for VMs and containers in Incus? I mean, it's an admirable goal but I don't think it would hurt if some feature A would be available for containers earlier and for VMs later, if at all. Or the other way around.

@stgraber
Copy link
Member

stgraber commented Sep 2, 2024

It's not necessary, it's definitely preferred but file operations are already working differently as for example you can't access files on a stopped VM whereas you can for containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating Feature New feature, not a bug Maybe Undecided whether in scope for the project
Development

No branches or pull requests

3 participants
@stgraber @vic-t and others