发现nova-volume删除很慢,查看./nova/volume/driver.py
def _delete_volume(self, volume, size_in_g):
"""Deletes a logical volume."""
# zero out old volumes to prevent data leaking between users
# TODO(ja): reclaiming space should be done lazy and low priority
self._copy_volume('/dev/zero', self.local_path(volume), size_in_g)
self._try_execute('lvremove', '-f', "%s/%s" %
(FLAGS.volume_group,
self._escape_snapshot(volume['name'])),
run_as_root=True)
删除前会dd整个volume,感觉这个没有必要,可以注释掉这一行或改为只dd前100MB:
self._copy_volume('/dev/zero', self.local_path(volume), size_in_g)