Atom feed of this document
  

 EqualLogic存储的报告中的卷大小差异寻址

 问题

在EqualLogic(EQL)存储的实际卷的大小和镜像服务中的镜像大小之间有点差异,其中镜像服务是OpenStack数据库所报告。如果用户从镜像创建了卷然后上传到EQL卷(通过镜像服务)会导致某些困惑。镜像大小要略大于目标卷的大小;这是因为EQL所报出的大小是EQL使用了其内部的卷元数据。

复制这个问题遵循下列程序中的步骤。

此步骤假设EQL阵列已经预先分配,且连接到EQL阵列所对应的配置设置已经包含进了/etc/cinder/cinder.conf

  1. 创建一个新的卷。记下卷的ID和大小。下面的例子ID和带下分别是74cf9c04-4543-47ae-a937-a9b7c6c921e71

    $ cinder create --display-name volume1 1
    +-----------------------+-------------------------------------------+
    |   Property            |   Value                                   |
    +-----------------------+-------------------------------------------+
    |   attachments         |   []                                      |
    |   availability zone   |   nova                                    |
    |   bootable            |   false                                   |
    |   created_at          |   2014-03-21T18:31:54.248775              |
    |   display_description |   None                                    |
    |   display_name        |   volume1                                 |
    |   id                  |   74cf9c04-4543-47ae-a937-a9b7c6c921e7    |
    |   metadata            |   {}                                      |
    |   size                |   1                                       |
    |   snapshot_id         |   None                                    |
    |   source volid        |   None                                    |
    |   status              |   creating                                |
    |   volume type         |   None                                    |
    +-------------------------------+-----------------------------------+
  2. 通过启用EQL阵列自身的命令行接口来验证卷的大小。

    The actual size (VolReserve) is 1.01 GB. The EQL Group Manager should also report a volume size of 1.01 GB.

    eql> volume select volume-74cf9c04-4543-47ae-a937-a9b7c6c921e7
    eql (volume_volume-74cf9c04-4543-47ae-a937-a9b7c6c921e7)> show
    _______________________________ Volume Information ________________________________
    Name: volume-74cf9c04-4543-47ae-a937-a9b7c6c921e7
    Size: 1GB
    VolReserve: 1.01GB
    VolReservelnUse: 0MB
    ReplReservelnUse: 0MB
    iSCSI Alias: volume-74cf9c04-4543-47ae-a937-a9b7c6c921e7
    iSCSI Name: iqn.2001-05.com.equallogic:0-8a0906-19f91850c-067000000b4532cl-volume-74cf9c04-4543-47ae-a937-a9b7c6c921e7
    ActualMembers: 1
    Snap-Warn: 10%
    Snap-Depletion: delete-oldest
    Description:
    Snap-Reserve: 100%
    Snap-Reserve-Avail: 100% (1.01GB)
    Permission: read-write
    DesiredStatus: online
    Status: online
    Connections: O
    Snapshots: O
    Bind:
    Type: not-replicated
    ReplicationReserveSpace: 0MB
  3. 从此卷创建一个新的镜像:

    $ cinder upload-to-image --disk-format raw \
      --container-format bare volume1 image_from_volume1
    +---------------------+---------------------------------------+
    |       Property      |                 Value                 |
    +---------------------+---------------------------------------+
    |   container_format  |                  bare                 |
    |     disk_format     |                  raw                  |
    | display_description |                  None                 |
    |           id        | 74cf9c04-4543-47ae-a937-a9b7c6c921e7  |
    |       image_id      | 3020a21d-ba37-4495-8899-07fc201161b9  |
    |      image_name     |          image_from_volume1           |
    |         size        |                  1                    |
    |        status       |              uploading                |
    |      updated_at     |      2014-03-21T18:31:55.000000       |
    |     volume_type     |                 None                  |
    +---------------------+---------------------------------------+
  4. When you uploaded the volume in the previous step, the Image service reported the volume's size as 1 (GB). However, when using glance image-list to list the image, the displayed size is 1085276160 bytes, or roughly 1.01 GB:

     

    表 6.1. 镜像设置由glance image-list 报告镜像ID

    名称磁盘格式容器格式配置状态
    image_from_volume1raw1085276160激活

  5. Create a new volume using the previous image (image_id 3020a21d-ba37-4495-8899-07fc201161b9 in this example) as the source. Set the target volume size to 1 GB; this is the size reported by the cinder tool when you uploaded the volume to the Image service:

    $ cinder create --display-name volume2 \
      --image-id 3020a21d-ba37-4495-8899-07fc201161b9 1
    ERROR: Invalid input received: Size of specified image 2 is larger
    than volume size 1. (HTTP 400) (Request-ID: req-4b9369c0-dec5-4e16-a114-c0cdl6bSd210)

    若基于cinder 工具所报出的卷的大小来创建卷的话,会失败。

 解决方案

To work around this problem, increase the target size of the new image to the next whole number. In the problem example, you created a 1 GB volume to be used as volume-backed image, so a new volume using this volume-backed image should use a size of 2 GB:

$ cinder create --display-name volume2 \
  --image-id 3020a21d-ba37-4495-8899-07fc201161b9 1
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|    attachments      |                  []                  |
| availability_zone   |                 nova                 |
|      bootable       |                false                 |
|     created_at      |      2014-03-21T19:25:31.564482      |
| display_description |               None                   |
|     display_name    |             volume2                  |
|          id         | 64e8eb18-d23f-437b-bcac-b3S2afa6843a |
|   image_id          | 3020a21d-ba37-4495-8899-07fc20116lb9 |
|   metadata          |                  []                  |
|     size            |                  2                   |
| snapshot_id         |                 None                 |
| source_volid        |                 None                 |
|    status           |               creating               |
| volume_type         |                 None                 |
+---------------------+--------------------------------------+
[注意]注意

当你基于一个卷后端的镜像创建一个新的卷时,前端会给你提供一个合适的大小值的建议。

你可以到EQL盘阵中查看此新的卷:

eql> volume select volume-64e8eb18-d23f-437b-bcac-b352afa6843a
eql (volume_volume-61e8eb18-d23f-437b-bcac-b352afa6843a)> show
______________________________ Volume Information _______________________________
Name: volume-64e8eb18-d23f-437b-bcac-b352afa6843a
Size: 2GB
VolReserve: 2.01GB
VolReserveInUse: 1.01GB
ReplReserveInUse: 0MB
iSCSI Alias: volume-64e8eb18-d23f-437b-bcac-b352afa6843a
iSCSI Name: iqn.2001-05.com.equallogic:0-8a0906-e3091850e-eae000000b7S32cl-volume-64e8eb18-d23f-437b-bcac-b3S2afa6Bl3a
ActualMembers: 1
Snap-Warn: 10%
Snap-Depletion: delete-oldest
Description:
Snap-Reserve: 100%
Snap-Reserve-Avail: 100% (2GB)
Permission: read-write
DesiredStatus: online
Status: online
Connections: 1
Snapshots: O
Bind:
Type: not-replicated
ReplicationReserveSpace: 0MB
Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...