配置 Puppet 以使用 GlusterFS 设置 Cinder

配置 Puppet 以使用 GlusterFS 设置 Cinder

我已经花了相当多的时间来尝试配置 Puppet,以便它将设置 Cinder 使用 GlusterFS 作为后端,而不是 LVMISCSI 后端,但我没有任何运气。

版本:

  • 木偶 3.7.3
  • Cinder 1.0.8
  • Gluster 3.4.2
  • Ubuntu 14.10 服务器
  • puppetlabs-openstack 4.2.0

配置:

除了可以正常工作的 Puppet Openstack 配置之外,我的存储节点清单还有以下内容:

class { 'cinder::backends':
  enabled_backends => ['glusterfs']
}
class { 'cinder::volume::glusterfs':
  glusterfs_shares => ['192.168.2.5:/cinder-volumes'],
  glusterfs_mount_point_base => '/var/lib/cinder/mnt'
}

导致我的存储节点上的 cinder.conf 如下所示:

[DEFAULT]
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_confg = /etc/cinder/api-paste.ini
iscsi_helper = tgtadm
volume_name_template = volume-%s
volume_group = cinder-volumes
verbose = no
auth_strategy = keystone
state_path = /var/lib/cinder
lock_path = /var/lock/cinder
volumes_dir = /var/lib/cinder/volumes
rabbit_host=192.168.2.1
use_syslog=False
api_paste_config=/etc/cinder/api-paste.ini
glance_num_retries=0
volume_driver=cinder.volume.drivers.glusterfs.GlusterfsDriver
enabled_backends=glusterfs
debug=no
glance_api_ssl_compression=False
glance_api_insecure=False
rabbit_userid=openstack
rabbit_use_ssl=False
log_dir=/var/log/cinder
glance_api_servers=192.168.1.5:9292
volume_backend_name=DEFAULT
rabbit_virtual_host=/
rabbit_hosts=192.168.2.1:5672
glusterfs_shares_config=/etc/cinder/shares.conf
control_exchange=openstack
rabbit_ha_queues=False
glance_api_version=2
amqp_durable_queues=False
rabbit_password=**redacted**
rabbit_port=5672
rpc_backend=cinder.openstack.common.rpc.impl_kombu

但是,尽管配置了 Gluster,我仍然收到与 LVMISCSI 相关的错误:

2015-01-02 10:22:49.488 1005 WARNING cinder.volume.manager [-] Unable to update stats, LVMISCSIDriver -2.0.0 (config name glusterfs) driver is uninitialized. (ad infinitum)

以及堆栈跟踪:

WARNING cinder.context [-] Arguments dropped when creating context: {'user': u'203e3f206c5445beac797c1bcaecea8e', 'tenant': u'd588bf47f01349f39fd609440ca1d97a', 'user_identity': u'203e3f206c5445beac797c1bcaecea8e d588bf47f01349f39fd609440ca1d97a - - -'}
ERROR cinder.utils [req-6bcc2064-aa07-47ac-809e-cbb46c53b245 203e3f206c5445beac797c1bcaecea8e d588bf47f01349f39fd609440ca1d97a - - -] Volume driver LVMISCSIDriver not initialized
ERROR oslo.messaging.rpc.dispatcher [req-6bcc2064-aa07-47ac-809e-cbb46c53b245 203e3f206c5445beac797c1bcaecea8e d588bf47f01349f39fd609440ca1d97a - - -] Exception during message handling: Volume driver not ready.
TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 133, in _dispatch_and_reply
TRACE oslo.messaging.rpc.dispatcher     incoming.message))
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 176, in _dispatch
TRACE oslo.messaging.rpc.dispatcher     return self._do_dispatch(endpoint, method, ctxt, args)
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 122, in _do_dispatch
TRACE oslo.messaging.rpc.dispatcher     result = getattr(endpoint, method)(ctxt, **new_args)
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 144, in lvo_inner1
TRACE oslo.messaging.rpc.dispatcher     return lvo_inner2(inst, context, volume_id, **kwargs)
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/openstack/common/lockutils.py", line 233, in inner
TRACE oslo.messaging.rpc.dispatcher     retval = f(*args, **kwargs)
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 143, in lvo_inner2
TRACE oslo.messaging.rpc.dispatcher     return f(*_args, **_kwargs)
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 416, in delete_volume
TRACE oslo.messaging.rpc.dispatcher     {'status': 'error_deleting'})
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/openstack/common/excutils.py", line 68, in __exit__
TRACE oslo.messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 397, in delete_volume
TRACE oslo.messaging.rpc.dispatcher     utils.require_driver_initialized(self.driver)
TRACE oslo.messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/utils.py", line 761, in require_driver_initialized
TRACE oslo.messaging.rpc.dispatcher     raise exception.DriverNotInitialized()
TRACE oslo.messaging.rpc.dispatcher DriverNotInitialized: Volume driver not ready.
TRACE oslo.messaging.rpc.dispatcher 
ERROR oslo.messaging._drivers.common [req-6bcc2064-aa07-47ac-809e-cbb46c53b245 203e3f206c5445beac797c1bcaecea8e d588bf47f01349f39fd609440ca1d97a - - -] Returning exception Volume driver not ready. to caller

我不想使问题变得混乱,但如果您需要任何其他信息,请告诉我,提前谢谢您!

编辑

我更改了存储节点清单,使其包含:

class { 'cinder::backends':
  enabled_backends => ['gluster']
}
#  class { '::cinder::volume::glusterfs':    
#    glusterfs_shares => ['192.168.2.5:/cinder-volumes'],
#    glusterfs_mount_point_base => '/var/lib/cinder/mnt'
#  }
cinder::backend::glusterfs { 'gluster':
  glusterfs_shares           => ['192.168.2.5:/cinder-volumes'],
  glusterfs_mount_point_base => '/var/lib/cinder/mnt'
}

现在 Cinder/Gluster 确实可以工作了,但并不完美。您会注意到,我删除了卷定义并直接转到后端定义。这似乎已经让 Gluster 和 Cinder 很好地运行起来,但我仍然得到以下结果cinder-scheduler.log

WARNING cinder.context [-] Arguments dropped when creating context: {'user': u'203e3f206c5445beac797c1bcaecea8e', 'tenant': u'd588bf47f01349f39fd609440ca1d97a', 'user_identity': u'203e3f206c5445beac797c1bcaecea8e d588bf47f01349f39fd609440ca1d97a - - -'}
WARNING cinder.scheduler.host_manager [req-15855071-6eaa-41a2-87a9-70be47767f28 203e3f206c5445beac797c1bcaecea8e d588bf47f01349f39fd609440ca1d97a - - -] volume service is down or disabled. (host: media)
WARNING cinder.scheduler.host_manager [req-15855071-6eaa-41a2-87a9-70be47767f28 203e3f206c5445beac797c1bcaecea8e d588bf47f01349f39fd609440ca1d97a - - -] volume service is down or disabled. (host: media@glusterfs)

答案1

在查找其他几个问题时,我确定这个问题是由上面的一些剩余配置位引起的cinder.conf。具体来说,我删除了所有iscsi引用,并将 Gluster 位移出到单独的部分,结果如下:

[DEFAULT]
rabbit_host=192.168.2.1
use_syslog=False
api_paste_config=/etc/cinder/api-paste.ini
glance_num_retries=0
enabled_backends=gluster
debug=True
storage_availability_zone=nova
glance_api_ssl_compression=False
glance_api_insecure=False
rabbit_userid=openstack
rabbit_use_ssl=False
log_dir=/var/log/cinder
glance_api_servers=192.168.1.5:9292
rabbit_virtual_host=/
default_availability_zone=nova
rabbit_hosts=192.168.2.1:5672
verbose=True
control_exchange=openstack
rabbit_ha_queues=False
glance_api_version=2
amqp_durable_queues=False
rabbit_password=**redacted**
rabbit_port=5672
rpc_backend=cinder.openstack.common.rpc.impl_kombu

[database]
idle_timeout=3600
max_retries=10
retry_interval=10
min_pool_size=1
connection=mysql://cinder:**redacted**@192.168.2.1/cinder

[gluster]
volume_driver=cinder.volume.drivers.glusterfs.GlusterfsDriver
glusterfs_shares_config=/etc/cinder/shares.conf
volume_backend_name=gluster
glusterfs_mount_point_base=/var/lib/cinder/mnt

您还会注意到该[database]部分,其中可能也改变了一些内容,也可能没有。如果我发现任何其他细节,我会更新。

相关内容