Ejemplo n.º 1
0
def main():
    atexit.register(atexit_handler)

    device_opt = [
        "ipaddr", "no_login", "passwd", "boot_option", "no_port", "sudo",
        "amttool_path", "method"
    ]

    define_new_opts()

    all_opt["ipport"]["default"] = "16994"

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for AMT"
    docs["longdesc"] = "fence_amt is an I/O Fencing agent \
which can be used with Intel AMT. This agent calls support software amttool\
(http://www.kraxel.org/cgit/amtterm/)."

    docs["vendorurl"] = "http://www.intel.com/"
    show_docs(options, docs)

    run_delay(options)

    if not is_executable(options["--amttool-path"]):
        fail_usage("Amttool not found or not accessible")

    result = fence_action(None, options, set_power_status, get_power_status,
                          None, reboot_cycle)

    sys.exit(result)
Ejemplo n.º 2
0
def main():
	atexit.register(atexit_handler)

	device_opt = [ "ipaddr", "no_login", "passwd", "boot_option", "no_port",
		"sudo", "amttool_path", "method" ]

	define_new_opts()

	options = check_input(device_opt, process_input(device_opt))

	docs = { }
	docs["shortdesc"] = "Fence agent for AMT"
	docs["longdesc"] = "fence_amt is an I/O Fencing agent \
which can be used with Intel AMT. This agent calls support software amttool\
(http://www.kraxel.org/cgit/amtterm/)."
	docs["vendorurl"] = "http://www.intel.com/"
	show_docs(options, docs)

	run_delay(options)

	if not is_executable(options["--amttool-path"]):
		fail_usage("Amttool not found or not accessible")

	result = fence_action(None, options, set_power_status, get_power_status, None, reboot_cycle)

	sys.exit(result)
Ejemplo n.º 3
0
def main():
    atexit.register(atexit_handler)

    device_opt = [
        "login", "passwd", "port", "auth-url", "tenant-name", "openstack-path"
    ]
    define_new_opts()

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs[
        "shortdesc"] = "Fence agent for OpenStack's Ironic (Bare Metal as a service) service"
    docs["longdesc"] = "fence_ironic is a Fencing agent \
which can be used with machines controlled by the Ironic service. \
This agent calls the openstack CLI. \
WARNING! This fence agent is not intended for production use. Relying on a functional ironic service for fencing is not a good design choice."

    docs["vendorurl"] = "https://wiki.openstack.org/wiki/Ironic"
    show_docs(options, docs)

    run_delay(options)

    if not is_executable(options["--openstack-path"]):
        fail_usage("openstack tool not found or not accessible")

    result = fence_action(None, options, set_power_status, get_power_status,
                          get_devices_list)
    sys.exit(result)
Ejemplo n.º 4
0
def main():
    atexit.register(atexit_handler)

    device_opt = [
        "ipaddr", "login", "no_login", "no_password", "passwd", "diag",
        "lanplus", "auth", "cipher", "privlvl", "sudo", "ipmitool_path",
        "ipmitool_timeout", "method", "target", "hexadecimal_kg"
    ]
    define_new_opts()

    all_opt["power_wait"]["default"] = 2
    if os.path.basename(sys.argv[0]) == "fence_ilo3":
        all_opt["power_wait"]["default"] = "4"
        all_opt["lanplus"]["default"] = "1"
    elif os.path.basename(sys.argv[0]) == "fence_ilo4":
        all_opt["lanplus"]["default"] = "1"
    elif os.path.basename(sys.argv[0]) == "fence_ilo5":
        all_opt["lanplus"]["default"] = "1"

    all_opt["ipport"]["default"] = "623"
    all_opt["method"]["help"] = "-m, --method=[method]          Method to fence (onoff|cycle) (Default: onoff)\n" \
           "WARNING! This fence agent might report success before the node is powered off. " \
           "You should use -m/method onoff if your fence device works correctly with that option."

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for IPMI"
    docs["longdesc"] = "fence_ipmilan is an I/O Fencing agent\
which can be used with machines controlled by IPMI.\
This agent calls support software ipmitool (http://ipmitool.sf.net/). \
WARNING! This fence agent might report success before the node is powered off. \
You should use -m/method onoff if your fence device works correctly with that option."

    docs["vendorurl"] = ""
    docs["symlink"] = [("fence_ilo3", "Fence agent for HP iLO3"),
                       ("fence_ilo4", "Fence agent for HP iLO4"),
                       ("fence_ilo5", "Fence agent for HP iLO5"),
                       ("fence_imm",
                        "Fence agent for IBM Integrated Management Module"),
                       ("fence_idrac", "Fence agent for Dell iDRAC")]
    show_docs(options, docs)

    run_delay(options)

    if not is_executable(options["--ipmitool-path"]):
        fail_usage("Ipmitool not found or not accessible")

    reboot_fn = reboot_cycle
    if options["--action"] == "diag":
        # Diag is a special action that can't be verified so we will reuse reboot functionality
        # to minimize impact on generic library
        options["--action"] = "reboot"
        options["--method"] = "cycle"
        reboot_fn = reboot_diag

    result = fence_action(None, options, set_power_status, get_power_status,
                          None, reboot_fn)
    sys.exit(result)
Ejemplo n.º 5
0
def main():
	atexit.register(atexit_handler)

	device_opt = ["ipaddr", "login", "no_login", "no_password", "passwd",
		"diag", "lanplus", "auth", "cipher", "privlvl", "sudo",
		"ipmitool_path", "method", "target", "hexadecimal_kg"]
	define_new_opts()

	all_opt["power_wait"]["default"] = 2
	if os.path.basename(sys.argv[0]) == "fence_ilo3":
		all_opt["power_wait"]["default"] = "4"
		all_opt["method"]["default"] = "cycle"
		all_opt["lanplus"]["default"] = "1"
	elif os.path.basename(sys.argv[0]) == "fence_ilo4":
		all_opt["lanplus"]["default"] = "1"

	all_opt["ipport"]["default"] = "623"
	if all_opt["method"]["default"] == "cycle":
		all_opt["method"]["help"] = "-m, --method=[method]          Method to fence (onoff|cycle) (Default: cycle)\n" \
				    "WARNING! This fence agent might report success before the node is powered off. " \
				    "You should use -m/method onoff if your fence device works correctly with that option."

	options = check_input(device_opt, process_input(device_opt))

	docs = {}
	docs["shortdesc"] = "Fence agent for IPMI"
	docs["longdesc"] = "fence_ipmilan is an I/O Fencing agent\
which can be used with machines controlled by IPMI.\
This agent calls support software ipmitool (http://ipmitool.sf.net/). \
WARNING! This fence agent might report success before the node is powered off. \
You should use -m/method onoff if your fence device works correctly with that option."
	docs["vendorurl"] = ""
	docs["symlink"] = [("fence_ilo3", "Fence agent for HP iLO3"),
		("fence_ilo4", "Fence agent for HP iLO4"),
		("fence_imm", "Fence agent for IBM Integrated Management Module"),
		("fence_idrac", "Fence agent for Dell iDRAC")]
	show_docs(options, docs)

	run_delay(options)

	if not is_executable(options["--ipmitool-path"]):
		fail_usage("Ipmitool not found or not accessible")

	reboot_fn = reboot_cycle
	if options["--action"] == "diag":
		# Diag is a special action that can't be verified so we will reuse reboot functionality
		# to minimize impact on generic library
		options["--action"] = "reboot"
		options["--method"] = "cycle"
		reboot_fn = reboot_diag

	result = fence_action(None, options, set_power_status, get_power_status, None, reboot_fn)
	sys.exit(result)
Ejemplo n.º 6
0
def main():
	device_opt = [
		'ipaddr',
		'no_password',
		'no_login',
		'powerman_path',
	]

	atexit.register(atexit_handler)

	define_new_opts()

	# redefine default values for the options given by fencing.py
	# these 3 different values are derived from the lssd test cluster and may
	# need to adjusted depending on how other systems fare
	all_opt['ipport']['default'] = '10101'
	all_opt['delay']['default'] = '3'
	all_opt['power_wait']['default'] = '3'

	options = check_input(device_opt, process_input(device_opt))
	docs = {}
	docs["shortdesc"] = "Fence Agent for Powerman"
	docs["longdesc"] = "This is a Pacemaker Fence Agent for the \
Powerman management utility that was designed for LLNL systems."
	docs["vendorurl"] = "https://github.com/chaos/powerman"
	show_docs(options, docs)

	run_delay(options)

	if not is_executable(options["--powerman-path"]):
		fail_usage("Powerman not found or not executable at path " + options["--powerman-path"])

	# call the fencing.fence_action function, passing in my various fence functions
	# def fence_action(connection, options, set_power_fn, get_power_fn, get_outlet_list=None, reboot_cycle_fn=None)
	result = fence_action(
				None,
				options,
				set_power_status,
				get_power_status,
				get_list,
				None
			)
	sys.exit(result)
Ejemplo n.º 7
0
def main():
	device_opt = [
		'ipaddr',
		'no_password',
		'no_login',
		'powerman_path',
	]

	atexit.register(atexit_handler)

	define_new_opts()

	# redefine default values for the options given by fencing.py
	# these 3 different values are derived from the lssd test cluster and may
	# need to adjusted depending on how other systems fare
	all_opt['ipport']['default'] = '10101'
	all_opt['delay']['default'] = '3'
	all_opt['power_wait']['default'] = '3'

	options = check_input(device_opt, process_input(device_opt))
	docs = {}
	docs["shortdesc"] = "Fence Agent for Powerman"
	docs["longdesc"] = "This is a Pacemaker Fence Agent for the \
Powerman management utility that was designed for LLNL systems."
	docs["vendorurl"] = "https://github.com/chaos/powerman"
	show_docs(options, docs)

	run_delay(options)

	if not is_executable(options["--powerman-path"]):
		fail_usage("Powerman not found or not executable at path " + options["--powerman-path"])

	# call the fencing.fence_action function, passing in my various fence functions
	result = fence_action(
				None,
				options,
				set_power_status,
				get_power_status,
				get_list,
				None
			)
	sys.exit(result)
Ejemplo n.º 8
0
def main():
    atexit.register(atexit_handler)

    device_opt = [
        "ipaddr", "login", "no_login", "no_password", "passwd", "lanplus",
        "auth", "cipher", "privlvl", "sudo", "ipmitool_path", "method"
    ]
    define_new_opts()

    if os.path.basename(sys.argv[0]) == "fence_ilo3":
        all_opt["power_wait"]["default"] = "4"
        all_opt["method"]["default"] = "cycle"
        all_opt["lanplus"]["default"] = "1"
    elif os.path.basename(sys.argv[0]) == "fence_ilo4":
        all_opt["lanplus"]["default"] = "1"

    all_opt["ipport"]["default"] = "623"

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for IPMI"
    docs["longdesc"] = "fence_ipmilan is an I/O Fencing agent\
which can be used with machines controlled by IPMI.\
This agent calls support software ipmitool (http://ipmitool.sf.net/)."

    docs["vendorurl"] = ""
    docs["symlink"] = [("fence_ilo3", "Fence agent for HP iLO3"),
                       ("fence_ilo4", "Fence agent for HP iLO4"),
                       ("fence_imm",
                        "Fence agent for IBM Integrated Management Module"),
                       ("fence_idrac", "Fence agent for Dell iDRAC")]
    show_docs(options, docs)

    run_delay(options)

    if not is_executable(options["--ipmitool-path"]):
        fail_usage("Ipmitool not found or not accessible")

    result = fence_action(None, options, set_power_status, get_power_status,
                          None, reboot_cycle)
    sys.exit(result)
Ejemplo n.º 9
0
def main():
	atexit.register(atexit_handler)

	device_opt = ["ipaddr", "login", "no_login", "no_password", "passwd",
		"lanplus", "auth", "cipher", "privlvl", "sudo", "ipmitool_path", "method"]
	define_new_opts()

	all_opt["power_wait"]["default"] = 2
	if os.path.basename(sys.argv[0]) == "fence_ilo3":
		all_opt["power_wait"]["default"] = "4"
		all_opt["method"]["default"] = "cycle"
		all_opt["lanplus"]["default"] = "1"
	elif os.path.basename(sys.argv[0]) == "fence_ilo4":
		all_opt["lanplus"]["default"] = "1"

	all_opt["ipport"]["default"] = "623"

	options = check_input(device_opt, process_input(device_opt))

	docs = {}
	docs["shortdesc"] = "Fence agent for IPMI"
	docs["longdesc"] = "fence_ipmilan is an I/O Fencing agent\
which can be used with machines controlled by IPMI.\
This agent calls support software ipmitool (http://ipmitool.sf.net/)."
	docs["vendorurl"] = ""
	docs["symlink"] = [("fence_ilo3", "Fence agent for HP iLO3"),
		("fence_ilo4", "Fence agent for HP iLO4"),
		("fence_imm", "Fence agent for IBM Integrated Management Module"),
		("fence_idrac", "Fence agent for Dell iDRAC")]
	show_docs(options, docs)

	run_delay(options)

	if not is_executable(options["--ipmitool-path"]):
		fail_usage("Ipmitool not found or not accessible")

	result = fence_action(None, options, set_power_status, get_power_status, None, reboot_cycle)
	sys.exit(result)
Ejemplo n.º 10
0
def main():
    atexit.register(atexit_handler)

    device_opt = ["login", "passwd", "port", "auth-url", "tenant-name", "openstack-path"]
    define_new_opts()

    options = check_input(device_opt, process_input(device_opt))

    docs = {}
    docs["shortdesc"] = "Fence agent for OpenStack's Ironic (Bare Metal as a service) service"
    docs["longdesc"] = "fence_ironic is a Fencing agent \
which can be used with machines controlled by the Ironic service. \
This agent calls the openstack CLI. \
WARNING! This fence agent is not intended for production use. Relying on a functional ironic service for fencing is not a good design choice."
    docs["vendorurl"] = "https://wiki.openstack.org/wiki/Ironic"
    show_docs(options, docs)

    run_delay(options)

    if not is_executable(options["--openstack-path"]):
        fail_usage("openstack tool not found or not accessible")

    result = fence_action(None, options, set_power_status, get_power_status, get_devices_list)
    sys.exit(result)