def reload_config(force=False): args = [] if force: args.append("-force") args.extend(["-noprompt", "-config", conf.scst_config_file]) sh.scstadmin(*args) return True
def rem_lun(lun, driver, target, group=None): """Remove a LUN from a target or initiator group. -rem_lun <lun> -driver <driver> -target <target> [-group <group>]""" args = ["-noprompt", "-rem_lun", lun, "-driver", driver, "-target", target] if group: args.extend(["-group", group]) sh.scstadmin(*args)
def rem_lun(lun, driver, target, group=None): """Remove a LUN from a target or initiator group. -rem_lun <lun> -driver <driver> -target <target> [-group <group>]""" args = ['-noprompt', '-rem_lun', lun, '-driver', driver, '-target', target] if group: args.extend(['-group', group]) sh.scstadmin(*args)
def clear_luns(driver, target, group=None): """Remove all LUNs from a target or initiator group. -clear_luns -driver <driver> -target <target> [-group <group>]""" args = ['-noprompt', '-clear_luns', '-driver', driver, '-target', target] if group: args.extend(['-group', group]) sh.scstadmin(*args)
def reload_config(force=False): args = [] if force: args.append('-force') args.extend(['-noprompt', '-config', conf.SCST_CONFIG_FILE]) sh.scstadmin(*args) return True
def clear_luns(driver, target, group=None): """Remove all LUNs from a target or initiator group. -clear_luns -driver <driver> -target <target> [-group <group>]""" args = ["-noprompt", "-clear_luns", "-driver", driver, "-target", target] if group: args.extend(["-group", group]) sh.scstadmin(*args)
def close_dev(device, handler, force=True): """Remove the specified device from SCST. -close_dev <device> -handler <handler>""" args = [] if force: args.append('-force') args.extend(['-noprompt', '-close_dev', device, '-handler', handler]) sh.scstadmin(*args)
def close_dev(device, handler, force=True): """Remove the specified device from SCST. -close_dev <device> -handler <handler>""" args = [] if force: args.append("-force") args.extend(["-noprompt", "-close_dev", device, "-handler", handler]) sh.scstadmin(*args)
def config(config_file, force=False): """Read and apply the specified configuration file. -config <file>""" args = [] if force: args.append('-force') args.extend(['-noprompt', '-config', config_file]) sh.scstadmin(*args) return True
def open_dev(device, handler, **attributes): """Create a new SCST device using the specified device handler and attributes. -open_dev <device> -handler <handler> -attributes <p=v,...>""" args = ["-noprompt", "-open_dev", device, "-handler", handler] if attributes: attrs = [] for k, v in attributes.iteritems(): attrs.append("%s=%s" % (k, v)) args.extend(["-attributes", ",".join(attrs)]) sh.scstadmin(*args)
def open_dev(device, handler, **attributes): """Create a new SCST device using the specified device handler and attributes. -open_dev <device> -handler <handler> -attributes <p=v,...>""" args = ['-noprompt', '-open_dev', device, '-handler', handler] if attributes: attrs = [] for k, v in attributes.iteritems(): attrs.append('%s=%s' % (k, v)) args.extend(['-attributes', ','.join(attrs)]) sh.scstadmin(*args)
def issue_lip(target=None, driver=None): """Issue a LIP (Loop Initialization Protocol, fibre channel) for a specific target or for all drivers and tar- gets. -issue_lip [<target>] [-driver <driver>]""" args = ['-noprompt', '-issue_lip'] if target: args.append(target) if driver: args.extend(['-driver', driver]) sh.scstadmin(*args)
def replace_lun(lun, driver, target, device, group=None, **attributes): """Replace the device associated with a LUN by another device. -replace_lun <lun> -driver <driver> -target <target> [-group <group>] -device <device> -attributes <p=v,...>""" args = ["-noprompt", "-replace_lun", lun, "-driver", driver, "-target", target] if group: args.extend(["-group", group]) args.extend(["-device", device]) if attributes: attrs = [] for k, v in attributes.iteritems(): attrs.append("%s=%s" % (k, v)) args.extend(["-attributes", ",".join(attrs)]) sh.scstadmin(*args)
def add_lun(lun, driver, target, device, group=None, **attributes): """Add a LUN to a target or initiator group. -add_lun <lun> -driver <driver> -target <target> [-group <group>] -device <device> -attributes <p=v,...>""" args = ["-noprompt", "-add_lun", lun, "-driver", driver, "-target", target] if group: args.extend(["-group", group]) args.extend(["-device", device]) if attributes: attrs = [] for k, v in attributes.iteritems(): attrs.append("%s=%s" % (k, v)) args.extend(["-attributes", ",".join(attrs)]) sh.scstadmin(*args)
def replace_lun(lun, driver, target, device, group=None, **attributes): """Replace the device associated with a LUN by another device. -replace_lun <lun> -driver <driver> -target <target> [-group <group>] -device <device> -attributes <p=v,...>""" args = ['-noprompt', '-replace_lun', lun, '-driver', driver, '-target', target] if group: args.extend(['-group', group]) args.extend(['-device', device]) if attributes: attrs = [] for k, v in attributes.iteritems(): attrs.append('%s=%s' % (k, v)) args.extend(['-attributes', ','.join(attrs)]) sh.scstadmin(*args)
def add_lun(lun, driver, target, device, group=None, **attributes): """Add a LUN to a target or initiator group. -add_lun <lun> -driver <driver> -target <target> [-group <group>] -device <device> -attributes <p=v,...>""" args = ['-noprompt', '-add_lun', lun, '-driver', driver, '-target', target] if group: args.extend(['-group', group]) args.extend(['-device', device]) if attributes: attrs = [] for k, v in attributes.iteritems(): attrs.append('%s=%s' % (k, v)) args.extend(['-attributes', ','.join(attrs)]) sh.scstadmin(*args)
def add_init(init, driver, target, group): """Add an initiator to an initiator group. <init> is either an explicit initiator name or an initiator name pattern. The wildcard characters '*', '?' and '!' are supported. -add_init <init> -driver <driver> -target <target> -group <group>""" sh.scstadmin('-noprompt', '-add_init', init, '-driver', driver, '-target', target, '-group', group)
def del_group(group, driver, target): """Remove an initiator group from the specified target. -rem_group <group> -driver <driver> -target <target>""" sh.scstadmin("-noprompt", "-rem_group", group, "-driver", driver, "-target", target)
def rem_init(init, driver, target, group): """Remove an initiator name or initiator name pattern from an initiator group. -rem_init <user> -driver <driver> -target <target> -group <group>""" sh.scstadmin("-noprompt", "-rem_init", init, "-driver", driver, "-target", target, "-group", group)
def clear_inits(driver, target, group): """Remove all initiators from an initiator group. -clear_inits -driver <driver> -target <target> -group <group>""" sh.scstadmin('-noprompt', '-clear_inits', '-driver', driver, '-target', target, '-group', group)
def move_init(init, driver, target, group1, group2): """Move an initiator or initiator name pattern from one initiator group to another. -move_init <init> -driver <driver> -target <target> -group <group1> -to <group2>""" sh.scstadmin('-noprompt', '-move_init', init, '-driver', driver, '-target', target, '-group', group1, '-to', group2)
def del_group(group, driver, target): """Remove an initiator group from the specified target. -rem_group <group> -driver <driver> -target <target>""" sh.scstadmin('-noprompt', '-rem_group', group, '-driver', driver, '-target', target)
def add_group(group, driver, target): """Add an initiator group to the specified target. -add_group <group> -driver <driver> -target <target>""" sh.scstadmin("-noprompt", "-add_group", group, "-driver", driver, "-target", target)
def add_group(group, driver, target): """Add an initiator group to the specified target. -add_group <group> -driver <driver> -target <target>""" sh.scstadmin('-noprompt', '-add_group', group, '-driver', driver, '-target', target)
def rem_target(target, driver): """Remove a target from a target driver. -rem_target <target> -driver <driver>""" sh.scstadmin('-noprompt', '-rem_target', target, '-driver', driver)
def move_init(init, driver, target, group1, group2): """Move an initiator or initiator name pattern from one initiator group to another. -move_init <init> -driver <driver> -target <target> -group <group1> -to <group2>""" sh.scstadmin("-noprompt", "-move_init", init, "-driver", driver, "-target", target, "-group", group1, "-to", group2)
def clear_inits(driver, target, group): """Remove all initiators from an initiator group. -clear_inits -driver <driver> -target <target> -group <group>""" sh.scstadmin("-noprompt", "-clear_inits", "-driver", driver, "-target", target, "-group", group)
def resync_dev(device): """Update device size. SCST caches the size of devices controlled by the vdisk_fileio and the vdisk_blockio device handlers. This command will not only cause SCST to update the cached device size but will also cause any logged in initiator to be notified about the capacity change event. -resync_dev <device>""" sh.scstadmin('-noprompt', '-resync_dev', device)
def add_target(target, driver): """Add a target to a target driver. -add_target <target> -driver <driver>""" sh.scstadmin('-noprompt', '-add_target', target, '-driver', driver)
def rem_init(init, driver, target, group): """Remove an initiator name or initiator name pattern from an initiator group. -rem_init <user> -driver <driver> -target <target> -group <group>""" sh.scstadmin('-noprompt', '-rem_init', init, '-driver', driver, '-target', target, '-group', group)