xenserver/xenadmin

Shared vdi between vm's

georgyous opened this issue · 11 comments

Hello,

It would be nice if we could set the "shared" flag of a new vdi in the NewDisk dialog

I am not a developer, but I managed to make it work, I did not have the courage to submit the patches because I am not familiar with git and I am not sure I did not add unnecesary code in the process.

My ideea was to set a drop down in the NewDisk dialog with the "Shared: True/False bulean" and set the "vdi.shareble" to true or false

If I can help in getting the feature implemented, please let me know

What is your use case? sharable isn't supported for most types of VDI.

I already have a few setups (made with the cli).

We have web cluster with the following setup: 4 servers with a fc storage -> 4 vm's with a shared vdi on the fc storage -> redhat gfs2 share partition on the shared vdi.

If you need me to elaborate the setup, please let me know and I will try to be "more graphical"

Thank you

You don't say which SR type you have - only that it is FC connected. This will only work properly if the vdi is "raw". If it has VHD formatting sooner or later it will get corrupted - although xapi etc. know it is shared the tapdisk processes are unaware of each other and will cache bits the VHD metadata and miss updates made by another process.

Also, as this is an unsupported configuration it is not explicitly tested by our QA procedures, so may not work in future releases.

Sorry,

It is lvmohba. I folowed the example at this link: http://www.ha-guru.com/sharing-virtual-disks-between-xenserver-xcp-vms/

      name-label ( RW): EXP810
name-description ( RW): Hardware HBA SR [IBM - SQ02201040]
            host ( RO): <shared>
            type ( RO): lvmohba
    content-type ( RO):

on top of it I have

      name-label ( RW): www1
name-description ( RW):
         sr-uuid ( RO): 4dd31699-c063-8dec-dc5b-c829c5e0c1a8
    virtual-size ( RO): 2147483648000
        sharable ( RO): true
       read-only ( RO): false

So it this a bad solution, should I better try to use some kind of passthru?

Thank you

Yes this is a bad example - it will work only as long as the VMs are all on the same host (because they share a common tapdisk). If you try and run this on shared storage with the VMs on different hosts then each host will have its own tapdisk running - this will corrupt the VHD file.

The best option is still to set up an iSCSI target (as a raw LUN) and to access it directly from an iSCSI initiator within the guest.

Hello

I forgot to add this:

uuid ( RO) : c8f75bce-c520-4542-9477-557b3dd919d9
name-label ( RW): www1
name-description ( RW):
is-a-snapshot ( RO): false
snapshot-of ( RO):
snapshots ( RO):
snapshot-time ( RO): 19700101T00:00:00Z
allowed-operations (SRO): clone
current-operations (SRO):
sr-uuid ( RO): 4dd31699-c063-8dec-dc5b-c829c5e0c1a8
sr-name-label ( RO): DS5020
vbd-uuids (SRO): 2f969546-2226-32b8-d683-e925a6f5ebd1; 4b283152-7c46-c0ef-f66d-9a9b8ad97750
crashdump-uuids (SRO):
virtual-size ( RO): 2147483648000
physical-utilisation ( RO): 2147483648000
location ( RO): c8f75bce-c520-4542-9477-557b3dd919d9
type ( RO): User
sharable ( RO): true
read-only ( RO): false
storage-lock ( RO): false
managed ( RO): true
parent ( RO):
missing ( RO): false
other-config (MRW):
xenstore-data (MRO):
sm-config (MRO): host_OpaqueRef:ee374dee-f063-102b-a1be-f249afe2af1a: RW; host_OpaqueRef:26962cd9-8b54-9340-cbfa-9096edb660fb: RW; type: raw; vdi_type: aio
on-boot ( RW): persist
allow-caching ( RW): false
metadata-latest ( RO): false
metadata-of-pool ( RO):
tags (SRW):

I remembered that I added a "type=raw" in the creation command.
My vm's are on different hosts in the pool, my lvmohba shared storage is a shared storage attached to the pool. The vdi on top of it is "type=raw", as I understand it should not be any caching involved so data corruption can be avoided(maybe at a performance penalty). Did I understand correctly?

Also you sayd "sharable isn't supported for most types of VDI." whitch are the types of VDI's that are supported with the "shareble" flag?

Thank you

If you have "type=raw" then this should work OK - there is no VHD layer . The downside is you lose the ability to snapshot, migrate etc. as they rely on the VHD format - I guess in this case that you are OK with that limitation.

Hello,

I think this kind of setup can help a lot for other people less experienced with xenserver to make redhat clusters on top of xenserver.

The main reason for posting all of my "issues" is because xenserver has a lot of nice features which are not "very accesible"(are available only from the cli) and most people do not know of their existance because they are "not accesible from a gui".

ps. I am a big fan of Xenserver, have used it since 5.5 and at my current job moved all the infrastructure from vmware to xenserver

thank you

Understood, but it sounds like this is an unsupported and potentially dangerous operation, and we tend not to expose them in the UI.

I undestand your concern, the only thing that I want to add is that I have this setup in production working for about a year now.

I think that some "experimental/unsupported" features can be added with the apropriate "flags". This might drive people(that do not know this features exists) to try them mostly in homelabs, dev or test environments and maybe make the product better(submitting bug reports....)

Thank you

Thanks for the suggestion and discussion, but sorry, we're not going to add this one. The sharable flag is poorly tested, and dangerous in many situations, so I don't think we should add it to the GUI.