Kill osds by either power cycling (if indicated by the config) or by stopping.
(self, osd)
| 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): |