cirruslabs / tart

macOS and Linux VMs on Apple Silicon to use in CI and other automations
https://tart.run
Other
3.91k stars 116 forks source link

Questions about the `--root-disk-opts` flag #950

Closed hisaac closed 1 week ago

hisaac commented 1 week ago

I was reading through some of the help text for Tart, and had a couple questions about the --root-disk-opts flag.

First, what is the root disk in this case? The root volume of the VM? Or the host machine's disk?

Second, I'm a little confused by the description of the sync options:

* sync=none — disable data synchronization with the permanent storage to increase performance at the cost of a higher chance of data loss (e.g. --root-disk-opts="sync=none")

* sync=fsync — enable data synchronization with the permanent storage, but don't ensure that it was actually written (e.g. --root-disk-opts="sync=fsync")

* sync=full — enable data synchronization with the permanent storage and ensure that it was actually written (e.g. --root-disk-opts="sync=full")

What is "data synchronization" mean here? If sync is disabled, does that mean the VM doesn't save its state after shutting down?

And what is "permanent storage"?

fkorotkov commented 1 week ago

This is for the disk image file of the virtual machine itself. This setting pretty much mimics this enum.

If there is no synchronization, VM saves bytes to the disk but if you'll terminate it you might loose some data. If you shutdown guest OS properly then you'll be good.

hisaac commented 1 week ago

Gotcha, thanks for the info @fkorotkov. That makes sense to me now. 👍