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

Bug 1139136

Summary: unable to delete volume after attach with mount point fails on instance (tempest)
Product: Red Hat OpenStack Reporter: bkopilov <bkopilov>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED WONTFIX QA Contact: nlevinki <nlevinki>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.0 (RHEL 6)CC: eharney, scohen, sgotliv, yeylon
Target Milestone: ---   
Target Release: 6.0 (Juno)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 13:41:35 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
openstack_logs
none
openstack_config none

Description bkopilov 2014-09-08 07:59:26 UTC
Description of problem:
Openstack on rhel 7.0
rhos 5.0  version .

After creating instance , we try to attach volume to it .
The volume created by tempest code :
def test_attach_detach_volume_to_instance(self):
        # Volume is attached and detached successfully from an instance
        mountpoint = '/dev/vdc'
        _, body = self.client.attach_volume(self.volume['id'],
                                            self.server['id'],
                                            mountpoint)

After volume has been created , we are attaching it to instance .
The result of this action is that cinder shows that the volume attached to instance .
But in nova - instace we do not see the volume in lsblk output  .
We get error from logs :
/var/log/nova/nova-compute.log:136:2014-09-08 02:59:39.573 31416 DEBUG nova.virt.disk.api [req-c0039d74-1c31-4e19-8719-bf3fb8eca505 8826f60585d244339c6a51dd7ce7b26f fbf97ed492214e9b8bb9f47206879a9c] Unable to mount image /var/lib/nova/instances/5531d5a9-cefd-4873-bbca-bdd4336ca5a8/disk with error Error mounting /var/lib/nova/instances/5531d5a9-cefd-4873-bbca-bdd4336ca5a8/disk with libguestfs (mount_options: /dev/sda on / (options: ''): mount: /dev/sda is write-protected, mounting read-only



I attached another volume with auto mount  point .
When we delete the instacne the cinder is binded to deleted instance and we can not delete the volume.


Version-Release number of selected component (if applicable):


How reproducible:

#1 Create instance  
#2 create volume with tempest code based on : 
def test_attach_detach_volume_to_instance(self):
        # Volume is attached and detached successfully from an instance
        mountpoint = '/dev/vdc'
        _, body = self.client.attach_volume(self.volume['id'],
                                            self.server['id'],
                                            mountpoint)
#2 the volume is attached , but we dont see it in instance (cirros image)
#3 attach another volume with auto mount point to instance
#4 delete the instance 
#5 at this point cinder attachment is to "not existing" instance and we are not able to delete the volume.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
In case of mount failure we should be able to delete volume .

Additional info:
See attached logs .

Comment 2 bkopilov 2014-09-08 08:05:37 UTC
Created attachment 935259 [details]
openstack_logs

Comment 3 bkopilov 2014-09-08 08:07:44 UTC
Created attachment 935260 [details]
openstack_config

Comment 4 Sergey Gotliv 2014-09-11 13:41:35 UTC
Please, open this case upstream.