ZFS inside a virtual machineZFS over NFS v3 - “Invalid Argument” for empty filesZFS: SAS v SATA - does it matter?Why did rebooting cause one side of my ZFS mirror to become UNAVAIL?zfs error behind LSI raidcontrollerWhat does a permanent ZFS error indicate?Does ZFS have an “overall checksum” similar to Git's commit IDs?At my wits end. What could cause my server to randomly hard reset? (Seems to be related to ZFS)ZOL vs zfs-FUSE

Can someone give the intuition behind Mean Absolute Error and the Median?

We are on WHV, my boyfriend was in a small collision, we are leaving in 2 weeks what happens if we don’t pay the damages?

A famous scholar sent me an unpublished draft of hers. Then she died. I think her work should be published. What should I do?

How can this Stack Exchange site have an animated favicon?

Why is STARTTLS still used?

Delete n lines skip 1 line script

How do we know neutrons have no charge?

Sci-fi movie with one survivor and an organism(?) recreating his memories

Minimal Python logging

Lost passport which have valid student visa but I make new passport unable paste

What secular civic space would pioneers build for small frontier towns?

Why does my browser attempt to download pages from http://clhs.lisp.se instead of viewing them normally?

Include boundary conditions in wave equation solver

When did Unix stop storing passwords in clear text?

What is the difference between an astronaut in the ISS and a freediver in perfect neutral buoyancy?

お仕事に学校頑張って meaning

Why isn't there armor to protect from spells in the Potterverse?

Would an object shot from earth fall into the sun?

"I will not" or "I don't" as an answer for negative orders?

Top off gas with old oil, is that bad?

Why aren't faces sharp in my f/1.8 portraits even though I'm carefully using center-point autofocus?

Fix Ethernet 10/100 PoE cable with 7 out of 8 wires alive

Is the order of words purely based on convention?

Why was Logo created?



ZFS inside a virtual machine


ZFS over NFS v3 - “Invalid Argument” for empty filesZFS: SAS v SATA - does it matter?Why did rebooting cause one side of my ZFS mirror to become UNAVAIL?zfs error behind LSI raidcontrollerWhat does a permanent ZFS error indicate?Does ZFS have an “overall checksum” similar to Git's commit IDs?At my wits end. What could cause my server to randomly hard reset? (Seems to be related to ZFS)ZOL vs zfs-FUSE






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















Should I use ZFS inside a virtual machine? According to existing information (in particular this thread, which I will quote below) it is not a good idea, unless certain measures are provided (such as using VT-d). The basic problem allegedly is that the hypervisor may report a block to be written when in fact, it has not yet been written. Allegedly, ZFS is particularly sensitive to such a discrepancy, compared to other filesystems:




The specifics of why it's so bad relate to it's fsck-less design.




It was also acknowledged in that discussion that:




The only scenario where "pointer written before data" turns into "pointer written but no data" is still the event of a crash of either OS or the hypervisor, as far as I can imagine.




But what is the worst-case consequence in case of such a crash?



  • Corruption or loss of files written around the time of the crash?

  • Corruption or loss of any other file in the dataset?

  • Corruption or loss of any file in a dataset that was not being modified around the time of the crash, e.g., a snapshot that was taken long before the crash?

Is there any silent corruption possible, which cannot be detected by a scrub?



I have tried to simulate a crash by using VirtualBox and selecting Close / Power Off while data was written to a ZFS inside of a VM. I did this about 20 times, but could not detect any problems. Maybe this method of testing is not appropriate. Are there better ways to experiment with this?










share|improve this question



















  • 1





    Do you care to describe the virtualization technology and environment you're planning?

    – ewwhite
    8 hours ago











  • The only situation this matters is when you make snapshots for CBT and similar based backup and at the moment of backup there is intense writing. However, even so it depends of the proper or improper configuration of the ZFS guest.

    – Overmind
    8 hours ago












  • @ewwhite The relevant VM is provided to me by our computing center. They are running a vSphere Cluster, and in the web console, it says: "Compatibility: ESXi 6.5 or higher (VM Version 13)". Can you do an assessment based on this? If you need any additional information about the system, please let me know, and I will try to find it out.

    – Lasse Kliemann
    5 hours ago

















2















Should I use ZFS inside a virtual machine? According to existing information (in particular this thread, which I will quote below) it is not a good idea, unless certain measures are provided (such as using VT-d). The basic problem allegedly is that the hypervisor may report a block to be written when in fact, it has not yet been written. Allegedly, ZFS is particularly sensitive to such a discrepancy, compared to other filesystems:




The specifics of why it's so bad relate to it's fsck-less design.




It was also acknowledged in that discussion that:




The only scenario where "pointer written before data" turns into "pointer written but no data" is still the event of a crash of either OS or the hypervisor, as far as I can imagine.




But what is the worst-case consequence in case of such a crash?



  • Corruption or loss of files written around the time of the crash?

  • Corruption or loss of any other file in the dataset?

  • Corruption or loss of any file in a dataset that was not being modified around the time of the crash, e.g., a snapshot that was taken long before the crash?

Is there any silent corruption possible, which cannot be detected by a scrub?



I have tried to simulate a crash by using VirtualBox and selecting Close / Power Off while data was written to a ZFS inside of a VM. I did this about 20 times, but could not detect any problems. Maybe this method of testing is not appropriate. Are there better ways to experiment with this?










share|improve this question



















  • 1





    Do you care to describe the virtualization technology and environment you're planning?

    – ewwhite
    8 hours ago











  • The only situation this matters is when you make snapshots for CBT and similar based backup and at the moment of backup there is intense writing. However, even so it depends of the proper or improper configuration of the ZFS guest.

    – Overmind
    8 hours ago












  • @ewwhite The relevant VM is provided to me by our computing center. They are running a vSphere Cluster, and in the web console, it says: "Compatibility: ESXi 6.5 or higher (VM Version 13)". Can you do an assessment based on this? If you need any additional information about the system, please let me know, and I will try to find it out.

    – Lasse Kliemann
    5 hours ago













2












2








2








Should I use ZFS inside a virtual machine? According to existing information (in particular this thread, which I will quote below) it is not a good idea, unless certain measures are provided (such as using VT-d). The basic problem allegedly is that the hypervisor may report a block to be written when in fact, it has not yet been written. Allegedly, ZFS is particularly sensitive to such a discrepancy, compared to other filesystems:




The specifics of why it's so bad relate to it's fsck-less design.




It was also acknowledged in that discussion that:




The only scenario where "pointer written before data" turns into "pointer written but no data" is still the event of a crash of either OS or the hypervisor, as far as I can imagine.




But what is the worst-case consequence in case of such a crash?



  • Corruption or loss of files written around the time of the crash?

  • Corruption or loss of any other file in the dataset?

  • Corruption or loss of any file in a dataset that was not being modified around the time of the crash, e.g., a snapshot that was taken long before the crash?

Is there any silent corruption possible, which cannot be detected by a scrub?



I have tried to simulate a crash by using VirtualBox and selecting Close / Power Off while data was written to a ZFS inside of a VM. I did this about 20 times, but could not detect any problems. Maybe this method of testing is not appropriate. Are there better ways to experiment with this?










share|improve this question














Should I use ZFS inside a virtual machine? According to existing information (in particular this thread, which I will quote below) it is not a good idea, unless certain measures are provided (such as using VT-d). The basic problem allegedly is that the hypervisor may report a block to be written when in fact, it has not yet been written. Allegedly, ZFS is particularly sensitive to such a discrepancy, compared to other filesystems:




The specifics of why it's so bad relate to it's fsck-less design.




It was also acknowledged in that discussion that:




The only scenario where "pointer written before data" turns into "pointer written but no data" is still the event of a crash of either OS or the hypervisor, as far as I can imagine.




But what is the worst-case consequence in case of such a crash?



  • Corruption or loss of files written around the time of the crash?

  • Corruption or loss of any other file in the dataset?

  • Corruption or loss of any file in a dataset that was not being modified around the time of the crash, e.g., a snapshot that was taken long before the crash?

Is there any silent corruption possible, which cannot be detected by a scrub?



I have tried to simulate a crash by using VirtualBox and selecting Close / Power Off while data was written to a ZFS inside of a VM. I did this about 20 times, but could not detect any problems. Maybe this method of testing is not appropriate. Are there better ways to experiment with this?







virtualization zfs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









Lasse KliemannLasse Kliemann

1014 bronze badges




1014 bronze badges










  • 1





    Do you care to describe the virtualization technology and environment you're planning?

    – ewwhite
    8 hours ago











  • The only situation this matters is when you make snapshots for CBT and similar based backup and at the moment of backup there is intense writing. However, even so it depends of the proper or improper configuration of the ZFS guest.

    – Overmind
    8 hours ago












  • @ewwhite The relevant VM is provided to me by our computing center. They are running a vSphere Cluster, and in the web console, it says: "Compatibility: ESXi 6.5 or higher (VM Version 13)". Can you do an assessment based on this? If you need any additional information about the system, please let me know, and I will try to find it out.

    – Lasse Kliemann
    5 hours ago












  • 1





    Do you care to describe the virtualization technology and environment you're planning?

    – ewwhite
    8 hours ago











  • The only situation this matters is when you make snapshots for CBT and similar based backup and at the moment of backup there is intense writing. However, even so it depends of the proper or improper configuration of the ZFS guest.

    – Overmind
    8 hours ago












  • @ewwhite The relevant VM is provided to me by our computing center. They are running a vSphere Cluster, and in the web console, it says: "Compatibility: ESXi 6.5 or higher (VM Version 13)". Can you do an assessment based on this? If you need any additional information about the system, please let me know, and I will try to find it out.

    – Lasse Kliemann
    5 hours ago







1




1





Do you care to describe the virtualization technology and environment you're planning?

– ewwhite
8 hours ago





Do you care to describe the virtualization technology and environment you're planning?

– ewwhite
8 hours ago













The only situation this matters is when you make snapshots for CBT and similar based backup and at the moment of backup there is intense writing. However, even so it depends of the proper or improper configuration of the ZFS guest.

– Overmind
8 hours ago






The only situation this matters is when you make snapshots for CBT and similar based backup and at the moment of backup there is intense writing. However, even so it depends of the proper or improper configuration of the ZFS guest.

– Overmind
8 hours ago














@ewwhite The relevant VM is provided to me by our computing center. They are running a vSphere Cluster, and in the web console, it says: "Compatibility: ESXi 6.5 or higher (VM Version 13)". Can you do an assessment based on this? If you need any additional information about the system, please let me know, and I will try to find it out.

– Lasse Kliemann
5 hours ago





@ewwhite The relevant VM is provided to me by our computing center. They are running a vSphere Cluster, and in the web console, it says: "Compatibility: ESXi 6.5 or higher (VM Version 13)". Can you do an assessment based on this? If you need any additional information about the system, please let me know, and I will try to find it out.

– Lasse Kliemann
5 hours ago










1 Answer
1






active

oldest

votes


















2
















Basically any modern hypervisor (VMWare, Xen, KVM, HyperV, even VirtualBox) supports barrier passing: when a VM explicitly flushes something to disk (by issuing a barrier/FUA), the hypervisor will pass the barrier down to the host, forcing the same flushes executed by the guest OS. In other words, no corruption is expected for important/durable writes (as the one used by the filesystem itself to update its metadata).



While most hypervisor can be confiured to ignore flushes, this can jeopardize any filesystems - XFS, EXT4, etc. will be exposed to serious corruptions as much as ZFS.



Back to the main question: it is perfectly safe to use ZFS inside a guest OS, and I have first-hand experience on similar setup. This will enable the guest to use advanced features as compression, snapshots and send/receive. However this can led to somewhat lower guest performance (ZFS is not enginereed to be a benchmark-winning filesystem). Moreover, as many SANs implements the very same features at the disk image level, you should evaluate if the performance impact due to double-CoW is worth the additional flexibility at the guest level.



For the reasons above, I generally use ZFS at the disk-image/hypervisor level, while using XFS or EXT4 inside the virtual machines themselves. However, on scenario where I have no visibility on the underlying SAN/storage (and its snapshot/compression/replication policies), I sometime use ZFS at the guest level.



In these cases, the added features more than compensate the performance impact vs, for example, a plain XFS setup. And I have no stability/durability problems at all.



Side note: VT-d is only useful if you plan to pass the raw disks (or other hardware devices) to the guest itself. If using file or volume based virtual disk, you are not using VT-d.






share|improve this answer



























  • Thanks, this helped a lot. I'm using ZFS exactly for the mentioned benefits (snapshots in particular), and I have no control over the hypervisor setup. ZFS is delightful to work with, and going back to anything else in this situation would have been painful. I will continue using ZFS on the VM.

    – Lasse Kliemann
    4 hours ago













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f985252%2fzfs-inside-a-virtual-machine%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2
















Basically any modern hypervisor (VMWare, Xen, KVM, HyperV, even VirtualBox) supports barrier passing: when a VM explicitly flushes something to disk (by issuing a barrier/FUA), the hypervisor will pass the barrier down to the host, forcing the same flushes executed by the guest OS. In other words, no corruption is expected for important/durable writes (as the one used by the filesystem itself to update its metadata).



While most hypervisor can be confiured to ignore flushes, this can jeopardize any filesystems - XFS, EXT4, etc. will be exposed to serious corruptions as much as ZFS.



Back to the main question: it is perfectly safe to use ZFS inside a guest OS, and I have first-hand experience on similar setup. This will enable the guest to use advanced features as compression, snapshots and send/receive. However this can led to somewhat lower guest performance (ZFS is not enginereed to be a benchmark-winning filesystem). Moreover, as many SANs implements the very same features at the disk image level, you should evaluate if the performance impact due to double-CoW is worth the additional flexibility at the guest level.



For the reasons above, I generally use ZFS at the disk-image/hypervisor level, while using XFS or EXT4 inside the virtual machines themselves. However, on scenario where I have no visibility on the underlying SAN/storage (and its snapshot/compression/replication policies), I sometime use ZFS at the guest level.



In these cases, the added features more than compensate the performance impact vs, for example, a plain XFS setup. And I have no stability/durability problems at all.



Side note: VT-d is only useful if you plan to pass the raw disks (or other hardware devices) to the guest itself. If using file or volume based virtual disk, you are not using VT-d.






share|improve this answer



























  • Thanks, this helped a lot. I'm using ZFS exactly for the mentioned benefits (snapshots in particular), and I have no control over the hypervisor setup. ZFS is delightful to work with, and going back to anything else in this situation would have been painful. I will continue using ZFS on the VM.

    – Lasse Kliemann
    4 hours ago















2
















Basically any modern hypervisor (VMWare, Xen, KVM, HyperV, even VirtualBox) supports barrier passing: when a VM explicitly flushes something to disk (by issuing a barrier/FUA), the hypervisor will pass the barrier down to the host, forcing the same flushes executed by the guest OS. In other words, no corruption is expected for important/durable writes (as the one used by the filesystem itself to update its metadata).



While most hypervisor can be confiured to ignore flushes, this can jeopardize any filesystems - XFS, EXT4, etc. will be exposed to serious corruptions as much as ZFS.



Back to the main question: it is perfectly safe to use ZFS inside a guest OS, and I have first-hand experience on similar setup. This will enable the guest to use advanced features as compression, snapshots and send/receive. However this can led to somewhat lower guest performance (ZFS is not enginereed to be a benchmark-winning filesystem). Moreover, as many SANs implements the very same features at the disk image level, you should evaluate if the performance impact due to double-CoW is worth the additional flexibility at the guest level.



For the reasons above, I generally use ZFS at the disk-image/hypervisor level, while using XFS or EXT4 inside the virtual machines themselves. However, on scenario where I have no visibility on the underlying SAN/storage (and its snapshot/compression/replication policies), I sometime use ZFS at the guest level.



In these cases, the added features more than compensate the performance impact vs, for example, a plain XFS setup. And I have no stability/durability problems at all.



Side note: VT-d is only useful if you plan to pass the raw disks (or other hardware devices) to the guest itself. If using file or volume based virtual disk, you are not using VT-d.






share|improve this answer



























  • Thanks, this helped a lot. I'm using ZFS exactly for the mentioned benefits (snapshots in particular), and I have no control over the hypervisor setup. ZFS is delightful to work with, and going back to anything else in this situation would have been painful. I will continue using ZFS on the VM.

    – Lasse Kliemann
    4 hours ago













2














2










2









Basically any modern hypervisor (VMWare, Xen, KVM, HyperV, even VirtualBox) supports barrier passing: when a VM explicitly flushes something to disk (by issuing a barrier/FUA), the hypervisor will pass the barrier down to the host, forcing the same flushes executed by the guest OS. In other words, no corruption is expected for important/durable writes (as the one used by the filesystem itself to update its metadata).



While most hypervisor can be confiured to ignore flushes, this can jeopardize any filesystems - XFS, EXT4, etc. will be exposed to serious corruptions as much as ZFS.



Back to the main question: it is perfectly safe to use ZFS inside a guest OS, and I have first-hand experience on similar setup. This will enable the guest to use advanced features as compression, snapshots and send/receive. However this can led to somewhat lower guest performance (ZFS is not enginereed to be a benchmark-winning filesystem). Moreover, as many SANs implements the very same features at the disk image level, you should evaluate if the performance impact due to double-CoW is worth the additional flexibility at the guest level.



For the reasons above, I generally use ZFS at the disk-image/hypervisor level, while using XFS or EXT4 inside the virtual machines themselves. However, on scenario where I have no visibility on the underlying SAN/storage (and its snapshot/compression/replication policies), I sometime use ZFS at the guest level.



In these cases, the added features more than compensate the performance impact vs, for example, a plain XFS setup. And I have no stability/durability problems at all.



Side note: VT-d is only useful if you plan to pass the raw disks (or other hardware devices) to the guest itself. If using file or volume based virtual disk, you are not using VT-d.






share|improve this answer















Basically any modern hypervisor (VMWare, Xen, KVM, HyperV, even VirtualBox) supports barrier passing: when a VM explicitly flushes something to disk (by issuing a barrier/FUA), the hypervisor will pass the barrier down to the host, forcing the same flushes executed by the guest OS. In other words, no corruption is expected for important/durable writes (as the one used by the filesystem itself to update its metadata).



While most hypervisor can be confiured to ignore flushes, this can jeopardize any filesystems - XFS, EXT4, etc. will be exposed to serious corruptions as much as ZFS.



Back to the main question: it is perfectly safe to use ZFS inside a guest OS, and I have first-hand experience on similar setup. This will enable the guest to use advanced features as compression, snapshots and send/receive. However this can led to somewhat lower guest performance (ZFS is not enginereed to be a benchmark-winning filesystem). Moreover, as many SANs implements the very same features at the disk image level, you should evaluate if the performance impact due to double-CoW is worth the additional flexibility at the guest level.



For the reasons above, I generally use ZFS at the disk-image/hypervisor level, while using XFS or EXT4 inside the virtual machines themselves. However, on scenario where I have no visibility on the underlying SAN/storage (and its snapshot/compression/replication policies), I sometime use ZFS at the guest level.



In these cases, the added features more than compensate the performance impact vs, for example, a plain XFS setup. And I have no stability/durability problems at all.



Side note: VT-d is only useful if you plan to pass the raw disks (or other hardware devices) to the guest itself. If using file or volume based virtual disk, you are not using VT-d.







share|improve this answer














share|improve this answer



share|improve this answer








edited 4 hours ago

























answered 7 hours ago









shodanshokshodanshok

29.1k3 gold badges52 silver badges99 bronze badges




29.1k3 gold badges52 silver badges99 bronze badges















  • Thanks, this helped a lot. I'm using ZFS exactly for the mentioned benefits (snapshots in particular), and I have no control over the hypervisor setup. ZFS is delightful to work with, and going back to anything else in this situation would have been painful. I will continue using ZFS on the VM.

    – Lasse Kliemann
    4 hours ago

















  • Thanks, this helped a lot. I'm using ZFS exactly for the mentioned benefits (snapshots in particular), and I have no control over the hypervisor setup. ZFS is delightful to work with, and going back to anything else in this situation would have been painful. I will continue using ZFS on the VM.

    – Lasse Kliemann
    4 hours ago
















Thanks, this helped a lot. I'm using ZFS exactly for the mentioned benefits (snapshots in particular), and I have no control over the hypervisor setup. ZFS is delightful to work with, and going back to anything else in this situation would have been painful. I will continue using ZFS on the VM.

– Lasse Kliemann
4 hours ago





Thanks, this helped a lot. I'm using ZFS exactly for the mentioned benefits (snapshots in particular), and I have no control over the hypervisor setup. ZFS is delightful to work with, and going back to anything else in this situation would have been painful. I will continue using ZFS on the VM.

– Lasse Kliemann
4 hours ago


















draft saved

draft discarded















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f985252%2fzfs-inside-a-virtual-machine%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Sahara Skak | Bilen | Luke uk diar | NawigatsjuunCommonskategorii: SaharaWikivoyage raisfeerer: Sahara26° N, 13° O

The fall designs the understood secretary. Looking glass Science Shock Discovery Hot Everybody Loves Raymond Smile 곳 서비스 성실하다 Defas Kaloolon Definition: To combine or impregnate with sulphur or any of its compounds as to sulphurize caoutchouc in vulcanizing Flame colored Reason Useful Thin Help 갖다 유명하다 낙엽 장례식 Country Iron Definition: A fencer a gladiator one who exhibits his skill in the use of the sword Definition: The American black throated bunting Spiza Americana Nostalgic Needy Method to my madness 시키다 평가되다 전부 소설가 우아하다 Argument Tin Feeling Representative Gym Music Gaur Chicken 일쑤 코치 편 학생증 The harbor values the sugar. Vasagle Yammoe Enstatite Definition: Capable of being limited Road Neighborly Five Refer Built Kangaroo 비비다 Degree Release Bargain Horse 하루 형님 유교 석 동부 괴롭히다 경제력

19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу