From: Alfredo Deza Date: Thu, 3 Jul 2014 17:13:42 +0000 (-0400) Subject: add partprobing/partx calls on device when zapping X-Git-Tag: v1.5.8~7^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F208%2Fhead;p=ceph-deploy.git add partprobing/partx calls on device when zapping Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py index 1e5c2bc..960dfd3 100644 --- a/ceph_deploy/osd.py +++ b/ceph_deploy/osd.py @@ -383,6 +383,33 @@ def disk_zap(args): disk, ], ) + + # once all is done, call partprobe (or partx) + # On RHEL and CentOS distros, calling partprobe forces a reboot of the + # server. Since we are not resizing partitons we rely on calling + # partx + if distro.normalized_name.startswith(('centos', 'red')): + LOG.info('calling partx on zapped device %s', disk) + LOG.info('re-reading known partitions will display errors') + remoto.process.run( + distro.conn, + [ + 'partx', + '-a', + disk, + ], + ) + + else: + LOG.debug('Calling partprobe on zapped device %s', disk) + remoto.process.run( + distro.conn, + [ + 'partprobe', + disk, + ], + ) + distro.conn.exit()