create encrypted volume fails

Bug #1708505 reported by Walt Boring
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Opinion
Undecided
Keith Berger
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Unassigned

Bug Description

stack with current devstack as of 8/3/2017 (Pike)

enable barbican in local.conf
[[local|localrc]]
enable_plugin barbican https://git.openstack.org/openstack/barbican

once devstack finishes and services are up you can see /etc/cinder/cinder.conf
...
[key_manager]
api_class = castellan.key_manager.barbican_key_manager.BarbicanKeyManager

from cmdln
  master-vm  vagrant   master  ~  devstack  cinder list
cinder type+----+--------+------+------+-------------+----------+-------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+----+--------+------+------+-------------+----------+-------------+
+----+--------+------+------+-------------+----------+-------------+
-  master-vm  vagrant   master  ~  devstack  cinder type-list
+--------------------------------------+------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+------+-------------+-----------+
| 0be4eb35-7835-4a3b-89f8-fc71e9c303a2 | lvm | - | True |
| ba936fd6-d01a-40f9-82fc-933b9bd9da75 | nfs | - | True |
+--------------------------------------+------+-------------+-----------+
  master-vm  vagrant   master  ~  devstack  cinder type-create LUKS
+--------------------------------------+------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+------+-------------+-----------+
| d1e9a6bc-c2bf-4d57-b1c7-0b6440833606 | LUKS | - | True |
+--------------------------------------+------+-------------+-----------+
  master-vm  vagrant   master  ~  devstack  cinder type-key LUKS set volume_backend_name=lvm
  master-vm  vagrant   master  ~  devstack  cinder encryption-type-create --cipher aes-xts-plain64 --key_size 512 \
    --control_location front-end LUKS nova.volume.encryptors.luks.LuksEncryptor
+--------------------------------------+-------------------------------------------+-----------------+----------+------------------+
| Volume Type ID | Provider | Cipher | Key Size | Control Location |
+--------------------------------------+-------------------------------------------+-----------------+----------+------------------+
| d1e9a6bc-c2bf-4d57-b1c7-0b6440833606 | nova.volume.encryptors.luks.LuksEncryptor | aes-xts-plain64 | 512 | front-end |
+--------------------------------------+-------------------------------------------+-----------------+----------+------------------+
  master-vm  vagrant   master  ~  devstack 
  master-vm  vagrant   master  ~  devstack  cinder create --volume-type LUKS --name test 1
ERROR: Key manager error (HTTP 400) (Request-ID: req-b49e8300-5076-4c62-9831-9dbfec61e2ee)

cinder-api.log

Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR castellan.key_manager.barbican_key_manager [None req-b49e8300-5076-4c62-9831-9dbfec61e2ee admin admin] Order is in ERROR status - status code: 500, status reason: Process TypeOrder failure seen - please contact site administrator.
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume [None req-b49e8300-5076-4c62-9831-9dbfec61e2ee admin admin] Key manager error: KeyManagerError: Key manager error: Order is in ERROR status - status code: 500, status reason: Process TypeOrder failure seen - please contact site administrator.
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume Traceback (most recent call last):
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume File "/opt/stack/cinder/cinder/volume/flows/api/create_volume.py", line 400, in _get_encryption_key_id
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume length=length)
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume File "/usr/local/lib/python2.7/dist-packages/castellan/key_manager/barbican_key_manager.py", line 229, in create_key
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume order = self._get_active_order(barbican_client, order_ref)
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume File "/usr/local/lib/python2.7/dist-packages/castellan/key_manager/barbican_key_manager.py", line 388, in _get_active_order
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume raise exception.KeyManagerError(reason=msg)
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume KeyManagerError: Key manager error: Order is in ERROR status - status code: 500, status reason: Process TypeOrder failure seen - please contact site administrator.
Aug 03 17:56:47 master-vm <email address hidden>[13448]: ERROR cinder.volume.flows.api.create_volume

Revision history for this message
Walt Boring (walter-boring) wrote :

Looks like Barbican puked

barbican.log

Could not perform processing for task 'Process TypeOrder'.: CryptoPluginUnsupportedOperation: Could not find an enabled crypto plugin backend that supports the requested operation: store or generate a secret of type SYMMETRIC_KEY_GENERATION with algorithm aes, bit length 512, and mode None

Revision history for this message
Walt Boring (walter-boring) wrote :

I created a new volume type and set the key length to 256 and it works.

Changed in cinder:
status: New → Confirmed
Changed in cinder:
status: Confirmed → Opinion
Revision history for this message
Jeremy Moffitt (jeremy-moffitt) wrote :

The docs at https://docs.openstack.org/horizon/rocky/admin/manage-volumes.html recommend using 512 key length, but https://crypto.stackexchange.com/questions/20253/why-we-cant-implement-aes-512-key-size seems to indicate that 256 is the max for aes-xts-plain64 , perhaps the docs should be updated.

Changed in cinder:
assignee: nobody → Keith Berger (keith-berger)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/689871
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=85a1dddf126691921924edcecaee5c054c7df6c2
Submitter: Zuul
Branch: master

commit 85a1dddf126691921924edcecaee5c054c7df6c2
Author: Keith Berger <email address hidden>
Date: Mon Oct 21 16:20:51 2019 -0400

    Fix aes-xts key length in Horizon Admin Guide / Manage Volumes

    When using aes-xts-plain64, a 512 bit key produces an error as this
    is not a supported barbican key length for aes-xts-plain64. This patch
    updates the horzion admin doc to remove the reference of a 512 bit key.

    Change-Id: Ie36e05a1e59eb88b779c9f3249a714c20b5f5fe0
    Closes-Bug: #1708505
    Closes-Bug: #1849196

Changed in horizon:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/690088

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/690089

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/690090

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/train)

Reviewed: https://review.opendev.org/690088
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=524093e3e30cc8f64aecebedb51704584401087d
Submitter: Zuul
Branch: stable/train

commit 524093e3e30cc8f64aecebedb51704584401087d
Author: Keith Berger <email address hidden>
Date: Mon Oct 21 16:20:51 2019 -0400

    Fix aes-xts key length in Horizon Admin Guide / Manage Volumes

    When using aes-xts-plain64, a 512 bit key produces an error as this
    is not a supported barbican key length for aes-xts-plain64. This patch
    updates the horzion admin doc to remove the reference of a 512 bit key.

    Change-Id: Ie36e05a1e59eb88b779c9f3249a714c20b5f5fe0
    Closes-Bug: #1708505
    Closes-Bug: #1849196
    (cherry picked from commit 85a1dddf126691921924edcecaee5c054c7df6c2)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/stein)

Reviewed: https://review.opendev.org/690089
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=123a9e73a29cd820c64b9214f6173c849228543e
Submitter: Zuul
Branch: stable/stein

commit 123a9e73a29cd820c64b9214f6173c849228543e
Author: Keith Berger <email address hidden>
Date: Mon Oct 21 16:20:51 2019 -0400

    Fix aes-xts key length in Horizon Admin Guide / Manage Volumes

    When using aes-xts-plain64, a 512 bit key produces an error as this
    is not a supported barbican key length for aes-xts-plain64. This patch
    updates the horzion admin doc to remove the reference of a 512 bit key.

    Change-Id: Ie36e05a1e59eb88b779c9f3249a714c20b5f5fe0
    Closes-Bug: #1708505
    Closes-Bug: #1849196
    (cherry picked from commit 85a1dddf126691921924edcecaee5c054c7df6c2)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/rocky)

Reviewed: https://review.opendev.org/690090
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=8af8bc48a58fc9a2e45a89a24069f7cae0af8235
Submitter: Zuul
Branch: stable/rocky

commit 8af8bc48a58fc9a2e45a89a24069f7cae0af8235
Author: Keith Berger <email address hidden>
Date: Mon Oct 21 16:20:51 2019 -0400

    Fix aes-xts key length in Horizon Admin Guide / Manage Volumes

    When using aes-xts-plain64, a 512 bit key produces an error as this
    is not a supported barbican key length for aes-xts-plain64. This patch
    updates the horzion admin doc to remove the reference of a 512 bit key.

    Change-Id: Ie36e05a1e59eb88b779c9f3249a714c20b5f5fe0
    Closes-Bug: #1708505
    Closes-Bug: #1849196
    (cherry picked from commit 85a1dddf126691921924edcecaee5c054c7df6c2)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 17.0.0

This issue was fixed in the openstack/horizon 17.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 15.2.0

This issue was fixed in the openstack/horizon 15.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 14.1.0

This issue was fixed in the openstack/horizon 14.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 16.1.0

This issue was fixed in the openstack/horizon 16.1.0 release.

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.