Invalid local primary storage can be created
ISSUE TYPE
- Bug Report
COMPONENT NAME
UI, API, Local storage,KVM
CLOUDSTACK VERSION
4.19.1
CONFIGURATION
Cloudstack 4.19.1 KVM Rocky8
OS / ENVIRONMENT
SUMMARY
Cloudstack allows adding an invalid local primary storage on KVM. It throws an error that the path is invalid i.e the directory does not exist but the primary storage is added.
STEPS TO REPRODUCE
1. Enable the 'Enable local storage for User Instances' on the zone
2. Add primary storage using UI with scope 'host' and protocol 'filesystem'.
3. Input a path that is not present in the KVM host
4. Add primary storage
EXPECTED RESULTS
The primary storage doesn't get added.
ACTUAL RESULTS
The primary storage gets added.
@rajujith , I don't think this is a bug. It is operator responsibility to make sure the path is there and they may plan their order of actions at will. Restricting this seems excessive control to me.
@DaanHoogland I agree with you that it is the operator's responsiblity. Still, it's good to improve this area and not allow invalid paths in the future and throw an error stating the same.
ok, I see the point, but am worried that we are over-controlling the backend system. We can implement a check that a file path exists, is a directory and is writable, but no further. A mount may not be performed for instance. and the mount point may not have space. These issues should at least for now be out of scope. Another issue is that on different hypervisortypes the check may need different implementations. What do you think @rajujith ?
ok, I see the point, but am worried that we are over-controlling the backend system. We can implement a check that a file path exists, is a directory and is writable, but no further. A mount may not be performed for instance. and the mount point may not have space. These issues should at least for now be out of scope. Another issue is that on different hypervisortyoes the check may need different implementations. What do you think @rajujith ?
Agreed.
this may have been fixed by #10231 by @harikrishna-patnala
@rajujith can you re-test it with 4.19.2.0 or 4.20.1.0-snapshot ? 4.20.0.0 does not have the fix
I tested with 4.20.1.0-snapshot. when I added a local storage with invalid path, I got the exception below