emc-xchallenge / cinder

http://openstack.org
Apache License 2.0
0 stars 4 forks source link

cinder create/extend issues on ScaleIO backend #5

Open shan-wan opened 8 years ago

shan-wan commented 8 years ago

Description:

cinder create/extend should follow the storage properties. Scaleio volume must be a positive number in granularity of 8 GB. But 'cinder create 1' creates a 1G volume although it uses 8G backend lun. And to extend this 1GB volume, at least 16G grow-to size must be specified.

Project:

Openstack

Project Area:

Openstack cinder

Release:

Openstack master branch

Severity:

S1

Full Details:

Test Environment and PreCondtion:

Devstack deployed Openstack environment

Detailed Test Steps:

[root@scaleiovm1 devstack]# cinder create 1  --display-name dzhpeng1
+---------------------------------------+--------------------------------------+
|                Property               |                Value                 |
+---------------------------------------+--------------------------------------+
|              attachments              |                  []                  |
|           availability_zone           |                 nova                 |
|                bootable               |                false                 |
|          consistencygroup_id          |                 None                 |
|               created_at              |      2015-11-24T08:32:28.000000      |
|              description              |                 None                 |
|               encrypted               |                False                 |
|                   id                  | b0a27182-2220-491a-a1b5-7cd737348167 |
|                metadata               |                  {}                  |
|            migration_status           |                 None                 |
|              multiattach              |                False                 |
|                  name                 |               dzhpeng1               |
|         os-vol-host-attr:host         |                 None                 |
|     os-vol-mig-status-attr:migstat    |                 None                 |
|     os-vol-mig-status-attr:name_id    |                 None                 |
|      os-vol-tenant-attr:tenant_id     |   6ac7c7a09a214f8a92dba7e6c2ccbae5   |
|   os-volume-replication:driver_data   |                 None                 |
| os-volume-replication:extended_status |                 None                 |
|           replication_status          |               disabled               |
|                  size                 |                  1                   | -----> size shoule be 8
|              snapshot_id              |                 None                 |
|              source_volid             |                 None                 |
|                 status                |               creating               |
|               updated_at              |                 None                 |
|                user_id                |   1672ff1f13224e6283a5306dc488cb07   |
|              volume_type              |               scaleio                |
+---------------------------------------+--------------------------------------+

[root@scaleiovm1 devstack]# cinder extend b0a27182-2220-491a-a1b5-7cd737348167 5  ---> extend to 5, user need 4G more space.
[root@scaleiovm1 devstack]# echo $?
0
[root@scaleiovm1 devstack]# cinder list
+--------------------------------------+-----------------+------------------+----------+------+-------------+----------+-------------+-------------+
|                  ID                  |      Status     | Migration Status |   Name   | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------------+------------------+----------+------+-------------+----------+-------------+-------------+
| b0a27182-2220-491a-a1b5-7cd737348167 | error_extending |        -         | dzhpeng1 |  1   |   scaleio   |  false   |    False    |             | --> error
+--------------------------------------+-----------------+------------------+----------+------+-------------+----------+-------------+-------------+

[root@scaleiovm1 devstack]# cinder reset-state b0a27182-2220-491a-a1b5-7cd737348167
[root@scaleiovm1 devstack]# cinder extend b0a27182-2220-491a-a1b5-7cd737348167 8   ---> try 8. 
[root@scaleiovm1 devstack]# cinder list
+--------------------------------------+-----------------+------------------+----------+------+-------------+----------+-------------+-------------+
|                  ID                  |      Status     | Migration Status |   Name   | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------------+------------------+----------+------+-------------+----------+-------------+-------------+
| b0a27182-2220-491a-a1b5-7cd737348167 | error_extending |        -         | dzhpeng1 |  1   |   scaleio   |  false   |    False    |             |
+--------------------------------------+-----------------+------------------+----------+------+-------------+----------+-------------+------------

[root@scaleiovm1 devstack]# cinder reset-state b0a27182-2220-491a-a1b5-7cd737348167
[root@scaleiovm1 devstack]# cinder extend b0a27182-2220-491a-a1b5-7cd737348167 16
[root@scaleiovm1 devstack]# cinder list
+--------------------------------------+-----------+------------------+----------+------+-------------+----------+-------------+-------------+
|                  ID                  |   Status  | Migration Status |   Name   | Size | Volume Type | Bootable | Multiattach | Attached to |
+--------------------------------------+-----------+------------------+----------+------+-------------+----------+-------------+-------------+
| b0a27182-2220-491a-a1b5-7cd737348167 | available |        -         | dzhpeng1 |  16  |   scaleio   |  false   |    False    |             | ----> only 16 is working
+--------------------------------------+-----------+------------------+----------+------+-------------+----------+-------------+-------------+

In this case, user only need <= 8G space, but cinder extend at least 16. This way to use storage is wasty, we should follow the scaleio storage lun size maybe.

cinder log:

screen-c-vol.log:2015-11-24 03:34:16.853 ERROR cinder.volume.drivers.emc.scaleio [req-acf8b70f-d6cc-41bd-b434-523f91a5929f admin] Error extending volume 411ca8bd0000000b: sizeInGB (5) must be a positive number in granularity of 8 GB..
screen-c-vol.log:2015-11-24 03:34:16.854 ERROR cinder.volume.manager [req-acf8b70f-d6cc-41bd-b434-523f91a5929f admin] Volume(_name_id=None,admin_metadata={},attach_status='detached',availability_zone='nova',bootable=False,consistencygroup_id=None,created_at=2015-11-24T08:32:28Z,deleted=False,deleted_at=None,display_description=None,display_name='dzhpeng1',ec2_id=None,encryption_key_id=None,host='scaleiovm1@scaleio#openstack:sata',id=b0a27182-2220-491a-a1b5-7cd737348167,launched_at=2015-11-24T08:32:28Z,metadata={},migration_status=None,multiattach=False,previous_status=None,project_id=6ac7c7a09a214f8a92dba7e6c2ccbae5,provider_auth=None,provider_geometry=None,provider_id=411ca8bd0000000b,provider_location=None,replication_driver_data=None,replication_extended_status=None,replication_status='disabled',scheduled_at=2015-11-24T08:32:28Z,size=1,snapshot_id=None,source_volid=None,status='extending',terminated_at=None,updated_at=2015-11-24T08:32:29Z,user_id=1672ff1f13224e6283a5306dc488cb07,volume_attachment=<?>,volume_type=<?>,volume_type_id=53f1255d-e32d-46fa-b75b-3ee4c9d04f9a)Extend volume failed.
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager Traceback (most recent call last):
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager   File "/opt/stack/new/cinder/cinder/volume/manager.py", line 2016, in extend_volume
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager     self.driver.extend_volume(volume, new_size)
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager   File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager     return f(*args, **kwargs)
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager   File "/opt/stack/new/cinder/cinder/volume/drivers/emc/scaleio.py", line 559, in extend_volume
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager     raise exception.VolumeBackendAPIException(data=msg)
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager VolumeBackendAPIException: Bad or unexpected response from the storage volume backend API: Error extending volume 411ca8bd0000000b: sizeInGB (5) must be a positive number in granularity of 8 GB..
screen-c-vol.log:2015-11-24 03:34:16.854 21593 ERROR cinder.volume.manager

Expected Results:

'cinder create 1' on ScaleIO backend should:

'cinder create 1' on ScaleIO creates a 1G volume but uses 8G backend storage.

Problem details:

Support Materials:

xing-yang commented 8 years ago

This is determined by ScaleIO architecture. Not a Cinder bug.

If you set sio_round_volume_capacity = False in cinder.conf, it should fail at creation.

Extend volume will succeed regardless and a warning will be logged if sio_round_volume_capacity is set to False.