def nuke_helper(ctx, log): from teuthology.task.internal import check_lock, connect check_lock(ctx, None) connect(ctx, None) log.info('Unmount ceph-fuse and killing daemons...') shutdown_daemons(ctx, log) log.info('All daemons killed.') log.info('Unmount any osd data directories...') remove_osd_mounts(ctx, log) log.info('Dealing with any kernel mounts...') kernel_mounts = find_kernel_mounts(ctx, log) #remove_kernel_mounts(ctx, kernel_mounts, log) need_reboot = kernel_mounts if ctx.reboot_all: need_reboot = ctx.cluster.remotes.keys() reboot(ctx, need_reboot, log) log.info('All kernel mounts gone.') log.info('Synchronizing clocks...') if ctx.synch_clocks: need_reboot = ctx.cluster.remotes.keys() synch_clocks(need_reboot, log) log.info('Reseting syslog output locations...') reset_syslog_dir(ctx, log) log.info('Clearing filesystem of test data...') remove_testing_tree(ctx, log) log.info('Filesystem Cleared.')
def nuke(ctx, log): from teuthology.task.internal import check_lock, connect check_lock(ctx, None) connect(ctx, None) log.info('Unmount ceph-fuse and killing daemons...') shutdown_daemons(ctx, log) log.info('All daemons killed.') log.info('Dealing with any kernel mounts...') kernel_mounts = find_kernel_mounts(ctx, log) #remove_kernel_mounts(ctx, kernel_mounts, log) need_reboot = kernel_mounts if ctx.reboot_all: need_reboot = ctx.cluster.remotes.keys() reboot(ctx, need_reboot, log) log.info('All kernel mounts gone.') log.info('Synchronizing clocks...') if ctx.synch_clocks: need_reboot = ctx.cluster.remotes.keys() synch_clocks(need_reboot, log) log.info('Reseting syslog output locations...') reset_syslog_dir(ctx, log) log.info('Clearing filesystem of test data...') remove_testing_tree(ctx, log) log.info('Filesystem Cleared.')
def nuke_helper(ctx, log): # ensure node is up with ipmi from teuthology.orchestra import remote (target, ) = ctx.config['targets'].keys() host = target.split('@')[-1] shortname = host.split('.')[0] if 'vpm' in shortname: return log.debug('shortname: %s' % shortname) log.debug('{ctx}'.format(ctx=ctx)) if not ctx.noipmi and 'ipmi_user' in ctx.teuthology_config: console = remote.getRemoteConsole( name=host, ipmiuser=ctx.teuthology_config['ipmi_user'], ipmipass=ctx.teuthology_config['ipmi_password'], ipmidomain=ctx.teuthology_config['ipmi_domain']) cname = '{host}.{domain}'.format( host=shortname, domain=ctx.teuthology_config['ipmi_domain']) log.info('checking console status of %s' % cname) if not console.check_status(): # not powered on or can't get IPMI status. Try to power on console.power_on() # try to get status again, waiting for login prompt this time log.info('checking console status of %s' % cname) if not console.check_status(100): log.error( 'Failed to get console status for %s, disabling console...' % cname) log.info('console ready on %s' % cname) else: log.info('console ready on %s' % cname) from teuthology.task.internal import check_lock, connect if ctx.check_locks: check_lock(ctx, None) connect(ctx, None) log.info('Unmount ceph-fuse and killing daemons...') shutdown_daemons(ctx, log) log.info('All daemons killed.') need_reboot = find_kernel_mounts(ctx, log) # no need to unmount anything if we're rebooting if ctx.reboot_all: need_reboot = ctx.cluster.remotes.keys() else: log.info('Unmount any osd data directories...') remove_osd_mounts(ctx, log) log.info('Unmount any osd tmpfs dirs...') remove_osd_tmpfs(ctx, log) #log.info('Dealing with any kernel mounts...') #remove_kernel_mounts(ctx, need_reboot, log) if need_reboot: reboot(ctx, need_reboot, log) log.info('All kernel mounts gone.') log.info('Synchronizing clocks...') if ctx.synch_clocks: need_reboot = ctx.cluster.remotes.keys() synch_clocks(need_reboot, log) log.info('Making sure firmware.git is not locked...') ctx.cluster.run(args=[ 'sudo', 'rm', '-f', '/lib/firmware/updates/.git/index.lock', ]) log.info('Reseting syslog output locations...') reset_syslog_dir(ctx, log) log.info('Clearing filesystem of test data...') remove_testing_tree(ctx, log) log.info('Filesystem Cleared.') remove_installed_packages(ctx, log) log.info('Installed packages removed.')
def nuke_helper(ctx, log): # ensure node is up with ipmi from teuthology.orchestra import remote (target,) = ctx.config['targets'].keys() host = target.split('@')[-1] shortname = host.split('.')[0] if 'vpm' in shortname: return log.debug('shortname: %s' % shortname) log.debug('{ctx}'.format(ctx=ctx)) if not ctx.noipmi and 'ipmi_user' in ctx.teuthology_config: console = remote.getRemoteConsole(name=host, ipmiuser=ctx.teuthology_config['ipmi_user'], ipmipass=ctx.teuthology_config['ipmi_password'], ipmidomain=ctx.teuthology_config['ipmi_domain']) cname = '{host}.{domain}'.format(host=shortname, domain=ctx.teuthology_config['ipmi_domain']) log.info('checking console status of %s' % cname) if not console.check_status(): # not powered on or can't get IPMI status. Try to power on console.power_on() # try to get status again, waiting for login prompt this time log.info('checking console status of %s' % cname) if not console.check_status(100): log.error('Failed to get console status for %s, disabling console...' % cname) log.info('console ready on %s' % cname) else: log.info('console ready on %s' % cname) from teuthology.task.internal import check_lock, connect if ctx.check_locks: check_lock(ctx, None) connect(ctx, None) log.info('Unmount ceph-fuse and killing daemons...') shutdown_daemons(ctx, log) log.info('All daemons killed.') need_reboot = find_kernel_mounts(ctx, log) # no need to unmount anything if we're rebooting if ctx.reboot_all: need_reboot = ctx.cluster.remotes.keys() else: log.info('Unmount any osd data directories...') remove_osd_mounts(ctx, log) log.info('Unmount any osd tmpfs dirs...') remove_osd_tmpfs(ctx, log) #log.info('Dealing with any kernel mounts...') #remove_kernel_mounts(ctx, need_reboot, log) if need_reboot: reboot(ctx, need_reboot, log) log.info('All kernel mounts gone.') log.info('Synchronizing clocks...') if ctx.synch_clocks: need_reboot = ctx.cluster.remotes.keys() synch_clocks(need_reboot, log) log.info('Making sure firmware.git is not locked...') ctx.cluster.run(args=[ 'sudo', 'rm', '-f', '/lib/firmware/updates/.git/index.lock', ]) log.info('Reseting syslog output locations...') reset_syslog_dir(ctx, log) log.info('Clearing filesystem of test data...') remove_testing_tree(ctx, log) log.info('Filesystem Cleared.') remove_installed_packages(ctx, log) log.info('Installed packages removed.')