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

Gorka Eguileor geguileo at redhat.com
Mon Oct 10 09:29:07 UTC 2016


On 07/10, 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
>

Hi Lukasz,

Every approach I can think of has its own disadvantages, so you should
evaluate which disadvantages you can live with:

- Reading from the configuration with a Python script using cinder,
  oslo_config, or manually.  This has the out of sync issues you
  mentioned.

- Reading it from Cinder's log files, this requires that the volume
  service is running in debug log level.

- Patching Cinder to add a new API to get this information.  This means
  you have custom code and your data collecting program doesn't work
  with standard Cinder services.

- Using GDB 7 and later, that supports extending GDB with Python, to get
  this information from the running service.  This has a couple of
  disadvantages, one is you have to be really careful with what you are
  doing since you could "break" the running Cinder service, and the
  other disadvantage is that it will pause the whole service while you
  attach, get the info and detach from the service.  I will be talking
  about how to do this sort of thing in a Barcelona Summit talk [1]
  showcasing a case where the benefits outweigh the risks.

Cheers,
Gorka.

[1]: https://www.openstack.org/summit/barcelona-2016/summit-schedule/events/15159/cinder-always-on-reliability-and-scalability-guide


> Użytkownik "Erlon Cruz" <sombrafam at gmail.com> napisał(a):
> > Temat: Re: [openstack-dev] [cinder] How to retrieve volume_driver
> > Data: 2016-10-07 14:19
> > Nadawca: "Erlon Cruz" <sombrafam at gmail.com>
> > Adresat: "OpenStack Development Mailing List (not for usage questions)" <openstack-dev at lists.openstack.org>;
> >
> > Hi Luzasz, 
> > This information (volume_driver) is only used on driver loading so, its not available outside Cinder context. Can you tell how and why you need that? And why parsing the conf file is not enough for you?
> > Erlon
> > On Fri, Oct 7, 2016 at 9:05 AM,  <crow1 at interia.pl> wrote:
> > Dear all.
> >
> >
> > I'm a PHD student from Poland and have found out about this list from Openstack wiki. Could you kindly tell me, if there is a way to retrieve, from outside of OpenStack code, volume_driver for given backend? Preferably - without a need to parse the cinder.conf file?
> >
> >
> > It is fairly easy to retrieve the volume_backend_name, which in most scenarios seems to describe the driver type used. However, in general scenario, this is just a custom string entered by the admin. I would greatly appreciate, if someone could point me to a way to acquire the unique stirng, identifying the driver type used - the ona that is passed as volume_driver in cinder.conf.
> >
> >
> > Thank you in advance for your time.
> >
> >
> > Best regards,
> >
> > Lukasz
> >
> > __________________________________________________________________________
> >
> > 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
> >
> >
> >
> >
> __________________________________________________________________________
> 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



More information about the OpenStack-dev mailing list