diff options
| author | Josh Durgin <joshd@hq.newdream.net> | 2011-05-13 10:26:13 -0700 |
|---|---|---|
| committer | MORITA Kazutaka <morita.kazutaka@gmail.com> | 2011-05-13 10:26:13 -0700 |
| commit | 8b86fb3a4d9ee3e328232c0051b9daff6838d00d (patch) | |
| tree | 17613c51a9c97c5ec792d7569532554280c5498d | |
| parent | aaec8400be701c674bbf89badd59ee9468827ed9 (diff) | |
| download | nova-8b86fb3a4d9ee3e328232c0051b9daff6838d00d.tar.gz nova-8b86fb3a4d9ee3e328232c0051b9daff6838d00d.tar.xz nova-8b86fb3a4d9ee3e328232c0051b9daff6838d00d.zip | |
Add support for rbd snapshots.
| -rw-r--r-- | nova/volume/driver.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nova/volume/driver.py b/nova/volume/driver.py index 0807ff476..e0e18b9bf 100644 --- a/nova/volume/driver.py +++ b/nova/volume/driver.py @@ -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 |
