-
Notifications
You must be signed in to change notification settings - Fork 227
Examples of mounting volumes #829
Comments
Have you found something? I am trying to figure this out and its so confusing. Following the link above what I got was one directional mount only - changes in the VM reflected in host but not the other way round. |
nope and it looks like the host mounts are not supported at all. I think I've read somewhere that this is by (FC's) design. But it'd be nice to at least document what's possible and what are the limitations. |
Apparently this is a feature? |
I was referring to this #76 (comment) |
Hi, currently, we only support exposing block volumes inside a VM as mentioned in #76 and shown in the e2e volume test. Mounting the VM block file on host and writing to it does not work, maybe because it's managed by the device mapper snapshotter when the VM is active. @networkop and @dit7ya can you explain more about your requirements, what are you looking for or trying to do? Maybe we can discuss and figure out a workaround for your needs. The volume test example is straight forward, create a block file and use it with a VM. We can add a docs page with more examples and details about it if that'll be helpful. |
@darkowlzz My requirement is this - The VM can both read and write to a persistent directory in the host - which the host can also read and write to at the same time - keeping them both in sync. To explain my use case better - I am creating an API for executing arbitrary code. I want the code to be run in a secure environment but want the API server out of the VM (to keep it stable in case the VM crashes). So my idea was to store the code in a directory in the host and let the VM access that directory only. |
@dit7ya interesting use case. But unfortunately, we don't support mounting directories yet. |
@dit7ya while there are technical limitations for this right now. Here are some options you could explore: You could create an ext4 loopback device with losetup that contains a copy of the source code you're intending to run. This device would mount into the VM and you could read/write it internally. If you start the VM with SSH enabled, Also along the lines of VM's with SSH, you could install sudo ignite run --name code-vm --ssh weaveworks/ignite-ubuntu
sudo ignite exec code-vm -- "apt update && apt install -y sshfs"
cat <<EOF > code-vm.sshconfig
Host code-vm
Hostname $(ignite inspect vm code-vm -t "{{index .Status.Network.IPAddresses 0}}")
IdentityFile /var/lib/firecracker/vm/$(ignite inspect vm code-vm -t "{{.ObjectMeta.UID}}")/id_$(ignite inspect vm code-vm -t "{{.ObjectMeta.UID}}")
StrictHostKeyChecking no
EOF
# execute your code
sudo sshocker -v ./:/mnt/ssh/code -F code-vm.sshconfig code-vm ls /mnt/ssh/code # your command here Using NFS from the host to the guest could also be faster, but the |
This might be a reason I'll have to go with Kata containers even though I'd really like to use Ignite for its simplicity. It could've been a workaround for #874. Since Firecracker doesn't seem to have this feature and doesn't plan to have it (firecracker-microvm/firecracker#889) I suppose it's not coming to Ignite either (which is super unfortunate!). |
I was trying to find a good example of e2e UX for mounting volumes. I've only been able to find this https://github.com/weaveworks/ignite/blob/main/e2e/run_volume_test.go#L17
Is there a better, user-friendly example?
The text was updated successfully, but these errors were encountered: