[openstack-dev] [cinder] How to retrieve volume_driver

Sean McGinnis sean.mcginnis at gmx.com
Fri Oct 7 17:10:18 UTC 2016


On Fri, Oct 07, 2016 at 05:04:00PM +0200, crow1 at interia.pl wrote:
> Hi Erlon. 
> 
> Thank you for the reply. I need to collect this information to generate sort of overview of drivers used in given environment. Obviously, it potentially is a multiple backed one. This information does not need to be pulled from the cinder API - I can assume I work under root on host on which cinder service is running. 
> 
> Parsing of cinder.conf comes with usual problems related to trying to get runtime information from config file. It is very prone to suddenly stop working due to changes in OpenStack itself. We may also potentially run into a situation in which config file has been modified, but Cinder has not been restarted (or worse, file is currently being edited and we read garbage). Now, if it comes to that I can live with those problems, but I was hoping a cleaner solution exists (as mentioned earlier - volume_backend_name, defined in same config, is very easy to retrieve). 
> 
> Thanks again and best regards,
> Lukasz
> 

This type of information is not exposed via the API, since this is a
configuration detail that someone interacting with a cloud should not
have access to.

The format of cinder.conf does not change much, so grepping for the line
that starts with "volume_driver = " should be a very safe assumption to
make.

That does not address the case you mentioned of the cinder.conf possibly
being changed but the service not restarted yet. I think that's probably
a very low risk, but the only way I can think of to get around that is
to grep the current state out of the c-vol.log file. That would bring
with it many more risks though. There's not a standard location or even
name for that log file. And it's quite possible the volume drivers did
change, the service was restarted, but there's still a volume_driver
mentioned in the log that is not in fact used any more.

And it would also need to assume DEBUG level logging was enabled. So
really I think grep'ing cinder.conf is your best bet here.

Sean (smcginnis)



More information about the OpenStack-dev mailing list