Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1116811

Summary: cinder fails to attach encrypted volume
Product: Red Hat OpenStack Reporter: yfried
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED NOTABUG QA Contact: nlevinki <nlevinki>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.0 (RHEL 7)CC: bkopilov, eharney, jhenner, scohen, sgotliv, tkammer, tshefi, yeylon, yfried, yrabl
Target Milestone: ---Keywords: Reopened
Target Release: 5.0 (RHEL 7)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-27 21:51:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
cinder logs from controller
none
nova log files from compute node
none
nova log files from controller none

Description yfried 2014-07-07 11:13:08 UTC
Created attachment 916040 [details]
cinder logs from controller

Description of problem:
Tempest test https://github.com/openstack/tempest/blob/master/tempest/scenario/test_encrypted_cinder_volumes.py
fails to attach encrypted volume

Version-Release number of selected component (if applicable):
topology: 1controller + 2 computes

[root@puma45 ~(keystone_admin)]# rpm -qa | grep openstack
openstack-heat-engine-2014.1-1.5.el7ost.noarch
openstack-ceilometer-api-2014.1-2.4.el7ost.noarch
openstack-nova-objectstore-2014.1-7.el7ost.noarch
openstack-glance-2014.1-4.el7ost.noarch
openstack-cinder-2014.1-7.el7ost.noarch
openstack-nova-scheduler-2014.1-7.el7ost.noarch
openstack-neutron-2014.1-35.el7ost.noarch
openstack-dashboard-2014.1-7.el7ost.noarch
openstack-swift-plugin-swift3-1.7-3.el7ost.noarch
openstack-ceilometer-notification-2014.1-2.4.el7ost.noarch
openstack-keystone-2014.1-6.el7ost.noarch
openstack-heat-api-cloudwatch-2014.1-1.5.el7ost.noarch
openstack-packstack-2014.1.1-0.32.1.dev1209.el7ost.noarch
openstack-nova-api-2014.1-7.el7ost.noarch
openstack-neutron-ml2-2014.1-35.el7ost.noarch
python-django-openstack-auth-1.1.5-2.el7ost.noarch
openstack-swift-container-1.13.1-2.el7ost.noarch
openstack-ceilometer-collector-2014.1-2.4.el7ost.noarch
openstack-heat-common-2014.1-1.5.el7ost.noarch
openstack-heat-api-cfn-2014.1-1.5.el7ost.noarch
openstack-packstack-puppet-2014.1.1-0.32.1.dev1209.el7ost.noarch
openstack-puppet-modules-2014.1-18.2.el7ost.noarch
openstack-selinux-0.5.9-1.el7ost.noarch
openstack-nova-common-2014.1-7.el7ost.noarch
openstack-nova-conductor-2014.1-7.el7ost.noarch
openstack-nova-cert-2014.1-7.el7ost.noarch
openstack-neutron-openvswitch-2014.1-35.el7ost.noarch
redhat-access-plugin-openstack-5.0.0-3.el7ost.noarch
openstack-swift-account-1.13.1-2.el7ost.noarch
openstack-swift-proxy-1.13.1-2.el7ost.noarch
openstack-ceilometer-central-2014.1-2.4.el7ost.noarch
openstack-ceilometer-common-2014.1-2.4.el7ost.noarch
openstack-nova-console-2014.1-7.el7ost.noarch
openstack-swift-1.13.1-2.el7ost.noarch
openstack-heat-api-2014.1-1.5.el7ost.noarch
openstack-ceilometer-alarm-2014.1-2.4.el7ost.noarch
openstack-utils-2014.1-3.el7ost.noarch
openstack-nova-novncproxy-2014.1-7.el7ost.noarch
openstack-dashboard-theme-2014.1-7.el7ost.noarch
openstack-swift-object-1.13.1-2.el7ost.noarch

How reproducible:
cinder type-create my_test_volume
cinder encryption-type-create my_test_volume nova.volume.encryptors.cryptsetup.CryptsetupEncryptor
cinder create 1 --volume_type my_test_volume
neutron net-create private_admin
neutron subnet-create private_admin 10.0.0.0/24
nova boot --flavor 1 --image aa66ffcf-d8aa-4aed-8b8b-56a9aa36f9c5 test_vm --nic net-id=cb381c2b-7da7-4ae9-ae50-c41842217281
nova volume-attach test_vm f4ea7779-feea-403c-9970-720ecad2a2b9
cinder list

Actual results:
fail to achieve volume status 'in-use'

in /var/log/nova/compute.log
30157:2014-07-07 13:43:27.141 2993 ERROR nova.virt.block_device [req-17a1c67b-c4be-4f22-a0b8-75c9e53ede6a admin admin] [instance: 69f8eac4-57e7-4c2e-94af-34a333e7e078] Driver failed to attach volume f4ea7779-feea-403c-9970-720ecad2a2b9 at /dev/vdb

Expected results:
volume status 'in-use'

Additional info:
Happens both on selinux permissive and enforcing
non-encrypted volume attached ok:
   50  cinder type-create my_test_volume_clear
   51  cinder create 1 my_test_volume_clear
   52  cinder create 1 --volume_type my_test_volume_clear
   53  nova volume-attach test_vm a39b4939-016e-443c-ad2a-1a39d012e7e3
   54  cinder show a39b4939-016e-443c-ad2a-1a39d012e7e3
[root@puma45 ~(keystone_admin)]# cinder show a39b4939-016e-443c-ad2a-1a39d012e7e3
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|            Property            |                                                                                                    Value                                                                                                     |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|          attachments           | [{u'device': u'/dev/vdb', u'server_id': u'69f8eac4-57e7-4c2e-94af-34a333e7e078', u'id': u'a39b4939-016e-443c-ad2a-1a39d012e7e3', u'host_name': None, u'volume_id': u'a39b4939-016e-443c-ad2a-1a39d012e7e3'}] |
|       availability_zone        |                                                                                                     nova                                                                                                     |
|            bootable            |                                                                                                    false                                                                                                     |
|           created_at           |                                                                                          2014-07-07T11:00:27.000000                                                                                          |
|      display_description       |                                                                                                     None                                                                                                     |
|          display_name          |                                                                                                     None                                                                                                     |
|           encrypted            |                                                                                                    False                                                                                                     |
|               id               |                                                                                     a39b4939-016e-443c-ad2a-1a39d012e7e3                                                                                     |
|            metadata            |                                                                               {u'readonly': u'False', u'attached_mode': u'rw'}                                                                               |
|     os-vol-host-attr:host      |                                                                                        puma45.scl.lab.tlv.redhat.com                                                                                         |
| os-vol-mig-status-attr:migstat |                                                                                                     None                                                                                                     |
| os-vol-mig-status-attr:name_id |                                                                                                     None                                                                                                     |
|  os-vol-tenant-attr:tenant_id  |                                                                                       4d5b8da0f3bf4857bba91098d2d6ae1c                                                                                       |
|              size              |                                                                                                      1                                                                                                       |
|          snapshot_id           |                                                                                                     None                                                                                                     |
|          source_volid          |                                                                                                     None                                                                                                     |
|             status             |                                                                                                    in-use                                                                                                    |
|          volume_type           |                                                                                             my_test_volume_clear                                                                                             |
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Comment 1 yfried 2014-07-07 11:15:20 UTC
Created attachment 916042 [details]
nova log files from compute node

Comment 2 yfried 2014-07-07 11:15:49 UTC
Created attachment 916043 [details]
nova log files from controller

Comment 4 Eric Harney 2014-07-08 14:22:45 UTC
(In reply to yfried from comment #0)

> in /var/log/nova/compute.log
> 30157:2014-07-07 13:43:27.141 2993 ERROR nova.virt.block_device
> [req-17a1c67b-c4be-4f22-a0b8-75c9e53ede6a admin admin] [instance:
> 69f8eac4-57e7-4c2e-94af-34a333e7e078] Driver failed to attach volume
> f4ea7779-feea-403c-9970-720ecad2a2b9 at /dev/vdb
> 

Can you provide the log data surrounding this message?  It isn't in the attached logs.

Comment 7 Eric Harney 2014-07-08 15:08:09 UTC
Seems to be from misconfiguration, reopen if this is reproducible with the expected options set.

Comment 10 bkopilov 2014-11-26 07:52:46 UTC
Hi , 
First there is a bug in tempest , they are attaching device name as hardcoded as /dev/vdb .
Tempest conf should be configured with the device name - 

# Expected device name when a volume is attached to an instance
# (string value)
#volume_device_name = vdc

All API tests in tempest uses /dev/vdc  and its hardcoded too - need to fixed too.

We need to check what device name already used when created large.flavor ephemeral disk .

Benny

Comment 11 bkopilov 2014-11-26 08:16:11 UTC
I will fix /check nova.conf and rerun the scenario test.
I will submit patches for tempest to fix hardcoded issues. 

Benny

Comment 12 Sergey Gotliv 2014-11-27 21:51:30 UTC
I am closing it as notabug for the second time. Please, don't reopen.

Comment #8 suggests that installer should allow to configure that value.
I am not necessarily agree for many reasons but I would recommend to work with PM to understand a use case. In any case Cinder behaves by design.

Comment 13 Red Hat Bugzilla 2023-09-14 02:11:09 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days