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

Jay S. Bryant jsbryant at electronicjungle.net
Fri Oct 7 21:54:27 UTC 2016


On 10/07/2016 12:10 PM, Sean McGinnis wrote:
> 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)
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

As Sean states the cinder.conf file format has been stable for quite 
some time.  So, I don't think you need to worry about volume_driver 
changing any time soon.

If you wanted an additional level of reassurance that you are getting 
the right information you could check the number of c-vol processes 
running on the system to ensure it matches the number of volume_driver 
's specified in the config file.  I think that it would be a rare case 
where the user is swapping one backend for another.  More likely to see 
additive/subtractive changes.  So, you could give yourself some 
confidence by checking those numbers and comparing.  Flagging when they 
don't match.

Jay




More information about the OpenStack-dev mailing list