Ask Your Question

discard/unmap support for LVM/ISCSI cinder volumes

asked 2016-11-22 09:26:23 -0500

schegi gravatar image

updated 2016-11-25 02:17:08 -0500


i am currently testing the discard/unmap support for cinder volumes and came across the following problem. If i test discard/unmap manually, by creating a LVM volume, hand it to another server through ISCSI mount it there and write/delete to it, trim/discard seem to function pretty well. Creating a file, remove it and drop the caches, results in empty space on the disk (volume) the file location (tested with dd an direct access to the sectors). But if i am doing pretty much the same from within a VM with a cinder attached volume, i can still read the file content after deletion from everywhere: from inside the VM (dd on the device), on the compute node (dd on the iscsi device(which is later on handed into the VM)) and on the storage node (dd directly on the LVM volume. It seems like the unmap/discard related to the file deletion is somehow not propagated out of the VM.

I am using 'iscsi_helper = lioadm' and configured 'report_discard_supported = True' which gives me the 'discard=unmap' parameter in the disk sections of the libvirt xml of the VM. But i recognized is that cinder seems not to set the 'emulate_tpu=1' attribute to the block devices defined in 'backstore/block device' in the ISCSI target. In my manual test this attribute had to be set to make discard/unmap work for ISCSI volumes. Setting it manually at least helped me getting discard support recongized by 'lsblk -o +DISC-MAX' which was 0B from within the VM for volumes without the 'emulate_tpu' attribute set. But unmap/discard still does not work.

My two questions are:

  • Is there a way to pass additional parameters like the 'emulate_tpu=1' through cinder so that they are default for the ISCSI targets. In cinder.conf docu the 'iscsi_target_flags' is mentioned but it according to the doc it only applies for the tgtadm iscsi_helper (which is not recommened any more from my understanding).
  • How to configure cinder correctly so that discard/unmap hits the disk for file deletion?

Any help, hint or suggestion welcome.

Thx Stefan

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2017-01-19 06:20:40 -0500

schegi gravatar image

Distro used for testing was centos 7.2


edit flag offensive delete link more

answered 2017-01-10 05:00:46 -0500

Hi schegi. What ditro do you use for your installation ? I have configured report_discard_supported = True but my libvirt xml does not have 'discard=unmap' parameter for attached volumes.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-11-22 09:26:23 -0500

Seen: 277 times

Last updated: Jan 19 '17