From 022f738764f77dd1c4de03178594add28b87a0a3 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 3 Jul 2014 13:13:42 -0400 Subject: [PATCH] add partprobing/partx calls on device when zapping Signed-off-by: Alfredo Deza --- ceph_deploy/osd.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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() -- 2.47.3