Sheepdog driver doesn't set size correctly on create from snapshot

Bug #1399598 reported by ustcdylan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
ustcdylan

Bug Description

My openstack version: stable/icehouse and I use sheepdog as the cinder's backend storage, and use "cinder create" to create a new volume based a snapshot with a given size, we find the size it not work. Other backend storages have no problem, for example lvm.

You can reproduce this bug as follows:
[root@compute-63-10 ~]# cinder snapshot-list
+--------------------------------------+--------------------------------------+-----------+------------------------------------------+------+
| ID | Volume ID | Status | Display Name | Size |
+--------------------------------------+--------------------------------------+-----------+------------------------------------------+------+
| e6a25098-faa3-4326-860d-8ce386a32d9d | ac8cccb7-fc98-4c75-9f00-492a61a59e27 | available | CentOS 6.5 64bit (EBS) | 10 |
+--------------------------------------+--------------------------------------+-----------+------------------------------------------+------+

[root@compute-63-10 ~]# cinder create --snapshot-id e6a25098-faa3-4326-860d-8ce386a32d9d --display-name dylan 40
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2014-12-05T09:55:42.892741 |
| display_description | None |
| display_name | dylan |
| encrypted | False |
| id | 2cc9dd67-951a-46c0-b2ad-2c2534c358eb |
| metadata | {} |
| size | 40 |
| snapshot_id | e6a25098-faa3-4326-860d-8ce386a32d9d |
| source_volid | None |
| status | creating |
| volume_type | ebs |
+---------------------+--------------------------------------+

we check the volume size in the compute node which it attached to or if the new volume has a guest os, we can login in and check the disk size by "fdisk -l"

[root@compute-63-06 by-path]# qemu-img info ip-192.168.33.136\:3260-iscsi-iqn.2014-05.cmcc.bigcloud\:volume-07f1e3fb-78ae-46d5-8ac5-a9c888e55b72-lun-1
image: ip-192.168.33.136:3260-iscsi-iqn.2014-05.cmcc.bigcloud:volume-07f1e3fb-78ae-46d5-8ac5-a9c888e55b72-lun-1
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 0

ustcdylan (ustcdylan)
summary: - if cinder backend storage is sheepdog, create a new volume with given
- size based a volume snapshot, the given size is not work
+ If we use sheepdog as the cinder's backend storage, we use "cinder
+ create" to create a new volume based a snapshot with a given size, we
+ find the size it not work.
summary: If we use sheepdog as the cinder's backend storage, we use "cinder
create" to create a new volume based a snapshot with a given size, we
- find the size it not work.
+ find the size is not work.
Changed in cinder:
assignee: nobody → ustcdylan (ustcdylan)
assignee: ustcdylan (ustcdylan) → nobody
ustcdylan (ustcdylan)
summary: - If we use sheepdog as the cinder's backend storage, we use "cinder
- create" to create a new volume based a snapshot with a given size, we
- find the size is not work.
+ If we create a new volume based a snapshot with a given size, we find
+ the size is not work.
description: updated
ustcdylan (ustcdylan)
description: updated
ustcdylan (ustcdylan)
description: updated
Changed in cinder:
status: New → In Progress
assignee: nobody → ustcdylan (ustcdylan)
ustcdylan (ustcdylan)
information type: Public → Public Security
information type: Public Security → Public
ustcdylan (ustcdylan)
description: updated
Revision history for this message
ustcdylan (ustcdylan) wrote : Re: If we create a new volume based a snapshot with a given size, we find the size is not work.
tags: added: drivers sheepdog
summary: - If we create a new volume based a snapshot with a given size, we find
- the size is not work.
+ Sheepdog driver doesn't set size correctly on create from snapshot
Mike Perez (thingee)
Changed in cinder:
milestone: none → kilo-2
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/139804
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=337342d0894df0661810b8f9b08d26611ad43962
Submitter: Jenkins
Branch: master

commit 337342d0894df0661810b8f9b08d26611ad43962
Author: ustcdylan <email address hidden>
Date: Sat Dec 6 22:23:21 2014 +0800

    Fix bug in sheepdog driver: the wrong volume size

    We give a volume size when create a volume from an snapshot,
    but the sheepdog driver ignores the size.

    Change-Id: I4310e7ef07e98c002ad3494e623ea243e3aad468
    Closes-Bug: #1399598

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.