Luskan777 commented on issue #10166:
URL: https://github.com/apache/cloudstack/issues/10166#issuecomment-2813199583

   Hello everyone,
   
   With some changes, I managed to add HA support for ShareMountPoint volumes. 
My changes are in this 
[fork](https://github.com/apache/cloudstack/compare/main...Platon-Cloud:cloudstack:add-support-ha-sharemountpoint)
 I made.
   
   I tested it and it worked perfectly, however, I believe these commits are 
not ready for Pull Request, because during development, I identified a 
limitation in the way Cloudstack handles the ShareMountPoint storage type in 
Libvirt.
   
   Cloudstack uses the same storage pool format for ShareMountPoint and 
Filesystem, that is, both StoragePoolTypes use Libvirt [Directory 
Pool](https://libvirt.org/storage.html#directory-pool).
   
   Therefore, in lower layers of Cloudstack, especially when dealing with 
Libvirt StoragePools, the ShareMountPoint type becomes the Filesystem type, 
which is a problem, since the Filesystem storage type is not shared and does 
not allow HA because it is a local storage.
   
   
https://github.com/apache/cloudstack/blob/55c811547a8c516c065c99f4d1ede5f43913c4c1/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java#L318-L324
   
   
https://github.com/apache/cloudstack/blob/55c811547a8c516c065c99f4d1ede5f43913c4c1/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java#L827-L828
   
   To solve this (temporarily), I created some conditions to enable HA on the 
Filesystem storage, as per the code below:
   
   
https://github.com/Platon-Cloud/cloudstack/blob/ce34c03f30686e4e186ab1459a81f46bd5230279/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java#L318-L321
   
   To avoid conflicts between what is the Filesystem storage and what is the 
**ShareMountPoint**, I created the condition that checks if the storage path is 
the same as the LOCAL_STORAGE_PATH configuration variable. THIS IS FAR FROM THE 
BEST SOLUTION, but it solves the problem for now.
   
   As a definitive solution, I think it would be interesting to open a 
discussion to change the Libvirt StoragePool format used for ShareMountPoint. 
My recommendation is to change it to the [Filesystem 
pool](https://libvirt.org/storage.html#filesystem-pool) format. Using this 
format makes sense for the ShareMountPoint storage type, and I also haven't 
found any other StoragePoolType that uses this Libvirt storage format.
   
   Since this is a change that I consider relevant, I decided to consult the 
community before developing it. If the community decides that it makes sense to 
change the Libvirt storage format from ShareMountPoint, I'll be happy to 
develop it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to