Manila share create failed with glusterfs backend

if you got an error when you create a share. and the error message is
Exception during message handling: Xpath ./volGetopts/volGetopt/Value not found in volume query response XML

2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher [req-ee811b5b-c01e-4d6d-8224-cdfafc37f882 f094403d61d8411ea232efca9092393b f3010d54761f480ca6795f52c1343244 - - -] Exception during message handling: Xpath ./volGetopts/volGetopt/Value not found in volume query response XML
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 138, in _dispatch_and_reply
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     incoming.message))
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 185, in _dispatch
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     return self._do_dispatch(endpoint, method, ctxt, args)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 127, in _do_dispatch
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     result = func(ctxt, **new_args)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 146, in wrapped
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     return f(self, *args, **kwargs)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/utils.py", line 616, in wrapper
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     return func(self, *args, **kwargs)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 1014, in create_share_instance
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     {'status': constants.STATUS_ERROR}
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     self.force_reraise()
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 985, in create_share_instance
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     context, share_instance, share_server=share_server)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/drivers/glusterfs/layout.py", line 128, in create_share
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     return self.layout.create_share(context, share, *a, **kw)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/drivers/glusterfs/layout_volume.py", line 398, in create_share
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     {'share': share, 'manager': gmgr})
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/drivers/glusterfs/glusterfs_native.py", line 84, in _setup_via_manager
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     AUTH_SSL_ALLOW)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/drivers/glusterfs/common.py", line 298, in get_vol_option
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     value = self._get_vol_regular_option(option)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/drivers/glusterfs/common.py", line 59, in wrapper
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     return f(self, *args, **kwargs)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/drivers/glusterfs/common.py", line 292, in _get_vol_regular_option
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     return volxml_get(optxml, './volGetopts/volGetopt/Value')
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/manila/share/drivers/glusterfs/common.py", line 71, in volxml_get
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher     _('Xpath %s not found in volume query response XML') % path)
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher InvalidShare: Xpath ./volGetopts/volGetopt/Value not found in volume query response XML
2016-08-31 10:00:04.860 14520 ERROR oslo_messaging.rpc.dispatcher

this is because of a recent patch of glusterfs, the output of original command: “gluster volume get VOLUME” is

Without this Patch,

<!--?xml version="1.0" encoding="UTF-8" standalone="yes"?-->
    <cliOutput>
      <opRet>0</opRet>
      <opErrno>0</opErrno>
      <opErrstr/>
      <volGetopts>
        <count>258</count>
        <Option>cluster.lookup-unhashed</Option>
        <Value>on</Value>
        <Option>cluster.lookup-optimize</Option>
        <Value>off</Value>
        <Option>cluster.min-free-disk</Option>
        <Value>10%</Value>
        <Option>cluster.min-free-inodes</Option>
        <Value>5%</Value>...

With this patch, it changes to this:

<!--?xml version="1.0" encoding="UTF-8" standalone="yes"?-->
    <cliOutput>
      <opRet>0</opRet>
      <opErrno>0</opErrno>
      <opErrstr/>
      <volGetopts>
        <count>258</count>
        <Opt>
            <Option>cluster.lookup-unhashed</Option>
            <Value>on</Value>
        </Opt>
        <Opt>
            <Option>cluster.lookup-optimize</Option>
            <Value>off</Value>
        </Opt>
        <Opt>
            <Option>cluster.min-free-disk</Option>
            <Value>10%</Value>
        </Opt>
        <Opt>
            <Option>cluster.min-free-inodes</Option>
            <Value>5%</Value>
        </Opt>...

so when you use the latest glusterfs(>=3.8.3) as manila backend, you will get an error as above.
how to fix:
in /usr/lib/python2.7/dist-packages/manila/share/drivers/glusterfs/common.py:292

function: _get_vol_regular_option
return volxml_get(optxml, './volGetopts/Value')

change to:

return volxml_get(optxml, './volGetopts/Opt/Value')

and restart manila-share service.

Leave a Reply

Your email address will not be published. Required fields are marked *