]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
add partprobing/partx calls on device when zapping 208/head
authorAlfredo Deza <alfredo.deza@inktank.com>
Thu, 3 Jul 2014 17:13:42 +0000 (13:13 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Thu, 3 Jul 2014 17:13:42 +0000 (13:13 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/osd.py

index 1e5c2bc5cc22622562a8b279aebab72914652597..960dfd3ac9a64ff9a6eb11816ce3f2e09b83d15d 100644 (file)
@@ -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()