Badfish is now Containerized

You can now run Badfish very quickly and easily in a docker container.  There’s no need for Python libraries or git you simply need Docker installed.  This is useful for people on Mac OSX or Windows for example or older Linux distributions who may not have Python libraries required like python-requests or python-pyyaml.


Install Docker
First install Docker, we recommend using Docker CE as it’s a bit newer than the Docker that most Linux distributions ship and also available for Mac OSX and Windows.

sudo dnf config-manager --add-repo \
sudo dnf install docker-ce docker-ce-cli

Other platforms instructions and downloads are located below:

Run Badfish
Once Docker is running executing badfish is as simple as running the docker run command.  Note that you will want to pass –dns IP.ADDRESS of your DNS server if you’re using internal resources inside a VPN.

docker run --rm quads/badfish -h

Here are some examples below running common badfish commands, consult the documentation for more information and commands.

Collecting Firmware and Hardware Inventory
Below we can collect firmware and hardware information directly from the Redfish API.

docker run --rm --dns quads/badfish -H -u root -p calvin --firmware-inventory

You’ll see output below.

- INFO - Systems service: /redfish/v1/Systems/System.Embedded.1.
- INFO - Managers service: /redfish/v1/Managers/iDRAC.Embedded.1.
- INFO - Id: Installed-100170-15.0.28
- INFO - Name: Intel(R) Gigabit 4P X520/I350 rNDC - EC:F4:BB:C1:C6:8D
- INFO - Status: {'Health': 'OK', 'State': 'Enabled'}

Booting from a one-time PXE interface (Dell)
We often need to reprovision systems with Foreman, it’s easy to tell systems to try to PXE boot one time off a particular interface for Foreman to kickstart the host.

docker run --rm --dns quads/badfish -H -u root -p calvin --boot-to NIC.Integrated.1-3-1

Below you can see the type of progress while a Racadm job gets scheduled to perform a one-time boot.

- INFO - Systems service: /redfish/v1/Systems/System.Embedded.1.
- INFO - Managers service: /redfish/v1/Managers/iDRAC.Embedded.1.
- WARNING - Clearing job queue for job IDs: ['JID_518413628071'].
- INFO - Job queue for iDRAC successfully cleared.
- INFO - Status code 204 returned for POST command to reset iDRAC.
- INFO - iDRAC will now reset and be back online within a few minutes.
- INFO - Polling for host state: On
Polling: [> ] 0% - Host state: Down
Polling: [---->               ] 27% - Host state: Down
Polling: [------------------->] 100% - Host state: On  
- INFO     - Command passed to set BIOS attribute pending values.
- INFO     - POST command passed to create target config job.
- INFO     - JID_537922244032 job ID successfully created.
- INFO     - Command passed to check job status, code 200 returned.
- INFO     - Job id JID_537922244032 successfully scheduled.
- INFO     - Command passed to GracefulRestart server, code return is 204.
- INFO     - Polling for host state: Off
Polling: [--------------->    ] 80% - Host state: On  
Polling: [---------------->   ] 87% - Host state: On
Polling: [------------------> ] 93% - Host state: On  
- WARNING  - Unable to graceful shutdown the server, will perform forced shutdown now.
- INFO     - Command passed to ForceOff server, code return is 204.
Polling: [------------------->] 100% - Host state: Off
- INFO     - Command passed to On server, code return is 204.

Checking Network Interface Boot Order
You can check the boot interface order on Dells via the following:


docker run --rm --dns quads/badfish -H -u root -p calvin --check-boot


- INFO - Systems service: /redfish/v1/Systems/System.Embedded.1.
- INFO - Managers service: /redfish/v1/Managers/iDRAC.Embedded.1.
- INFO - Current boot order:
- INFO - 1: NIC.Integrated.1-3-1
- INFO - 2: HardDisk.List.1-1
- INFO - 3: NIC.Slot.2-4
- INFO - 4: NIC.Slot.2-1
- INFO - 5: NIC.Slot.2-2
- INFO - 6: NIC.Slot.2-3

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.