Cinder 配置必须至少指定以下信息:
要使用 Keystone 验证的授权信息。
要创建的卷类。
controller# pkg install cinder
在 /etc/cinder/api-paste.ini 文件中取消对以下参数的注释并进行设置。这些参数指定 Keystone API 服务和 Cinder 验证信息的位置。
auth_uri = http://controller-name:5000/v2.0 identity_uri = http://controller-name:35357 admin_tenant_name = service admin_user = cinder admin_password = cinder-password
在 /etc/cinder/cinder.conf 文件中,取消对相应 volume_driver 参数的注释。支持以下四类卷:
支持在与 Cinder 卷服务相同的节点上创建本地卷以供 Nova 使用。
支持创建和导出 iSCSI 目标以供远程 Nova 计算节点使用。
支持创建和导出光纤通道 LUN 以供远程 Nova 计算节点使用。
支持从远程 Oracle ZFS Storage Appliance 创建和导出 iSCSI 目标以供远程 Nova 计算节点使用。此驱动程序的其他参数必须在 /etc/cinder/cinder.conf 文件中设置。
在本章介绍的示例中,iSCSI 用于提供卷以供 Nova 实例使用。注释掉 ZFSVolumeDriver 的缺省选项,并取消注释 ZFSISCSIDriver 选项。
# Driver to use for volume creation (string value) # The local ZFS driver provides direct access to ZFS volumes that it # creates. The other listed drivers provide access to ZFS volumes via # iSCSI or Fibre Channel and are suitable for cases where block storage # for Nova compute instances is shared. #volume_driver=cinder.volume.drivers.solaris.zfs.ZFSVolumeDriver volume_driver=cinder.volume.drivers.solaris.zfs.ZFSISCSIDriver #volume_driver=cinder.volume.drivers.solaris.zfs.ZFSFCDriver #volume_driver=cinder.volume.drivers.zfssa.zfssaiscsi.ZFSSAISCSIDriver
在 /etc/cinder/cinder.conf 文件中取消对以下参数的注释并进行设置。这些参数指定 Glance API 服务、相应 Cinder 数据库和 RabbitMQ 服务的位置。
glance_host=controller-name sql_connection=mysql://cinder:cinder@controller-name/cinder rabbit_host=controller-name volume_driver=cinder.volume.drivers.solaris.zfs.ZFSISCSIDriver
controller# svcadm enable iscsi/target stmf
controller# svcadm enable cinder-db controller# svcadm enable cinder-api cinder-scheduler controller# svcadm enable cinder-volume:default cinder-volume:setup
另请参见
另请参见《How to Build OpenStack Block Storage on ZFS》(《如何在 ZFS 上生成 OpenStack 块存储》)。
Oracle ZFS Storage Appliance iSCSI Cinder 驱动程序允许将 Oracle ZFS Storage Appliance (ZFSSA) 无缝用作 Cinder 的块存储资源。该驱动程序允许创建 iSCSI 卷,这些卷可供 Cinder 服务器向任何通过 Nova 服务实例化的虚拟机分配。该驱动程序通过 cloud/openstack/cinder 软件包提供。您的设备必须至少运行 ZFSSA 软件发行版 2013.1.2.0。
开始之前
在 Oracle ZFS Storage Appliance 上配置一个池。您可以选择使用预先存在的池。
您可以使用现有用户,也可以使用执行 Cinder 驱动程序操作的角色授权创建新的用户。
cinder.akwf 工作流执行以下任务:
如果用户不存在,则创建用户。
设置执行 Cinder 驱动程序操作的角色授权。
如果 RESTful 服务当前处于禁用状态,则启用该服务。
您可以从设备的命令行界面 (Command Line Interface, CLI) 或浏览器用户界面 (Browser User Interface, BUI) 运行该工作流。
zfssa:maintenance workflows> download zfssa:maintenance workflows download (uncommitted)> show Properties: url = (unset) user = (unset) password = (unset) zfssa:maintenance workflows download (uncommitted)> set url="url to the cinder.akwf file" url = "url to the cinder.akwf file" zfssa:maintenance workflows download (uncommitted)> commit Transferred 2.64K of 2.64K (100%) ... done zfssa:maintenance workflows> ls Properties: showhidden = false Workflows: WORKFLOW NAME OWNER SETID ORIGIN VERSION workflow-000 Clear locks root false Oracle Corporation 1.0.0 workflow-001 Configuration for OpenStack Cinder Driver root false Oracle Corporation 1.0.0 zfssa:maintenance workflows> select workflow-001 zfssa:maintenance workflow-001 execute (uncommitted)> set name=openstack name = openstack zfssa:maintenance workflow-001 execute (uncommitted)> set password=openstack-password password = ******** zfssa:maintenance workflow-001 execute (uncommitted)> commit User openstack created.
工作流提示输入用户名和口令。此用户名和口令还将在 cinder.conf 文件中用作 zfssa_auth_user 和 zfssa_auth_password。
在 cinder.conf 文件中指定以下必需的属性:
volume_driver-确保取消对 cinder.volume.drivers.zfssa.zfssaiscsi.ZFSSAISCSIDriver 的注释。确保注释掉其他三个选项。
zfssa_host-ZFSSA 管理主机的名称或 IP 地址。
zfssa_auth_user-ZFSSA 上 Cinder 用户的用户名。
zfssa_auth_password-ZFSSA 上 Cinder 用户的口令。
zfssa_pool-用于分配卷的池。
zfssa_target_portal-ZFSSA iSCSI 目标门户 (data-ip:port)。缺省端口为 3260。
zfssa_project-ZFSSA 项目的名称。如果设备上不存在该项目,则驱动程序会在启动时使用该名称创建一个项目。此项目包含该驱动程序创建的所有卷。提供的其他 ZFSSA 属性用于设置卷特征(例如块大小)和访问(例如启动器、目标、安全性)。
zfssa_initiator_group-启动器组的名称。如果设备上不存在启动器组,则驱动程序会在启动时使用该名称创建一个启动器组。如果您想要使用 default 启动器组,则将此参数的值设置为 default。default 启动器组对于评估可能非常有用。default 启动器组在一般情况下不应使用,因为它可能导致将卷暴露给不需要或冲突的启动器。
zfssa_target_interfaces-ZFSSA iSCSI 目标网络接口。使用下面的命令查看接口:
zfssa:configuration net interfaces> show Interfaces: INTERFACE STATE CLASS LINKS ADDRS LABEL e1000g0 up ip e1000g0 1.10.20.30/24 Untitled Interface
connection-将 connection 更改为 sql_connection。
找到以下行:
connection=mysql://cinder:cinder...
按如下所示修改此行:
sql_connection=mysql://cinder:cinder...
如果 ZFSSA iSCSI 服务未处于联机状态,则在设备中使用 BUI 或 CLI 启用该服务。下面的示例说明如何在设备中使用 CLI:
zfssa:> configuration services iscsi zfssa:configuration services iscsi> enable zfssa:configuration services iscsi> show Properties: <status> = online ...
controller# svcadm enable cinder-volume:default cinder-volume:setup