{"id":42736333,"url":"https://github.com/redhat-performance/badfish","last_synced_at":"2026-02-03T23:18:08.452Z","repository":{"id":37502558,"uuid":"150741141","full_name":"redhat-performance/badfish","owner":"redhat-performance","description":"🔧 Vendor-agnostic tool for managing bare-metal systems via the Redfish API","archived":false,"fork":false,"pushed_at":"2026-01-27T16:09:23.000Z","size":999,"stargazers_count":111,"open_issues_count":17,"forks_count":30,"subscribers_count":13,"default_branch":"master","last_synced_at":"2026-01-28T00:06:01.552Z","etag":null,"topics":["automation","baremetal","bmc","dell","idrac","ipmi","oob","redfish","redfish-api","supermicro","systems","vendor"],"latest_commit_sha":null,"homepage":"https://quads.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhat-performance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-09-28T13:00:18.000Z","updated_at":"2026-01-20T03:25:01.000Z","dependencies_parsed_at":"2024-10-25T20:10:52.404Z","dependency_job_id":"0f0db4c5-e2f3-49c2-aee3-f2ce2639bbfe","html_url":"https://github.com/redhat-performance/badfish","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/redhat-performance/badfish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-performance%2Fbadfish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-performance%2Fbadfish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-performance%2Fbadfish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-performance%2Fbadfish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-performance","download_url":"https://codeload.github.com/redhat-performance/badfish/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-performance%2Fbadfish/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28882019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T16:41:59.663Z","status":"ssl_error","status_checked_at":"2026-01-29T16:39:39.641Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","baremetal","bmc","dell","idrac","ipmi","oob","redfish","redfish-api","supermicro","systems","vendor"],"created_at":"2026-01-29T18:06:02.796Z","updated_at":"2026-01-29T18:06:05.707Z","avatar_url":"https://github.com/redhat-performance.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/redhat-performance/badfish/development/image/badfish-original-licensed.small.png\" /\u003e\n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003eThe Out-of-Band Wrangler\u003c/h2\u003e\n\n[![Copr build status](https://copr.fedorainfracloud.org/coprs/quadsdev/badfish/package/badfish/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/quadsdev/badfish/package/badfish/)\n[![Codecov](https://codecov.io/gh/redhat-performance/badfish/branch/master/graph/badge.svg?token=CNJN0CD6GN)](https://codecov.io/gh/redhat-performance/badfish)\n[![Container image on Quay](https://quay.io/repository/quads/badfish/status \"Container image on Quay\")](https://quay.io/repository/quads/badfish)\n[![Tox](https://github.com/redhat-performance/badfish/actions/workflows/tox.yml/badge.svg)](https://github.com/redhat-performance/badfish/actions)\n[![Lint](https://github.com/redhat-performance/badfish/actions/workflows/lint.yml/badge.svg)](https://github.com/redhat-performance/badfish/actions)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n   * [About Badfish](#badfish)\n      * [Scope](#scope)\n      * [Features](#features)\n      * [Requirements](#requirements)\n      * [Setup](#setup)\n         * [Badfish RPM package](#badfish-rpm-package)\n         * [Badfish Standalone CLI](#badfish-standalone-cli)\n         * [Badfish Container](#badfish-container)\n      * [Usage](#usage)\n        * [As Python Library](#as-python-library)\n        * [Via Podman](#via-podman)\n        * [Via Virtualenv](#via-virtualenv)\n        * [Via RPM System Package](#via-rpm-system-package)\n      * [Common Operations](#common-operations)\n         * [Enforcing an OpenStack Director-style interface order](#enforcing-an-openstack-director-style-interface-order)\n         * [Enforcing a Foreman-style interface order](#enforcing-a-foreman-style-interface-order)\n         * [Enforcing a Custom interface order](#enforcing-a-custom-interface-order)\n         * [Forcing a one time boot to a specific device](#forcing-a-one-time-boot-to-a-specific-device)\n         * [Forcing a one time boot to a specific mac address](#forcing-a-one-time-boot-to-a-specific-mac-address)\n         * [Forcing a one time boot to a specific type](#forcing-a-one-time-boot-to-a-specific-type)\n         * [Forcing a one-time boot to PXE](#forcing-a-one-time-boot-to-pxe)\n         * [Rebooting a System](#rebooting-a-system)\n         * [Power Cycling a System](#power-cycling-a-system)\n         * [Power State Control](#power-state-control)\n         * [Check Power State](#check-power-state)\n         * [Get Power Consumed](#get-power-consumed)\n         * [Resetting iDRAC](#resetting-idrac)\n         * [Resetting BMC](#resetting-bmc)\n         * [BIOS factory reset](#bios-factory-reset)\n         * [Check current boot order](#check-current-boot-order)\n         * [Toggle boot device](#toggle-boot-device)\n         * [Variable number of retries](#variable-number-of-retries)\n         * [Firmware inventory](#firmware-inventory)\n         * [Delta of firmware inventories](#delta-of-firmware-inventories)\n         * [Clear Job Queue](#clear-job-queue)\n         * [List Job Queue](#list-job-queue)\n         * [Check Job Status](#check-job-status)\n         * [Set Bios Password](#set-bios-password)\n         * [Remove Bios Password](#remove-bios-password)\n         * [List Network Interfaces](#list-network-interfaces)\n         * [List Memory](#list-memory)\n         * [List Processors](#list-processors)\n         * [List Serial Number or Service Tag](#list-serial-number-or-service-tag)\n         * [Check Virtual Media](#check-virtual-media)\n         * [Mount Virtual Media](#mount-virtual-media)\n         * [Unmount Virtual Media](#unmount-virtual-media)\n         * [Boot to Virtual Media](#boot-to-virtual-media)\n         * [Check Remote Image](#check-remote-image)\n         * [Boot to Remote Image](#boot-to-remote-image)\n         * [Detach Remote Image](#detach-remote-image)\n         * [Get SRIOV mode](#get-sriov-mode)\n         * [Set SRIOV mode](#set-sriov-mode)\n         * [Get BIOS attributes](#get-bios-attributes)\n         * [Get specific BIOS attribute](#get-specific-bios-attribute)\n         * [Set BIOS attribute](#set-bios-attribute)\n         * [Change between BIOS and UEFI modes](#change-between-bios-and-uefi-modes)\n            * [Querying bootmode](#querying-bootmode)\n            * [Setting UEFI mode](#setting-uefi-mode)\n            * [Setting BIOS mode](#setting-bios-mode)\n         * [Get server screenshot](#get-server-screenshot)\n         * [Targets for server configuration profile](#targets-for-server-configuration-profile)\n         * [Export server configuration profile](#export-server-configuration-profile)\n         * [Import server configuration profile](#import-server-configuration-profile)\n         * [Bulk actions via text file with list of hosts](#bulk-actions-via-text-file-with-list-of-hosts)\n         * [Verbose Output](#verbose-output)\n         * [Log to File](#log-to-file)\n         * [Formatted output](#formatted-output)\n      * [iDRAC and Data Format](#idrac-and-data-format)\n         * [Dell Foreman and PXE Interface](#dell-foreman-and-pxe-interface)\n         * [Host type overrides](#host-type-overrides)\n      * [Contributing](#contributing)\n      * [Contact](#contact)\n\n# Badfish\nBadfish is a Redfish-based API tool for managing bare-metal systems via the [Redfish API](https://www.dmtf.org/standards/redfish)\n\nYou can read more [about badfish](https://quads.dev/about-badfish/) at the [QUADS](https://quads.dev/) website.\n\n## Scope\nRight now Badfish is focused on managing Dell, SuperMicro and HPE systems, but can potentially work with any system that supports the Redfish API.  Functionality may vary depending on the vendor Redfish implementation with Dell systems having the most functionality.\n\nWe're mostly concentrated on programmatically enforcing interface/device boot order to accommodate [TripleO](https://docs.openstack.org/tripleo-docs/latest/) based [OpenStack](https://www.openstack.org/) and [OpenShift](https://www.openshift.com/) deployments while simultaneously allowing easy management and provisioning of those same systems via [The Foreman](https://theforeman.org/).  Badfish can be useful as a general standalone, unified vendor IPMI/OOB tool however as support for more vendors is added.\n\n## Features\n* Toggle and save a persistent interface/device boot order on remote system\n* Support for BIOS and EFI modes for interface/device boot operations\n* Perform one-time boot to a specific interface, mac address or device listed for PXE booting\n* Enforce a custom interface boot order\n* Check current boot order\n* Display current power consumption in watts\n* Reboot host\n* Reset iDRAC\n* View, check and clear iDRAC jobs\n* Revert to factory settings\n* Check/set SRIOV\n* Take a remote screenshot of server KVM console activity (Dell only).\n* Support tokenized authentication\n* Check and set BIOS attributes (e.g. setting UEFI or BIOS mode)\n* Get firmware inventory of installed devices supported by iDRAC\n* Check/ummount virtual media en-masse across a set of systems (SuperMicro only)\n* Obtain limited hardware information (CPU, Memory, Interfaces)\n* Bulk actions via plain text file with list of hosts for parallel execution\n* Logging to a specific path\n* Containerized Badfish image\n\n## Requirements\n* (Dell) iDRAC7,8,9 or newer\n* (Dell) Firmware version ```2.60.60.60``` or higher\n* Any Redfish IPMI 2.0 support on non-Dell systems\n* iDRAC administrative account\n* Python \u003e= ```3.8``` or [podman](https://podman.io/getting-started/installation) as a container.\n* python3-devel \u003e= ```3.8``` (If using standalone or RPM package below).\n\n## Setup\n### Badfish RPM package\n```bash\ndnf copr enable quadsdev/badfish  -y\ndnf install badfish -y\n```\n\nActive RPM releases:\n- All current Fedora releases\n- Some older Fedora releases, check the [RPM releases here](https://copr.fedorainfracloud.org/coprs/quadsdev/badfish/)\n\n\u003e [!NOTE]\n\u003e RHEL and derivatives (Rocky, Alma, etc) should use [containers](#badfish-container) instead due to missing libs/dependencies.\n\n### Badfish Standalone CLI\n```bash\ngit clone https://github.com/redhat-performance/badfish \u0026\u0026 cd badfish\npython3 -m venv bf\nsource bf/bin/activate\npython3 -m pip install --upgrade build\npython3 -m build\npython3 -m pip install dist/badfish-*.tar.gz\n```\n\u003e [!TIP]\n\u003e This will allow Badfish to be called from the terminal via the `badfish` command\n\u003e\n\u003e This requires `python3-devel` if you see errors about missing `Python.h`.\n\n### Badfish Container\nPerhaps the easiest way to run Badfish is with Podman, you can see more usage details below on [using the Badfish container with Podman](#via-podman).  You can substitute Docker for Podman as well though not all functionality may be actively tested as we prefer Podman.\n\n```\npodman pull quay.io/quads/badfish\n```\n\n## Usage\nBadfish can be consumed in several ways after successful installation. Either via the standalone cli tool or as a python library.\nFor an extensive use of the cli tool check the [Common Operations](#common-operations) section of this file.\n\n\u003e [!TIP]\n\u003e Badfish operates optionally against a YAML configuration file to toggle between key:value pair sets of boot interface/device strings.\n\u003e You just need to create your own interface config that matches your needs to easily swap/save interface/device boot ordering or select one-time boot devices.\n\n### As Python Library\nIf Badfish has been properly installed in the system (RPM package install, setuptools), then the library should be available under your python path therefore it can be imported as a python library to your python project.\n\n```python\nfrom badfish.main import badfish_factory\n\nbadfish = await badfish_factory(\n    _host=_oob_mgmt,\n    _username=_username,\n    _password=_password,\n)\nawait badfish.get_boot_devices()\nsuccess = await badfish.boot_to(badfish.boot_devices[0]['Name'])\nif success:\n    print(\"Change boot device success\")\nresult = await badfish.reboot_server()\nif not result:\n    print(\"Failed to reboot system\")\n```\n\u003e [!IMPORTANT]\n\u003e Badfish relies heavily on asyncio for executing multiple tasks.\n\u003e If you will be using badfish from outside an async function you will have to provide an async event loop and run via `run_until_complete`\n\n### Via Podman\nBadfish happily runs in a container image using Podman or Docker (likely, but not actively tested).\n```bash\npodman pull quay.io/quads/badfish\n```\n```bash\npodman run -it --rm --dns $DNS_IP quay.io/quads/badfish -H $HOST -u $USER -p $PASS --reboot-only\n```\n\u003e [!IMPORTANT]\n\u003e\n\u003e If you are running Badfish against a host inside a VPN to an address without public resolution you must specify your VPN DNS server ip address with `--dns`\n\u003e\n\u003e If you would like to use a different file for `config/idrac_interfaces.yml` you can map a volume to your modified config with `-v idrac_interfaces.yml:config/idrac_interfaces.yml:Z`\n\n\u003e [!TIP]\n\u003e If you want to run any actions that would have output files like `--screenshot` you can map the container root volume to a directory on your local machine where you would like to have those files stored like `-v /tmp/screens:/badfish:Z`\n\n\u003e [!IMPORTANT]\n\u003e When mapping a volume to a container make sure to use the `:Z` suffix for appropiate labeling\n\n### Via Virtualenv\n[Virtualenv](https://docs.python.org/3/library/venv.html) is a wonderful tool to sandbox running Python applications or to separate Python versions of components from your main system libaries.  Unfortunately it can be problematic with running Badfish directly from the Git repo inside a virtualenv sandbox.\n\nWhile we strongly recommend using the [podman](#via-podman) method of calling Badfish inside a virtual environment you can still do it directly from the repository via virtualenv but you would need to prepend the call to Badfish with the setting of the `PYTHONPATH` environment variable pointing at the path of your Badfish repository.\n\n```\nvirtualenv venv\nsource venv/bin/activate\npip install --upgrade pip\npip install -r requirements.txt\nPYTHONPATH={BADFISH_REPO_PATH} python3 src/badfish/main.py -h\n```\n\nWe will likely add more libaries in the future and [can't guarantee](https://github.com/redhat-performance/JetSki/issues/186#issuecomment-982666646) these will be visible within your virtualenv without more symlinks or workarounds.\n\n### Via RPM System Package\nIf you choose to install Badfish via RPM package then it'll be located in `/usr/bin/badfish` and you don't need to do much else beyond know the correct command syntax for your required operations.\n\n\u003e [!NOTE]\n\u003e If you plan on using the `idrac_interfaces.yml` file to further customize or define pre-made boot orders you'll want to model your own [based on the repo example file](config/idrac_interfaces.yml).\n\u003e\n\u003e This file serves as an example but is specific to our internal environments so you'd most likely want to modify it to match your environment and naming conventions.\n\nYou can always retrieve our example `idrac_interfaces.yml` file via:\n\n```\ncurl  https://raw.githubusercontent.com/redhat-performance/badfish/master/config/idrac_interfaces.yml --output idrac_interfaces.yml\n```\n\n## Common Operations\n\n### Enforcing an OpenStack Director-style interface order\nIn our performance/scale R\u0026D environments TripleO-based OpenStack deployments require a specific 10/25/40GbE NIC to be the primary boot device for PXE, followed by disk, and then followed by the rest of the interfaces.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml -t director\n```\n\n### Enforcing a Foreman-style interface order\nForeman and Red Hat Satellite (as of 6.x based on Foreman) require managed systems to first always PXE from the interface that is Foreman-managed (DHCP/PXE).  If the system is not set to build it will simply boot to local disk.  In our setup we utilize a specific NIC for this interface based on system type.\n\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml -t foreman\n```\n\n### Enforcing a Custom interface order\nBadfish allows you to supply your own interface order type in addition to `director` and `foreman` modes as defined in `idrac_interfaces.yml`\n\n* Supply your own distinct string in the first part of the key value (split by `_`)\n* Refer to it via the string name\n* Consequently [host type overrides](#host-type-overrides) can also be leveraged\n\nWe will use the custom interface order called **ocp5beta** as an example.\n\n_Example_ any system you want to boot with a certain custom interface order.\n\n```\nocp5beta_fc640_interfaces: NIC.Slot.2-4,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3\n```\n\n_Example_ a rack of systems you want to boot with a certain custom interface order.\n\n\n```\nocp5beta_f21_fc640_interfaces: NIC.Slot.2-4,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3\n```\n\n_Example_ a specific system you want to boot with a certain custom interface order\n\n```\nocp5beta_f21_h23_fc640_interfaces: NIC.Slot.2-4,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3\n```\n\nNow you can run Badfish against the custom interface order type you have defined, refer to the [custom overrides](#host-type-overrides) on further usage examples.\n\n```bash\nsrc/main.py --host-list /tmp/hosts -u root -p password -i config/idrac_interfaces.yml -t ocp5beta\n```\n\n\n### Forcing a one time boot to a specific device\nTo force systems to perform a one-time boot to a specific device on the next subsequent reboot you can use the ```--boot-to``` option and pass as an argument the device you want the one-time boot to be set to. This will change the one time boot BIOS attributes OneTimeBootMode and OneTimeBootSeqDev and on the next reboot it will attempt to PXE boot or boot from that interface string.  You can obtain the device list via the `--check-boot` directive below.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --boot-to NIC.Integrated.1-3-1\n```\n\n### Forcing a one time boot to a specific mac address\nTo force systems to perform a one-time boot to a specific mac address on the next subsequent reboot you can use the ```--boot-to-mac``` option and pass as an argument the device mac address for a specific NIC that you want the one-time boot to be set to. This will change the one time boot BIOS attributes OneTimeBootMode and OneTimeBootSeqDev and on the next reboot it will attempt to PXE boot or boot from that interface.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --boot-to-mac A9:BB:4B:50:CA:54\n```\n\n### Forcing a one time boot to a specific type\nTo force systems to perform a one-time boot to a specific type on the next subsequent reboot you can use the ```--boot-to-type``` option and pass as an argument the device type, as defined on the iDRAC interfaces yaml, that you want the one-time boot to be set to. For this action you must also include the path to your interfaces yaml. This will change the one time boot BIOS attributes OneTimeBootMode and OneTimeBootSeqDev and on the next reboot it will attempt to PXE boot or boot from the first interface defined for that host type on the interfaces yaml file.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml --boot-to-type foreman\n```\n\n**Note** `--boot-to`, `--boot-to-type`, and `--boot-to-mac` require you to manually perform a reboot action, these simply just batch what the system will boot to on the next boot.  For this you can use either `--power-cycle` or `--reboot-only`.\n\n### Forcing a one-time boot to PXE\nTo force systems to perform a one-time boot to PXE, simply pass the `--pxe` flag to any of the commands above, by default it will pxe off the first available device for PXE booting.  This is equivalent to the ipmitool command `chassis bootdev pxe options=persistent` and should be used with SuperMicro/HPE systems or non-Dell systems that support a minimal IPMI 2.0 specification.\n\nFor Dell systems please use either  `--boot-to`, `--boot-to-mac` or `--boot-to-type` for temporary PXE to a specific interface or change the boot order permanently to achieve your desired effect.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml --pxe\n```\n\n### Rebooting a system\nIn certain cases you might need to only reboot the host, for this case we included the ```--reboot-only``` flag which will force a GracefulRestart on the target host. Note that this option is not to be used with any other option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --reboot-only\n```\n\n### Power cycling a system\nFor a hard reset you can use ```--power-cycle``` flag which will run a ForceOff instruction on the target host. Note that this option is not to be used with any other option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --power-cycle\n```\n\n### Power State Control\nYou can also turn a server on or off by using options `--power-on` and `--power-off` respectively.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --power-on\n```\n\n### Check Power State\nFor checking the current power state of a server you can run badfish with the `--power-state` option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --power-state\n```\nPartial Output:\n```\n- INFO     - Power state for mgmt-your-server.example.com: On\n```\n\n### Get Power Consumed\nThis displays the current power usage for Dell / Supermicro server(s).\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p --get-power-consumed\n```\nPartial Output:\n```\n- INFO     - Current watts consumed: 213\n```\n\n### Resetting iDRAC\nFor the replacement of `racadm racreset`, the optional argument `--racreset` was added. When this argument is passed to ```badfish```, a graceful restart is triggered on the iDRAC itself.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --racreset\n```\n\u003e [!NOTE]\n\u003e Dell specific command, for Supermicro servers there is an equivalent of `--bmc-reset`\n\n### Resetting BMC\nFor the replacement of `ipmitool bmc reset` or `ipmiutil reset`, the optional argument `--bmc-reset` was added. When this argument is passed to ```badfish```, a graceful restart is triggered on the BMC itself.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --bmc-reset\n```\n\u003e [!NOTE]\n\u003e Supermicro specific command, for Dell servers there is an equivalent of `--racreset`\n\n### BIOS factory reset\n\u003e [!CAUTION]\n\u003e Use this carefully, vendor defaults differ and may be disruptive. Do not use this in the Scale Lab or ALIAS.\n\nYou can restore BIOS default settings by calling Badfish with the option `--factory-reset`.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --factory-reset\n```\n\n### Check current boot order\nTo check the current boot order of a specific host you can use the ```--check-boot``` option which will return an ordered list of boot devices. Additionally you can pass the ```-i``` option which will in turn print on screen what type of host does the current boot order match as those defined on the iDRAC interfaces yaml.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml --check-boot\n```\n\n### Toggle boot device\nIf you would like to enable or disable a boot device you can use ```--toggle-boot-device``` argument which takes the device name as input and will toggle the `Enabled` state from True to False and vice versa.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --toggle-boot-device NIC.Integrated.1-3-1```\n```\n\n### Variable number of retries\nAt certain points during the execution of ```badfish``` the program might come across a non responsive resources and will automatically retry to establish connection. We have included a default value of 15 retries after failed attempts but this can be customized via the ```--retries``` optional argument which takes as input an integer with the number of desired retries.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml -t foreman --retries 20\n```\n\n### Firmware inventory\nIf you would like to get a detailed list of all the devices supported by iDRAC you can run ```badfish``` with the ```--firware-inventory``` option which will return a list of devices with additional device info.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --firmware-inventory\n```\n\n### Delta of firmware inventories\nIf you would like to get a delta between firmware inventories of two servers, you can do so with the `--delta` option. This option takes a second host address as its argument. Only the firmware that's on both servers and has different versions will get displayed.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --firmware-inventory --delta mgmt-your-other-server.example.com\n```\n\n### Clear Job Queue\nIf you would like to clear all the jobs that are queued on the remote iDRAC you can run ```badfish``` with the ```--clear-jobs``` option which query for all active jobs in the iDRAC queue and will post a request to clear the queue.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --clear-jobs\n```\n\nYou can also force the clearing of Dell iDRAC job queues by passing the `--force` option.\n\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --clear-jobs --force\n```\n\n### List Job Queue\nIf you would like to list all active jobs that are queued on the remote iDRAC you can run ```badfish``` with the ```--ls-jobs``` option which query for all active jobs in the iDRAC queue and will return a list with all active items.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --ls-jobs\n```\n\n### Check Job Status\nIf you would like to the status of an existing LifeCycle controller job you can run ```badfish``` with the ```--check-job``` option and passing the job id which can be obtained via ```--ls-jobs```. This will return a detail of the specific job with status and percentage of completion.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --check-job JID_340568202796\n```\n\n### Set Bios Password\nIf you would like to set the bios password you can run ```badfish``` with the ```--set-bios-password``` option and passing the new password with ```--new-password```. If a password is already set you must pass this with ```--old-password``` otherwise optional.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --set-bios-password --new-password new_pass --old-password old_pass\n```\n\n### Remove Bios Password\nIf you would like to remove the bios password you can run ```badfish``` with the ```--remove-bios-password``` option and passing the existing password with ```--old-password```.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --remove-bios-password --old-password old_pass\n```\n\n### List Network Interfaces\nFor getting a list of network interfaces with individual metadata for each you can run ```badfish``` with the ```--ls-interfaces``` option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --ls-interfaces\n```\n\n### List Memory\nFor getting a detailed list of memory devices you can run ```badfish``` with the ```--ls-memory``` option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --ls-memory\n```\n\n### List Processors\nFor getting a detailed list of processors you can run ```badfish``` with the ```--ls-processors``` option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --ls-processors\n```\n\n### List Serial Number or Service Tag\nFor getting the system's serial number or on Dell servers the service tag (equivalent to `racadm getsvctag`) you can run ```badfish``` with the ```--ls-serial``` option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --ls-serial\n```\n\n### Check Virtual Media\nIf you would like to check for any active virtual media you can run ```badfish``` with the ```--check-virtual-media``` option which query for all active virtual devices.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --check-virtual-media\n```\n\n### Mount Virtual Media\nIf you would like to mount an ISO from network you can run ```badfish``` with the ```--mount-virtual-media``` option which post a request for mounting the ISO virtual media (Virtual CD). Full address to the ISO is needed as an argument.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --mount-virtual-media http://storage.example.com/folder/linux.iso\n```\n\n### Unmount Virtual Media\nIf you would like to unmount all active virtual media you can run ```badfish``` with the ```--unmount-virtual-media``` option which post a request for unmounting all active virtual devices.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --unmount-virtual-media\n```\n\n### Boot to Virtual Media\nIf you would like to boot to virtual media (Virtual CD) you can run ```badfish``` with the ```--boot-to-virtual-media``` option which sets the onetime next boot device to virtual CD.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --boot-to-virtual-media\n```\n\n### Check Remote Image\nIf you would like to check the attach status of a remote ISO in DellOSDeployment service you can run ```badfish``` with the ```--check-remote-image``` option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --check-remote-image\n```\n\u003e [!NOTE]\n\u003e This is only supported on DELL devices.\n\n### Boot to Remote Image\nIf you would like to boot to a remote ISO on NFS with DellOSDeployment service you can run ```badfish``` with the ```--boot-remote-image``` option which will attach the image and reboot the server to it. Expects the NFS path to the ISO as the argument.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --boot-remote-image nfs-storage.example.com:/mnt/folder/linux.iso\n```\n\u003e [!NOTE]\n\u003e This is only supported on DELL devices.\n\n### Detach Remote Image\nIf you would like to detach an ISO from DellOSDeployment service you can run ```badfish``` with the ```--detach-remote-image``` option.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --detach-remote-image\n```\n\u003e [!NOTE]\n\u003e This is only supported on DELL devices.\n\n### Get SRIOV mode\nFor checking if the global SRIOV mode is enabled you can use ```--get-sriov```\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --get-sriov\n```\n\u003e [!NOTE]\n\u003e This is only supported on DELL devices.\n\n### Set SRIOV mode\nFor changing the mode of the SRIOV glabal BIOS attribute, we have included 2 new arguments.\nIn case the setting is in disabled mode, you can enable it by passing ```--enable-sriov```\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --enable-sriov\n```\nOn the contrary, if you would like to disable the SRIOV mode, you can now pass ```--disable-sriov```\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --disable-sriov\n```\n\u003e [!NOTE]\n\u003e This is only supported on DELL devices.\n\n### Get FQDDs for all nics\nTo get a list of all FQDDs for all NICs on the server you can run badfish with ```--get-nic-fqdds```.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --get-nic-fqdds\n```\n\n### Get NIC attributes\nTo get a list of all NIC attributes we can potentially modify (some might be set as read-only), you can run badfish with ```--get-nic-attribute``` passing the desired FQDD and this will return a list off all NIC attributes with their current value set.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --get-nic-attribute NIC.Integrated.1-1-1\n```\n\n### Set NIC attribute\n\u003e [!WARNING]\n\u003e This action will trigger a reboot of the server to apply the changes. Changes will be reflected after the reboot is completed.\n\nTo change the value of a NIC attribute you can use ```--set-nic-attribute``` with the desired FQDD, passing both ```--attribute``` and desired ```--value```.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --set-nic-attribute NIC.Integrated.1-1-1 --attribute LegacyBootProto --value PXE\n```\n\n### Get BIOS attributes\nTo get a list of all BIOS attributes we can potentially modify (some might be set as read-only), you can run badfish with ```--get-bios-attribute``` alone and this will return a list off all BIOS attributes with their current value set.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --get-bios-attribute\n```\n\n### Get specific BIOS attribute\nIn case you would like to get a more detailed view on the parameters for a BIOS attribute you can run ```--get-bios-attribute``` including the specific name of the attribute via ```--attribute```.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --get-bios-attribute --attribute ProcC1E\n```\n\n### Set BIOS attribute\nTo change the value of a bios attribute you can use ```--set-bios-attribute``` passing both ```--attribute``` and ```--value```.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --set-bios-attribute --attribute ProcC1E --value Enabled\n```\n\u003e [!NOTE]\n\u003e You can get the list of allowed values you can pass for that attribute by looking at the attribute details via ```--get-bios-attribute``` for that specific one.\n\n### Change between BIOS and UEFI modes\n* Building on the get/set bios attribute commands above here's how you can manage BIOS and UEFI modes on supported servers.\n\n\u003e [!NOTE]\n\u003e This is only supported on Dell devices.\n\n#### Querying bootmode\n* First determine what bootmode state your server is using before proceeding.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --get-bios-attribute --attribute BootMode\n```\n#### Setting UEFI mode\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --set-bios-attribute --attribute BootMode --value Uefi\n```\n### Setting BIOS mode\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --set-bios-attribute --attribute BootMode --value Bios\n```\n\n\u003e [!IMPORTANT]\n\u003e Like all batch-driven actions this takes a reboot and time to process so be patient.\n\u003e You should also give it time to process before checking result via `--get-bios-attribute --attribute BootMode` as it could be cached for a minute or two after processing.\n\n### Get server screenshot\nIf you would like to get a screenshot with the current state of the server you can now run badfish with ```--screenshot``` which will capture this and store it in the current directory in png format.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --screenshot\n```\n\n### Targets for server configuration profile\nIf you want to get a list of allowed targets for SCP export or import you can get that with the `--get-scp-targets` command, takes either `Export` or `Import` as an argument.\n```\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --get-scp-targets (Export | Import)\n```\n\u003e [!NOTE]\n\u003e This is only supported on Dell devices.\n\n\n### Export server configuration profile\nIf you would like to export a SCP as a JSON file for either some specific targets or all of them, you can run badfish with `--export-scp` and specify a path where the config should be saved to with its argument. Targets can be specified with `--scp-targets` flag that takes a comma separated list of targets as an argument. Read only arguments can be included with the `--scp-include-read-only` flag.\n```\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --export-scp \"./\" --scp-targets IDRAC,BIOS --scp-include-read-only\n```\n\u003e [!NOTE]\n\u003e This is only supported on Dell devices.\n\n### Import server configuration profile\nIf you would like to import a SCP in a JSON file for either some specific targets or all of them, you can run badfish with `--import-scp`. Targets can be specified with `--scp-targets` flag that takes a comma separated list of targets as an argument. Command will reboot the server and return it to a state at the launch start of import.\n```\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --import-scp \"./example_export.json\" --scp-targets IDRAC,BIOS\n```\n\u003e [!NOTE]\n\u003e This is only supported on Dell devices.\n\n### Bulk actions via text file with list of hosts\nIn the case you would like to execute a common badfish action on a list of hosts, you can pass the optional argument ```--host-list``` in place of ```-H``` with the path to a text file with the hosts you would like to action upon and any addtional arguments defining a common action for all these hosts.\n```bash\nbadfish --host-list /tmp/bad-hosts -u root -p yourpass --clear-jobs\n```\n\n### Verbose output\nIf you would like to see a more detailed output on console you can use the ```--verbose``` option and get a additional debug logs. \u003e [!NOTE] this is the default log level for the ```--log``` argument.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml -t foreman --verbose\n```\n\n### Log to file\nIf you would like to log the output of ```badfish``` you can use the ```--log``` option and pass the path to where you want ```badfish``` to log it's output to.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml -t foreman --log /tmp/bad.log\n```\n\n### Formatted output\nIf you would like to easier query some information listed by badfish, you can tell badfish to output in either JSON or YAML. Formatted output is also supported for bulk actions with `--host-list`. Supported commands that list some information are:\n- `--ls-*`\n- `--firmware-inventory`\n- `--get-bios-attribute` (also works with specified attribute by `--attribute` after)\n- `--check-boot`\n- `--check-virtual-media`\n- `--power-state`.\n```bash\nbadfish -H mgmt-your-server.example.com -u root -p yourpass --output json/yaml --firmware-inventory\n```\n\n## iDRAC and Data Format\n\n### Dell Foreman and PXE Interface\nYour usage may vary, this is what our configuration looks like via ```config/idrac_interfaces.yml```\n\n* Note that these are BIOS mode, EFI interfaces may be different and not yet recorded everywhere for our uses.\n\n| Machine Type | Network Interface      |\n| ------------ | ----------------------:|\n| Dell fc640   |  NIC.Integrated.1-1-1  |\n| Dell r620\t   |  NIC.Integrated.1-3-1  |\n| Dell r630    |  NIC.Slot.2-1-1        |\n| Dell r930    |  NIC.Integrated.1-3-1  |\n| Dell r720xd  |  NIC.Integrated.1-3-1  |\n| Dell r730xd  |  NIC.Integrated.1-3-1  |\n| Dell r740xd  |  NIC.Integrated.1-3-1  |\n| Dell r640    |  NIC.Integrated.1-1-1  |\n| Dell r650    |  NIC.Integrated.1-1-1  |\n| Dell r660    |  NIC.PxeDevice.1-1     |\n| Dell r750    |  NIC.Integrated.1-1-1  |\n\n### Host type overrides\nEvery other method that requires passing the `-i` argument, is going to parse the key strings from this and look for the most adequate candidate for the given FQDN.\nWe format the key strings with the following criteria:\n```\n{host_type}_[{rack}_[{ULocation}_[{blade}_]]]{model}_interfaces\n```\nAdditionally we can do a blade only override like:\n```\n{host_type}_[{blade}_]{model}_interfaces\n```\nWith rack, ULocation and blade being optional in a hierarchical fashion otherwise mandatory with the exception of the blade, as we can now use the blade independently from rack and ULocation. host_type and model values are always mandatory.\n\n#### Example for director type overrides:\n\n| Keys defined on interfaces yaml | FQDN | Use boot order |\n| :------------------------------ |:----:| --------------:|\n| director_r620_interfaces         | mgmt-f21-h17-000-r620.domain.com | NO             |\n| director_f21_r620_interfaces     | mgmt-f21-h17-000-r620.domain.com | NO             |\n| director_f21_h17_r620_interfaces | mgmt-f21-h17-000-r620.domain.com | YES            |\n\n| Keys defined on interfaces yaml | FQDN | Use boot order |\n| :------------------------------ |:----:| --------------:|\n| director_r620_interfaces         | mgmt-f21-h18-000-r620.domain.com | NO             |\n| director_f21_r620_interfaces     | mgmt-f21-h18-000-r620.domain.com | YES            |\n| director_f21_h17_r620_interfaces | mgmt-f21-h18-000-r620.domain.com | NO             |\n\n| Keys defined on interfaces yaml | FQDN | Use boot order |\n| :------------------------------ |:----:| --------------:|\n| director_r620_interfaces         | mgmt-f22-h17-000-r620.domain.com | YES            |\n| director_f21_r620_interfaces     | mgmt-f22-h17-000-r620.domain.com | NO             |\n| director_f21_h17_r620_interfaces | mgmt-f22-h17-000-r620.domain.com | NO             |\n\n## Contributing\n\nPlease refer to our contributing [guide](CONTRIBUTING.md).\n\n\n* Here is some useful documentation\n  - [Creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)\n  - [Keeping a cloned fork up to date](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork)\n\n## Contact\n\n* You can find us on IRC in `#badfish` (or `#quads`) on `irc.libera.chat` if you have questions or need help.\n* [Click here](https://https://web.libera.chat/?channels=#quads) to join in your browser.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-performance%2Fbadfish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-performance%2Fbadfish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-performance%2Fbadfish/lists"}