MacroSAN Fibre Channel 和 iSCSI 驱动程序

MacroSANFCDriverMacroSANISCSIDriver Cinder 驱动程序允许在 OpenStack 部署中使用 MacroSAN 存储阵列进行块存储。

系统要求

要使用 MacroSAN 驱动程序,需要以下条件

  • 具有以下功能的 MacroSAN 存储阵列:- iSCSI 或 FC 主机接口 - 启用 MacroSAN 存储设备上的 RESTful 服务。(该服务在设备中自动开启。您可以通过 ps -aux|grep python 检查是否可用 python /odsp/scripts/devop/devop.py。)

  • OpenStack 主机与阵列管理接口之间的网络连接

  • 必须在阵列上启用 HTTPS 或 HTTP

在从镜像创建卷时,请安装 multipath 工具,并在 /etc/cinder/cinder.conf 文件中的每个后端部分或 [backend_defaults] 部分中添加以下配置键,作为所有后端的通用配置。

[cinder-iscsi-a]
use_multipath_for_image_xfer = True

在从镜像创建实例时,请安装 multipath 工具,并在 /etc/nova/nova.conf 文件中的 [libvirt] 配置组中添加以下配置键

iscsi_use_multipath = True

支持的操作

  • 创建、删除、附加和分离卷。

  • 创建、列出和删除卷快照。

  • 从快照创建卷。

  • 将镜像复制到卷。

  • 将卷复制到镜像。

  • 克隆卷。

  • 扩展卷。

  • 卷迁移(主机辅助)。

  • 卷迁移(存储辅助)。

  • 重新类型化卷。

  • 管理和取消管理卷。

  • 管理和取消管理快照。

  • 卷复制。

  • 稀疏配置。

配置阵列

  1. 验证是否可以通过 HTTPS 连接管理阵列。

    如果计划为 OpenStack 存储使用虚拟池,请确认存在虚拟池 A 和 B。

  2. 编辑 cinder.conf 文件,为将由 OpenStack 管理的阵列上的每个存储池定义一个存储后端条目。每个条目由一个唯一的节名称组成,用方括号括起来,后跟以 key=value 格式指定的选项。

    • volume_backend_name 选项值可以是唯一值,如果您希望能够将卷分配给阵列上的特定存储池,也可以是多个存储池共享的名称,以便卷调度程序选择在哪里分配新卷。

    在下面的示例中,定义了两个后端,一个用于池 A,一个用于池 B。

    • /etc/cinder/cinder.conf 文件的 enabled_backends 配置组中添加以下配置键

    iSCSI 示例后端条目

    [DEFAULT]
    enabled_backends = cinder-iscsi-a, cinder-iscsi-b
    rpc_response_timeout = 300
    
    [cinder-iscsi-a]
    # Storage protocol.
    iscsi_protocol = iscsi
    
    #iSCSI target user-land tool.
    iscsi_helper = tgtadm
    
    # The iSCSI driver to load
    volume_driver = cinder.volume.drivers.macrosan.driver.MacroSANISCSIDriver.
    
    # Name to give this storage back-end.
    volume_backend_name = macrosan
    
    #Choose attach/detach volumes in cinder using multipath for volume to image and image to volume transfers.
    use_multipath_for_image_xfer = True
    
    # IP address of the Storage if attaching directly.
    san_ip = 172.17.251.142, 172.17.251.143
    
    # Storage user name.
    san_login = openstack
    
    # Storage user password.
    san_password = openstack
    
    #Choose using thin-lun or thick lun. When set san_thin_provision to True,you must set
    #macrosan_thin_lun_extent_size, macrosan_thin_lun_low_watermark, macrosan_thin_lun_high_watermark.
    san_thin_provision = False
    
    #The name of Pool in the Storage.
    macrosan_pool = Pool-a
    
    #The default ports used for initializing connection.
    #Separate the controller by semicolons (``;``)
    #Separate the ports by comma (``,``)
    macrosan_client_default = eth-1:0:0, eth-1:0:1; eth-2:0:0, eth-2:0:1
    
    #The switch to force detach volume when deleting
    macrosan_force_unmap_itl = True
    
    #Set snapshot's resource ratio
    macrosan_snapshot_resource_ratio = 1
    
    #Calculate the time spent on the operation in the log file.
    macrosan_log_timing = True
    
    # =============Optional settings=============
    
    #Set the thin lun's extent size when the san_thin_provision is True.
    macrosan_thin_lun_extent_size = 8
    
    #Set the thin lun's low watermark when the san_thin_provision is True.
    #macrosan_thin_lun_low_watermark = 8
    
    #Set the thin lun's high watermark when the san_thin_provision is True.
    macrosan_thin_lun_high_watermark = 40
    
    #The setting of Symmetrical Dual Active Storage
    macrosan_sdas_ipaddrs = 172.17.251.142, 172.17.251.143
    macrosan_sdas_username = openstack
    macrosan_sdas_password = openstack
    
    #The setting of Replication Storage. When you set ip, you must set
    #the macrosan_replication_destination_ports parameter.
    macrosan_replication_ipaddrs = 172.17.251.142, 172.17.251.143
    macrosan_replication_username = openstack
    macrosan_replication_password = openstack
    
    ##The ports used for the Replication Storage.
    #Separate the controller by semicolons (``,``)
    #Separate the ports by semicolons (``/``)
    macrosan_replication_destination_ports = eth-1:0:0/eth-1:0:1, eth-2:0:0/eth-2:0:1
    
    #Macrosan iscsi_clients list. You can configure multiple clients. Separate the ports by semicolons (``/``)
    macrosan_client = (devstack; controller1name; eth-1:0:0/eth-1:0:1; eth-2:0:0/eth-2:0:1), (dev; controller2name; eth-1:0:0/eth-1:0:1; eth-2:0:0/eth-2:0:1)
    
    [cinder-iscsi-b]
    iscsi_protocol = iscsi
    iscsi_helper = tgtadm
    volume_driver = cinder.volume.drivers.macrosan.driver.MacroSANISCSIDriver
    volume_backend_name = macrosan
    use_multipath_for_image_xfer = True
    san_ip = 172.17.251.142, 172.17.251.143
    san_login = openstack
    san_password = openstack
    macrosan_pool = Pool-b
    san_thin_provision = False
    macrosan_force_unmap_itl = True
    macrosan_snapshot_resource_ratio = 1
    macrosan_log_timing = True
    macrosan_client_default = eth-1:0:0, eth-1:0:1; eth-2:0:0, eth-2:0:1
    
    macrosan_thin_lun_extent_size = 8
    macrosan_thin_lun_low_watermark = 8
    macrosan_thin_lun_high_watermark = 40
    macrosan_sdas_ipaddrs = 172.17.251.142, 172.17.251.143
    macrosan_sdas_username = openstack
    macrosan_sdas_password = openstack
    macrosan_replication_ipaddrs = 172.17.251.142, 172.17.251.143
    macrosan_replication_username = openstack
    macrosan_replication_password = openstack
    macrosan_replication_destination_ports = eth-1:0:0, eth-2:0:0
    macrosan_client = (devstack; controller1name; eth-1:0:0; eth-2:0:0), (dev; controller2name; eth-1:0:0; eth-2:0:0)
    

    光纤通道示例后端条目

    [DEFAULT]
    enabled_backends = cinder-fc-a, cinder-fc-b
    rpc_response_timeout = 300
    
    [cinder-fc-a]
    volume_driver = cinder.volume.drivers.macrosan.driver.MacroSANFCDriver
    volume_backend_name = macrosan
    use_multipath_for_image_xfer = True
    san_ip = 172.17.251.142, 172.17.251.143
    san_login = openstack
    san_password = openstack
    macrosan_pool = Pool-a
    san_thin_provision = False
    macrosan_force_unmap_itl = True
    macrosan_snapshot_resource_ratio = 1
    macrosan_log_timing = True
    
    #FC Zoning mode configured.
    zoning_mode = fabric
    
    #The number of ports used for initializing connection.
    macrosan_fc_use_sp_port_nr = 1
    
    #In the case of an FC connection, the configuration item associated with the port is maintained.
    macrosan_fc_keep_mapped_ports = True
    
    # =============Optional settings=============
    
    macrosan_thin_lun_extent_size = 8
    macrosan_thin_lun_low_watermark = 8
    macrosan_thin_lun_high_watermark = 40
    macrosan_sdas_ipaddrs = 172.17.251.142, 172.17.251.143
    macrosan_sdas_username = openstack
    macrosan_sdas_password = openstack
    macrosan_replication_ipaddrs = 172.17.251.142, 172.17.251.143
    macrosan_replication_username = openstack
    macrosan_replication_password = openstack
    macrosan_replication_destination_ports = eth-1:0:0, eth-2:0:0
    
    
    [cinder-fc-b]
    volume_driver = cinder.volume.drivers.macrosan.driver.MacroSANFCDriver
    volume_backend_name = macrosan
    use_multipath_for_image_xfer = True
    san_ip = 172.17.251.142, 172.17.251.143
    san_login = openstack
    san_password = openstack
    macrosan_pool = Pool-b
    san_thin_provision = False
    macrosan_force_unmap_itl = True
    macrosan_snapshot_resource_ratio = 1
    macrosan_log_timing = True
    zoning_mode = fabric
    macrosan_fc_use_sp_port_nr = 1
    macrosan_fc_keep_mapped_ports = True
    
    macrosan_thin_lun_extent_size = 8
    macrosan_thin_lun_low_watermark = 8
    macrosan_thin_lun_high_watermark = 40
    macrosan_sdas_ipaddrs = 172.17.251.142, 172.17.251.143
    macrosan_sdas_username = openstack
    macrosan_sdas_password = openstack
    macrosan_replication_ipaddrs = 172.17.251.142, 172.17.251.143
    macrosan_replication_username = openstack
    macrosan_replication_password = openstack
    macrosan_replication_destination_ports = eth-1:0:0, eth-2:0:0
    
  3. 修改 cinder.conf 文件后,重新启动 cinder-volume 服务。

  4. 创建和使用卷类型。

    创建和使用 sdas 卷类型

    $ openstack volume type create sdas
    $ openstack volume type set --property sdas=True sdas
    

    创建和使用复制卷类型

    $ openstack volume type create replication
    $ openstack volume type set --property replication_enabled=True replication
    

配置文件参数

本节描述了 MacroSAN 卷驱动程序的强制和可选配置文件参数。

强制参数

参数

默认值

描述

适用范围

volume_backend_name

-

指示后端的名称

全部

volume_driver

cinder.volume.drivers.lvm.LVMVolumeDriver

指示加载的驱动程序

全部

use_multipath_for_image_xfer

False

选择在 cinder 中使用 multipath 进行卷到镜像和镜像到卷的传输的附加/分离卷。

全部

san_thin_provision

True

默认卷类型设置,True 是稀薄 LUN,False 是厚 LUN。

全部

macrosan_force_unmap_itl

True

在删除时强制分离卷

全部

macrosan_log_timing

True

在日志文件中计算操作所花费的时间。

全部

macrosan_snapshot_resource_ratio

1

设置快照的资源比率”。

全部

iscsi_helper

tgtadm

要使用的 iSCSI 用户空间工具。

iSCSI

iscsi_protocol

iscsi

确定使用 tgtadm 创建的新 iSCSI 卷的 iSCSI 协议。

iSCSI

macrosan_client_default

这是 iscsi 的默认连接信息。当未获取任何主机相关信息时,将使用此默认配置。

iSCSI

zoning_mode

True

配置的 FC 区域模式。

光纤通道

macrosan_fc_use_sp_port_nr

1

use_sp_port_nr 参数是在交换机非全通模式下建立 FC 连接时,单端存储器使用的在线 FC 端口数。最大值为 4。

光纤通道

macrosan_fc_keep_mapped_ports

True

在 FC 连接的情况下,维护与端口关联的配置项。

光纤通道

可选参数

参数

默认值

描述

适用范围

macrosan_sdas_ipaddrs

-

对称双活存储的 IP 地址

全部

macrosan_sdas_username

-

对称双活存储的用户名

全部

macrosan_sdas_password

-

对称双活存储的密码

全部

macrosan_replication_ipaddrs

-

复制存储的 IP 地址。设置 IP 时,必须设置 macrosan_replication_destination_ports 参数。

全部

macrosan_replication_username

-

复制存储的用户名

全部

macrosan_replication_password

-

复制存储的密码

全部

macrosan_replication_destination_ports

-

使用复制存储时的复制存储端口。

全部

macrosan_thin_lun_extent_size

8

当 san_thin_provision 为 True 时,设置稀薄 LUN 的扩展大小。

全部

macrosan_thin_lun_low_watermark

5

当 san_thin_provision 为 True 时,设置稀薄 LUN 的低水位线。

全部

macrosan_thin_lun_high_watermark

20

当 san_thin_provision 为 True 时,设置稀薄 LUN 的高水位线。

全部

macrosan_client

True

Macrosan iscsi_clients 列表。您可以配置多个客户端。您可以按以下格式进行配置:(主机名;客户端名称;sp1_iscsi_端口;sp2_iscsi_端口),例如:(controller1;device1;eth-1:0:0;eth-2:0:0),(controller2;device2;eth-1:0:0/ eth-1:0:1;eth-2:0:0/ eth-2:0:1)

全部

重要提示

客户端名称具有以下要求

[a-zA-Z0-9.-_:],最大字符数为 31

以下是在 cinder.conf 中可以设置的 MacroSAN 驱动程序特定选项

MacroSAN 配置选项说明

配置选项 = 默认值

描述

macrosan_client = None

(字符串列表) Macrosan iscsi_clients 列表。您可以配置多个客户端。您可以按以下格式进行配置:(主机;客户端名称;sp1_iscsi_端口;sp2_iscsi_端口),(主机;客户端名称;sp1_iscsi_端口;sp2_iscsi_端口) 重要提示,客户端名称具有以下要求:[a-zA-Z0-9.-_:],最大字符数为 31 例如:(controller1;device1;eth-1:0;eth-2:0),(controller2;device2;eth-1:0/eth-1:1;eth-2:0/eth-2:1),

macrosan_client_default = None

(字符串) 这是 iscsi 的默认连接端口名称。当未获取任何主机相关信息时,将使用此默认配置。例如:eth-1:0/eth-1:1;eth-2:0/eth-2:1

macrosan_fc_keep_mapped_ports = True

(布尔值) 在 FC 连接的情况下,维护与端口关联的配置项。

macrosan_fc_use_sp_port_nr = 1

(整数(最大值 4))use_sp_port_nr 参数是在交换机非全通模式下建立 FC 连接时,单端存储器使用的在线 FC 端口数。最大值为 4

macrosan_force_unmap_itl = True

(布尔值) 删除卷时强制断开连接

macrosan_log_timing = True

(布尔值) 是否启用日志记录时间

macrosan_pool = None

(字符串) 用于卷创建的池

macrosan_replication_destination_ports = eth-1:0/eth-1:1, eth-2:0/eth-2:1

(字符串列表) 从设备

macrosan_replication_ipaddrs = None

(字符串列表) MacroSAN 复制设备的 IP 地址

macrosan_replication_password = None

(字符串) MacroSAN 复制设备的密码

macrosan_replication_username = None

(字符串) MacroSAN 复制设备的用户名

macrosan_sdas_ipaddrs = None

(字符串列表) MacroSAN sdas 设备的 IP 地址

macrosan_sdas_password = None

(字符串) MacroSAN sdas 设备的密码

macrosan_sdas_username = None

(字符串) MacroSAN sdas 设备的用户名

macrosan_snapshot_resource_ratio = 1.0

(浮点数) 设置快照的资源比率

macrosan_thin_lun_extent_size = 8

(整数) 设置稀薄 LUN 的扩展大小

macrosan_thin_lun_high_watermark = 20

(整数) 设置稀薄 LUN 的高水位线

macrosan_thin_lun_low_watermark = 5

(整数) 设置稀薄 LUN 的低水位线