From 9a0554fdbe8b1cf1c44b4c1b8c7a1f103a59823f Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 19 Jun 2019 12:49:03 -0400 Subject: [PATCH] Remove all volumes from pool on removal Technically not needed, but otherwise random errors may be thrown, so best to be explicit. --- node-daemon/pvcd/CephInstance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node-daemon/pvcd/CephInstance.py b/node-daemon/pvcd/CephInstance.py index 19a0feba..d2476f62 100644 --- a/node-daemon/pvcd/CephInstance.py +++ b/node-daemon/pvcd/CephInstance.py @@ -430,6 +430,10 @@ def remove_pool(zk_conn, logger, name): # We are ready to create a new pool on this node logger.out('Removing RBD pool {}'.format(name), state='i') try: + # Remove pool volumes first + for volume in zkhandler.listchildren(zk_conn, '/ceph/volumes/{}'.format(name)): + remove_volume(zk_conn, logger, name, volume) + # Remove the pool retcode, stdout, stderr = common.run_os_command('ceph osd pool rm {pool} {pool} --yes-i-really-really-mean-it'.format(pool=name)) if retcode: