MCPcopy Create free account
hub / github.com/ceph/ceph / kill_osd

Method kill_osd

qa/tasks/ceph_manager.py:3177–3202  ·  view source on GitHub ↗

Kill osds by either power cycling (if indicated by the config) or by stopping.

(self, osd)

Source from the content-addressed store, hash-verified

3175 self.raw_cluster_cmd('osd', 'out', str(osd))
3176
3177 def kill_osd(self, osd):
3178 """
3179 Kill osds by either power cycling (if indicated by the config)
3180 or by stopping.
3181 """
3182 if self.config.get('powercycle'):
3183 remote = self.find_remote('osd', osd)
3184 self.log('kill_osd on osd.{o} '
3185 'doing powercycle of {s}'.format(o=osd, s=remote.name))
3186 self._assert_ipmi(remote)
3187 remote.console.power_off()
3188 elif self.config.get('bdev_inject_crash') and self.config.get('bdev_inject_crash_probability'):
3189 if random.uniform(0, 1) < self.config.get('bdev_inject_crash_probability', .5):
3190 self.inject_args(
3191 'osd', osd,
3192 'bdev-inject-crash', self.config.get('bdev_inject_crash'))
3193 try:
3194 self.ctx.daemons.get_daemon('osd', osd, self.cluster).wait()
3195 except:
3196 pass
3197 else:
3198 raise RuntimeError('osd.%s did not fail' % osd)
3199 else:
3200 self.ctx.daemons.get_daemon('osd', osd, self.cluster).stop()
3201 else:
3202 self.ctx.daemons.get_daemon('osd', osd, self.cluster).stop()
3203
3204 @staticmethod
3205 def _assert_ipmi(remote):

Callers 11

taskFunction · 0.95
taskFunction · 0.95
taskFunction · 0.95
taskFunction · 0.95
taskFunction · 0.95
taskFunction · 0.95
test_incomplete_pgsFunction · 0.95
taskFunction · 0.95
taskFunction · 0.95
taskFunction · 0.95
taskFunction · 0.95

Calls 9

find_remoteMethod · 0.95
_assert_ipmiMethod · 0.95
inject_argsMethod · 0.95
getMethod · 0.45
logMethod · 0.45
formatMethod · 0.45
waitMethod · 0.45
get_daemonMethod · 0.45
stopMethod · 0.45

Tested by 1

test_incomplete_pgsFunction · 0.76