From e6ee22c1f6cd48b2e24272a2723bd771630a29e4 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 1 Feb 2022 19:07:53 -0700 Subject: [PATCH] nuke: In containers, simply kill sshd At least with the testnode containers I'm working on at the moment, this appears to be the best way to shut them down from inside. Signed-off-by: Zack Cerza --- teuthology/nuke/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/teuthology/nuke/__init__.py b/teuthology/nuke/__init__.py index e97bb1deb8..47a96cd2ce 100644 --- a/teuthology/nuke/__init__.py +++ b/teuthology/nuke/__init__.py @@ -314,19 +314,20 @@ def nuke_helper(ctx, should_unlock, keep_logs, should_reboot): if is_vm(shortname): return log.debug('shortname: %s' % shortname) + remote = Remote(host) if ctx.check_locks: # does not check to ensure if the node is 'up' # we want to be able to nuke a downed node check_lock.check_lock(ctx, None, check_up=False) status = get_status(host) if status['machine_type'] in provision.fog.get_types(): - remote = Remote(host) remote.console.power_off() return elif status['machine_type'] in provision.pelagos.get_types(): provision.pelagos.park_node(host) return - + elif remote.is_container: + remote.run(args=['sudo', 'killall', 'sshd']) if (not ctx.noipmi and 'ipmi_user' in config and 'vpm' not in shortname): try: -- 2.39.5