shared LVM storage between KVM virtuals

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












I'm messing around with KVM and different storage options for sharing between virtual machines. I have an LVM volume group defined as a storage pool for libvirt. I've defined a volume and attached it to two test VMs as a virtio disk. Here's virsh dumpxml



<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/kvm_storage/vm_shared'/>
<target dev='vda' bus='virtio'/>
<shareable/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>


I can read/write files, but they do not stay in sync between the two virtuals unless I unmount then remount. Is this even supported?










share|improve this question























  • I built I high availability system, albeit several years ago, using two machines sharing a volume group. Our caveat was that only one machine could import and make active the volume group at a time. Don't recall if the second could be made read only or not. I would suggest one serve via nfs or samba and the other use,mount as client.
    – bsd
    Aug 7 '13 at 11:38














up vote
2
down vote

favorite
1












I'm messing around with KVM and different storage options for sharing between virtual machines. I have an LVM volume group defined as a storage pool for libvirt. I've defined a volume and attached it to two test VMs as a virtio disk. Here's virsh dumpxml



<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/kvm_storage/vm_shared'/>
<target dev='vda' bus='virtio'/>
<shareable/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>


I can read/write files, but they do not stay in sync between the two virtuals unless I unmount then remount. Is this even supported?










share|improve this question























  • I built I high availability system, albeit several years ago, using two machines sharing a volume group. Our caveat was that only one machine could import and make active the volume group at a time. Don't recall if the second could be made read only or not. I would suggest one serve via nfs or samba and the other use,mount as client.
    – bsd
    Aug 7 '13 at 11:38












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





I'm messing around with KVM and different storage options for sharing between virtual machines. I have an LVM volume group defined as a storage pool for libvirt. I've defined a volume and attached it to two test VMs as a virtio disk. Here's virsh dumpxml



<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/kvm_storage/vm_shared'/>
<target dev='vda' bus='virtio'/>
<shareable/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>


I can read/write files, but they do not stay in sync between the two virtuals unless I unmount then remount. Is this even supported?










share|improve this question















I'm messing around with KVM and different storage options for sharing between virtual machines. I have an LVM volume group defined as a storage pool for libvirt. I've defined a volume and attached it to two test VMs as a virtio disk. Here's virsh dumpxml



<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/kvm_storage/vm_shared'/>
<target dev='vda' bus='virtio'/>
<shareable/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>


I can read/write files, but they do not stay in sync between the two virtuals unless I unmount then remount. Is this even supported?







kvm qemu






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 7 '13 at 3:56









Freedom_Ben

74421319




74421319










asked Aug 6 '13 at 23:42









Pete

219210




219210











  • I built I high availability system, albeit several years ago, using two machines sharing a volume group. Our caveat was that only one machine could import and make active the volume group at a time. Don't recall if the second could be made read only or not. I would suggest one serve via nfs or samba and the other use,mount as client.
    – bsd
    Aug 7 '13 at 11:38
















  • I built I high availability system, albeit several years ago, using two machines sharing a volume group. Our caveat was that only one machine could import and make active the volume group at a time. Don't recall if the second could be made read only or not. I would suggest one serve via nfs or samba and the other use,mount as client.
    – bsd
    Aug 7 '13 at 11:38















I built I high availability system, albeit several years ago, using two machines sharing a volume group. Our caveat was that only one machine could import and make active the volume group at a time. Don't recall if the second could be made read only or not. I would suggest one serve via nfs or samba and the other use,mount as client.
– bsd
Aug 7 '13 at 11:38




I built I high availability system, albeit several years ago, using two machines sharing a volume group. Our caveat was that only one machine could import and make active the volume group at a time. Don't recall if the second could be made read only or not. I would suggest one serve via nfs or samba and the other use,mount as client.
– bsd
Aug 7 '13 at 11:38










3 Answers
3






active

oldest

votes

















up vote
3
down vote



accepted










You need an clustered file system.



I do not know what filesystem you are using. But with a standard file system this is not possible and has nothing to do KVM or LVM.



An other solution would be to use a network filesystem like nfs or cifs.






share|improve this answer



























    up vote
    1
    down vote













    You have to use those levels :



    On physical Host :



    • KVM level : second disk for VM marked as "Shared storage" in Virt-manager properties (only disk type "raw" is supported. qcow2 is not supported as "shareable" in vm disk edit screen and virt-manager will not allow you to click "apply" when you tick the "shareable" box)

    On VMs :



    • level 0 : DLM (like disk logical management I think) # service dlm start ; Linux packages to install

    • level 1 : LVM management

    • level 2 : GFS2 filesystem formatted on your LVM logical volume





    share|improve this answer





























      up vote
      0
      down vote













      A disk used by a vm at the same time.Otherwise,the filesystem on the disk will be damaged!
      You can use NAS/NFS/SMB etc network filesystem to share files.






      share|improve this answer




















        Your Answer







        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "106"
        ;
        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',
        convertImagesToLinks: false,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













         

        draft saved


        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f85768%2fshared-lvm-storage-between-kvm-virtuals%23new-answer', 'question_page');

        );

        Post as a guest






























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        3
        down vote



        accepted










        You need an clustered file system.



        I do not know what filesystem you are using. But with a standard file system this is not possible and has nothing to do KVM or LVM.



        An other solution would be to use a network filesystem like nfs or cifs.






        share|improve this answer
























          up vote
          3
          down vote



          accepted










          You need an clustered file system.



          I do not know what filesystem you are using. But with a standard file system this is not possible and has nothing to do KVM or LVM.



          An other solution would be to use a network filesystem like nfs or cifs.






          share|improve this answer






















            up vote
            3
            down vote



            accepted







            up vote
            3
            down vote



            accepted






            You need an clustered file system.



            I do not know what filesystem you are using. But with a standard file system this is not possible and has nothing to do KVM or LVM.



            An other solution would be to use a network filesystem like nfs or cifs.






            share|improve this answer












            You need an clustered file system.



            I do not know what filesystem you are using. But with a standard file system this is not possible and has nothing to do KVM or LVM.



            An other solution would be to use a network filesystem like nfs or cifs.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 7 '13 at 7:48









            dor

            1013




            1013






















                up vote
                1
                down vote













                You have to use those levels :



                On physical Host :



                • KVM level : second disk for VM marked as "Shared storage" in Virt-manager properties (only disk type "raw" is supported. qcow2 is not supported as "shareable" in vm disk edit screen and virt-manager will not allow you to click "apply" when you tick the "shareable" box)

                On VMs :



                • level 0 : DLM (like disk logical management I think) # service dlm start ; Linux packages to install

                • level 1 : LVM management

                • level 2 : GFS2 filesystem formatted on your LVM logical volume





                share|improve this answer


























                  up vote
                  1
                  down vote













                  You have to use those levels :



                  On physical Host :



                  • KVM level : second disk for VM marked as "Shared storage" in Virt-manager properties (only disk type "raw" is supported. qcow2 is not supported as "shareable" in vm disk edit screen and virt-manager will not allow you to click "apply" when you tick the "shareable" box)

                  On VMs :



                  • level 0 : DLM (like disk logical management I think) # service dlm start ; Linux packages to install

                  • level 1 : LVM management

                  • level 2 : GFS2 filesystem formatted on your LVM logical volume





                  share|improve this answer
























                    up vote
                    1
                    down vote










                    up vote
                    1
                    down vote









                    You have to use those levels :



                    On physical Host :



                    • KVM level : second disk for VM marked as "Shared storage" in Virt-manager properties (only disk type "raw" is supported. qcow2 is not supported as "shareable" in vm disk edit screen and virt-manager will not allow you to click "apply" when you tick the "shareable" box)

                    On VMs :



                    • level 0 : DLM (like disk logical management I think) # service dlm start ; Linux packages to install

                    • level 1 : LVM management

                    • level 2 : GFS2 filesystem formatted on your LVM logical volume





                    share|improve this answer














                    You have to use those levels :



                    On physical Host :



                    • KVM level : second disk for VM marked as "Shared storage" in Virt-manager properties (only disk type "raw" is supported. qcow2 is not supported as "shareable" in vm disk edit screen and virt-manager will not allow you to click "apply" when you tick the "shareable" box)

                    On VMs :



                    • level 0 : DLM (like disk logical management I think) # service dlm start ; Linux packages to install

                    • level 1 : LVM management

                    • level 2 : GFS2 filesystem formatted on your LVM logical volume






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Sep 3 at 13:09









                    Costin Gușă

                    2051310




                    2051310










                    answered Apr 27 '17 at 10:27









                    Gouny

                    111




                    111




















                        up vote
                        0
                        down vote













                        A disk used by a vm at the same time.Otherwise,the filesystem on the disk will be damaged!
                        You can use NAS/NFS/SMB etc network filesystem to share files.






                        share|improve this answer
























                          up vote
                          0
                          down vote













                          A disk used by a vm at the same time.Otherwise,the filesystem on the disk will be damaged!
                          You can use NAS/NFS/SMB etc network filesystem to share files.






                          share|improve this answer






















                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            A disk used by a vm at the same time.Otherwise,the filesystem on the disk will be damaged!
                            You can use NAS/NFS/SMB etc network filesystem to share files.






                            share|improve this answer












                            A disk used by a vm at the same time.Otherwise,the filesystem on the disk will be damaged!
                            You can use NAS/NFS/SMB etc network filesystem to share files.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Aug 13 '13 at 7:28









                            Edward Shen

                            64237




                            64237



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f85768%2fshared-lvm-storage-between-kvm-virtuals%23new-answer', 'question_page');

                                );

                                Post as a guest













































































                                Popular posts from this blog

                                How to check contact read email or not when send email to Individual?

                                Bahrain

                                Postfix configuration issue with fips on centos 7; mailgun relay