RBD: inconsistency in snapshot size after unmanage/manage with encrypted volume

Bug #1764795 reported by Eric Harney
6
This bug affects 1 person
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-type-create --cipher aes-xts-plain64 --key-size 256 --control-location front-end 70c50a58-9fe2-4d1b-bec4-3e9c5c14251a luks
+--------------------------------------+----------+-----------------+----------+------------------+
| Volume Type ID | Provider | Cipher | Key Size | Control Location |
+--------------------------------------+----------+-----------------+----------+------------------+
| 70c50a58-9fe2-4d1b-bec4-3e9c5c14251a | luks | aes-xts-plain64 | 256 | front-end |
+--------------------------------------+----------+-----------------+----------+------------------+

$ cinder create 1 --poll
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2018-04-17T16:15:54.000000 |
| description | None |
| encrypted | True |
| group_id | None |
| id | 567e5fc0-eb33-430c-a241-9b1792ce034f |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | None |
| 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 | d1a0f930031f4479891394a904de0935 |
| provider_id | None |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| updated_at | 2018-04-17T16:15:55.000000 |
| user_id | 3de777486de14b3fa88a701cc7de9260 |
| volume_type | ceph |
+--------------------------------+--------------------------------------+

$ cinder snapshot-create 567e5fc0-eb33-430c-a241-9b1792ce034f
+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| created_at | 2018-04-17T16:16:50.092056 |
| description | None |
| group_snapshot_id | None |
| id | afc81348-54bb-4606-9553-5be5688b3f4c |
| metadata | {} |
| name | None |
| size | 1 |
| status | creating |
| updated_at | None |
| user_id | 3de777486de14b3fa88a701cc7de9260 |
| volume_id | 567e5fc0-eb33-430c-a241-9b1792ce034f |
+-------------------+--------------------------------------+

$ cinder snapshot-list
+--------------------------------------+--------------------------------------+-----------+------+------+----------------------------------+
| ID | Volume ID | Status | Name | Size | User ID |
+--------------------------------------+--------------------------------------+-----------+------+------+----------------------------------+
| afc81348-54bb-4606-9553-5be5688b3f4c | 567e5fc0-eb33-430c-a241-9b1792ce034f | available | - | 1 | 3de777486de14b3fa88a701cc7de9260 |
+--------------------------------------+--------------------------------------+-----------+------+------+----------------------------------+

$ sudo rbd ls --pool volumes
volume-567e5fc0-eb33-430c-a241-9b1792ce034f

$ sudo rbd info volume-567e5fc0-eb33-430c-a241-9b1792ce034f --pool volumes
rbd image 'volume-567e5fc0-eb33-430c-a241-9b1792ce034f':
 size 1025 MB in 257 objects
 order 22 (4096 kB objects)
 block_name_prefix: rbd_data.1190674b0dc51
 format: 2
 features: layering
 flags:
 create_timestamp: Tue Apr 17 12:16:01 2018

$ sudo rbd snap ls volume-567e5fc0-eb33-430c-a241-9b1792ce034f --pool volumes
SNAPID NAME SIZE TIMESTAMP
    74 snapshot-afc81348-54bb-4606-9553-5be5688b3f4c 1025 MB Tue Apr 17 12:16:52 2018

$ cinder snapshot-unmanage afc81348-54bb-4606-9553-5be5688b3f4c

$ sudo rbd snap ls volume-567e5fc0-eb33-430c-a241-9b1792ce034f --pool volumes
SNAPID NAME SIZE TIMESTAMP
    74 snapshot-afc81348-54bb-4606-9553-5be5688b3f4c 1025 MB Tue Apr 17 12:16:52 2018

$ cinder snapshot-manage 567e5fc0-eb33-430c-a241-9b1792ce034f snapshot-afc81348-54bb-4606-9553-5be5688b3f4c
+--------------------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------------------+--------------------------------------+
| created_at | 2018-04-17T16:19:15.000000 |
| description | None |
| group_snapshot_id | None |
| id | d8528914-8f77-4f0a-9bab-9e225f20618f |
| metadata | {} |
| name | None |
| os-extended-snapshot-attributes:progress | 0% |
| os-extended-snapshot-attributes:project_id | d1a0f930031f4479891394a904de0935 |
| size | 1 |
| status | creating |
| updated_at | None |
| user_id | 3de777486de14b3fa88a701cc7de9260 |
| volume_id | 567e5fc0-eb33-430c-a241-9b1792ce034f |
+--------------------------------------------+--------------------------------------+

$ cinder snapshot-show d8528914-8f77-4f0a-9bab-9e225f20618f
+--------------------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------------------+--------------------------------------+
| created_at | 2018-04-17T16:19:15.000000 |
| description | None |
| group_snapshot_id | None |
| id | d8528914-8f77-4f0a-9bab-9e225f20618f |
| metadata | {} |
| name | None |
| os-extended-snapshot-attributes:progress | 0% |
| os-extended-snapshot-attributes:project_id | d1a0f930031f4479891394a904de0935 |
| size | 2 |
| status | available |
| updated_at | 2018-04-17T16:19:17.000000 |
| user_id | 3de777486de14b3fa88a701cc7de9260 |
| volume_id | 567e5fc0-eb33-430c-a241-9b1792ce034f |
+--------------------------------------------+--------------------------------------+

Tags: ceph drivers
Revision history for this message
Jeremy Zhang (jeremy.zhang) wrote :

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.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/568734

Changed in cinder:
assignee: Eric Harney (eharney) → Jeremy Zhang (jeremy.zhang)
status: New → In Progress
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.