Add support for rbd snapshots.

This commit is contained in:
Josh Durgin
2011-05-13 10:26:13 -07:00
committed by MORITA Kazutaka
parent aaec8400be
commit 8b86fb3a4d

View File

@@ -608,6 +608,18 @@ class RBDDriver(VolumeDriver):
self._try_execute('rbd', '--pool', FLAGS.rbd_pool,
'rm', volume['name'])
def create_snapshot(self, snapshot):
"""Creates an rbd snapshot"""
self._try_execute('rbd', '--pool', FLAGS.rbd_pool,
'snap', 'create', '--snap', snapshot['name'],
snapshot['volume_name'])
def delete_snapshot(self, snapshot):
"""Deletes an rbd snapshot"""
self._try_execute('rbd', '--pool', FLAGS.rbd_pool,
'snap', 'rm', '--snap', snapshot['name'],
snapshot['volume_name'])
def local_path(self, volume):
"""Returns the path of the rbd volume."""
# This is the same as the remote path