Puppet

配置 Puppet 以使用 GlusterFS 設置 Cinder

  • May 13, 2015

我現在花了相當長的時間嘗試配置 Puppet,以便它將 Cinder 設置為使用 GlusterFS 作為後端,而不是 LVMISCSI 後端,但我沒有任何運氣。

版本:

  • 木偶 3.7.3
  • 煤渣 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)

為了解決其他幾個問題,我確定這個問題是由上面的一些剩餘配置位引起的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]部分,它也可能改變也可能沒有改變。如果我發現任何其他細節,將更新。

引用自:https://serverfault.com/questions/655921