RBD: inconsistency in snapshot size after unmanage/manage with encrypted volume
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
In Progress
|
Undecided
|
Jeremy Zhang |
Bug Description
Steps to reproduce:
1. Create an encrypted volume
2. Create a snapshot
3. Unmanage the snapshot
4. Manage the snapshot
The snapshot then shows with a size of 2 GB instead of 1 GB.
$ cinder encryption-
+------
| Volume Type ID | Provider | Cipher | Key Size | Control Location |
+------
| 70c50a58-
+------
$ cinder create 1 --poll
+------
| Property | Value |
+------
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2018-04-
| description | None |
| encrypted | True |
| group_id | None |
| id | 567e5fc0-
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | None |
| os-vol-
| os-vol-
| os-vol-
| os-vol-
| provider_id | None |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| updated_at | 2018-04-
| user_id | 3de777486de14b3
| volume_type | ceph |
+------
$ cinder snapshot-create 567e5fc0-
+------
| Property | Value |
+------
| created_at | 2018-04-
| description | None |
| group_snapshot_id | None |
| id | afc81348-
| metadata | {} |
| name | None |
| size | 1 |
| status | creating |
| updated_at | None |
| user_id | 3de777486de14b3
| volume_id | 567e5fc0-
+------
$ cinder snapshot-list
+------
| ID | Volume ID | Status | Name | Size | User ID |
+------
| afc81348-
+------
$ sudo rbd ls --pool volumes
volume-
$ sudo rbd info volume-
rbd image 'volume-
size 1025 MB in 257 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.
format: 2
features: layering
flags:
create_timestamp: Tue Apr 17 12:16:01 2018
$ sudo rbd snap ls volume-
SNAPID NAME SIZE TIMESTAMP
74 snapshot-
$ cinder snapshot-unmanage afc81348-
$ sudo rbd snap ls volume-
SNAPID NAME SIZE TIMESTAMP
74 snapshot-
$ cinder snapshot-manage 567e5fc0-
+------
| Property | Value |
+------
| created_at | 2018-04-
| description | None |
| group_snapshot_id | None |
| id | d8528914-
| metadata | {} |
| name | None |
| os-extended-
| os-extended-
| size | 1 |
| status | creating |
| updated_at | None |
| user_id | 3de777486de14b3
| volume_id | 567e5fc0-
+------
$ cinder snapshot-show d8528914-
+------
| Property | Value |
+------
| created_at | 2018-04-
| description | None |
| group_snapshot_id | None |
| id | d8528914-
| metadata | {} |
| name | None |
| os-extended-
| os-extended-
| size | 2 |
| status | available |
| updated_at | 2018-04-
| user_id | 3de777486de14b3
| volume_id | 567e5fc0-
+------
It seems that when create encryption RBD volume, the backend size will bigger than the provided one. Then the DB just stores the provided size, not the real backend size (getting from the RBD driver). Then the snapshot created on the volume has the same problem.