Ask Your Question

Anyway to avoid filling zero when deleting a volume?

asked 2012-12-21 20:28:06 -0500

xionglingfeng gravatar image

Hi all, I found when I deleting a volume, cinder will fill the whole volume with zero. This may cause two problem: 1. it waste a lot of time 2. it often failed in my servers

I don't know why but it always failed in my server, even with a brand new hard driver. When it failed, my volume will be leave at a "Error_Deleting" state and I cannot delete it completely. I know this is good for security, but I really think I don't need it. Anyway to turn it of? Thanks in advanced.

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted

answered 2012-12-24 06:03:36 -0500

xionglingfeng gravatar image

Ok... since no one give me a hand, I will answer this question by myself...

For some server, like mine, always crash when deleting a volume because it executed some operations like dd if=/dev/zero of=XXXX

This operating could took a long time and make server load extremely high, furthermore, it may crash some servers like ours. And when this operation failed, the volume will leave at 'Error_deleting' status, neither can be deleted nor be restored to 'Available' status.

To zero out a volume before deleting it is a good strategy for security. However, for some secure insensitive private cloud system like ours, this is unnecessary. So here's the solution to avoid zeroing out a volume before deleting it: Use a editor to open /usr/lib/python2.7/dist-packages/cinder/volume/ Go to line 160 (I have patched cinder to support O_DIRECT on virtual driver, so the line number in vanilla Folsom cinder package should be a bit smaller than this.) This line should be self._copy_volume('/dev/zero', self.local_path(volume), size_in_g) the first line of function _delete_volume() Just comment that line out.

edit flag offensive delete link more

answered 2012-12-31 11:34:54 -0500

That will indeed fix it, but a better way is to set the "secure_delete" flag to False.

edit flag offensive delete link more

answered 2012-12-31 11:44:26 -0500

xionglingfeng gravatar image

Hi Avishay, Could you explain a bit more future? Where to set that flag?

edit flag offensive delete link more

answered 2013-01-01 10:08:13 -0500

In cinder.conf, add the following line: secure_delete = False

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: 2012-12-21 20:28:06 -0500

Seen: 404 times

Last updated: Jan 01 '13