Unexpected cinder volumes export occurs after restarting cinder-volume
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Critical
|
Mitsuhiro Tanino |
Bug Description
When I restarted cinder-volume service, I noticed that all cinder volumes which use LVMISCSIDriver are exported via tgtd unexpectedly.
If the volumes are attached to nova instances, they should be exported via tgtd after restarting cinder-volume.
But the volumes which are not attached to instances must not be exported;
(a) Everyone can connect these volumes because the volumes are exported via tgtd
without user and password authentication.
(b) Exported volume(LVMiSCSI) via tgtd can't delete from 'cinder delete'
because the LV is locked by tgtd, therefore lvremove fails to
delete target LV. This makes volume status as a deleting error.
Here is my cinder.conf and some logs.
http://
I think this is a patch of the root cause for this problem.
Originally, ensure_export() was only called if the volume status was 'in-use'.
This means that if a volume was attached to an instance, the volume was exported after restarting cinder-volume service.
However, after applying this patch, ensure_export() is called if the volume is 'available' status.
Despite the volume is not attached to specific instance but the volume is exported to outside.
This is wrong behavior.
In my understanding. ensure_export() must be called only the volume status is 'in-use'.
Commit
=======
commit ffefe18334a9456
Author: Zhiteng Huang <email address hidden>
Date: Sat Aug 23 18:32:57 2014 +0000
-------
for volume in volumes:
- if volume['status'] in ['in-use']:
+ # available volume should also be counted into allocated
+ if volume['status'] in ['in-use', 'available']:
- sum += volume['size']
- self.stats[
+ self._count_
+
-------
Changed in cinder: | |
assignee: | nobody → Mitsuhiro Tanino (mitsuhiro-tanino) |
summary: |
- Unexpected cinder volumes export occur after restarting cinder-volume + Unexpected cinder volumes export occurs after restarting cinder-volume |
description: | updated |
Changed in cinder: | |
milestone: | none → juno-rc3 |
description: | updated |
description: | updated |
description: | updated |
Changed in cinder: | |
milestone: | juno-rc3 → 2014.2 |
Fix proposed to branch: master /review. openstack. org/128437
Review: https:/