Attach Volume with discard option

asked 2015-04-30 01:01:03 -0500

hfamily15 gravatar image

updated 2015-04-30 01:06:32 -0500

Hi, all
I'm trying to test with Juno 2014.2.2
And I saw the new feature for nova.
"Libvirt-Enable support discard option for disk device"

I tested above feature, It works well with "nova boot" like below.

<disk type="file" device="disk">
<driver name="qemu" type="qcow2" cache="none" discard="unmap"/>
<source file="/opt/openstack/instances/97bc3765-ddf4-4d9a-b0a9-e5f4235b40dc/disk"/>
<target dev="vda" bus="virtio"/>
<alias name="virtio-disk0"/>


But in testing attach volume, It didn't work.
I have Thin provisioned cinder-volume so I want attach volume to vm with discard option for reclaim.

How can I use Discard Option on attach-volume.

Thank you in advance.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-05-04 07:45:38 -0500

jdexter gravatar image

The question hear is whether this discard option is supported by your cinder volume driver. I would say that if this is a new feature in Nova, then its not going to be supported within Cinder yet. As you can see from the support matrix they do not even list a trim/ discard option.

Doing a cursory look through the cinder api and the lvm driver, there are no functions for doing a discard.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-04-30 01:01:03 -0500

Seen: 301 times

Last updated: May 04 '15