Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/redhat-performance/badfish

…into development
  • Loading branch information...
grafuls committed Jul 26, 2019
2 parents 25134be + 3ddd994 commit 1157c0c74c4971aa9b8764dabf017a9e80e86883
Showing with 30 additions and 19 deletions.
  1. +11 −6 README.md
  2. +7 −1 badfish.py
  3. +12 −12 config/idrac_interfaces.yml
@@ -29,13 +29,16 @@
* [Dell Foreman and PXE Interface](#dell-foreman-and-pxe-interface)

# Badfish
Badfish is a Redfish-based API tool for managing bare-metal systems via the Redfish API
Badfish is a Redfish-based API tool for managing bare-metal systems via the [Redfish API](https://www.dmtf.org/standards/redfish)

We will be adding support for a plethora of SuperMicro systems also in the near future.

You can read more [about badfish](https://quads.dev/about-badfish/) at the [QUADS](https://quads.dev/) website.

## Scope
Right now Badfish is focused on managing Dell systems, but can potentially work
with any system that supports the Redfish API.
Right now Badfish is focused on managing Dell systems, but can potentially work with any system that supports the Redfish API.

We'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/) deployments while simultaneously allowing easy management and provisioning of those same systems via [The Foreman](https://theforeman.org/).
We'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/) 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.

## Features
* Toggle and save a persistent interface/device boot order on remote systems
@@ -52,7 +55,7 @@ We're mostly concentrated on programmatically enforcing interface/device boot or

## Requirements
* iDRAC7,8 or newer
* Firmware version ```2.60.60.60```
* Firmware version ```2.60.60.60``` or higher
* iDRAC administrative account

## Usage
@@ -87,11 +90,13 @@ Foreman and Red Hat Satellite (as of 6.x based on Foreman) require managed syste
```

### Forcing a one time boot to a specific device
To force systems to perform a one-time boot to a specific device 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 automatically reboot the host after changes are applied.
To force systems to perform a one-time boot to a specific device 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.
```
./badfish.py -H mgmt-your-server.example.com -u root -p yourpass --boot-to NIC.Integrated.1-3-1
```

* Note: this will occur on the next reboot of the system, this command just stages a one-time boot.

### Forcing a one-time boot to PXE
To 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.
```
@@ -204,6 +204,8 @@ def get_host_type(self, _interfaces_path):
sys.exit(1)

host_model = self.host.split(".")[0].split("-")[-1]
if host_model.startswith("r"):
host_model = host_model[1:]
interfaces = {}
for _host in ["foreman", "director"]:
match = True
@@ -299,7 +301,7 @@ def change_boot(self, host_type, interfaces_path, pxe=False):
sys.exit(1)

_type = self.get_host_type(interfaces_path)
if _type and _type.lower() != host_type.lower():
if (_type and _type.lower() != host_type.lower()) or not _type:
self.clear_job_queue()
self.logger.warning("Waiting for host to be up.")
host_up = self.polling_host_state("On")
@@ -333,6 +335,8 @@ def change_boot_order(self, _interfaces_path, _host_type):
sys.exit(1)

host_model = self.host.split(".")[0].split("-")[-1]
if host_model.startswith("r"):
host_model = host_model[1:]
interfaces = definitions["%s_%s_interfaces" % (_host_type, host_model)].split(",")

boot_devices = self.get_boot_devices()
@@ -723,6 +727,8 @@ def get_host_type_boot_device(self, host_type, _interfaces_path):
sys.exit(1)

host_model = self.host.split(".")[0].split("-")[-1]
if host_model.startswith("r"):
host_model = host_model[1:]
return definitions["%s_%s_interfaces" % (host_type, host_model)].split(",")[0]
return None

@@ -4,15 +4,15 @@
# to server type mappings here
#
#
director_r620_interfaces: NIC.Slot.2-4,HardDisk.List.1-1,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3,NIC.Integrated.1-3-1
director_r630_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Slot.2-1-1
director_r720xd_interfaces: NIC.Slot.4-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
director_r730xd_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
director_r740xd_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
director_r930_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
foreman_r620_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Slot.2-4,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3
foreman_r630_interfaces: NIC.Slot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-2-1
foreman_r720xd_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Slot.4-2-1
foreman_r730xd_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Integrated.1-2-1
foreman_r740xd_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
foreman_r930_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Integrated.1-2-1
director_620_interfaces: NIC.Slot.2-4,HardDisk.List.1-1,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3,NIC.Integrated.1-3-1
director_630_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Slot.2-1-1
director_720xd_interfaces: NIC.Slot.4-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
director_730xd_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
director_740xd_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
director_930_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
foreman_620_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Slot.2-4,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Slot.2-3
foreman_630_interfaces: NIC.Slot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-2-1
foreman_720xd_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Slot.4-2-1
foreman_730xd_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Integrated.1-2-1
foreman_740xd_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
foreman_930_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Integrated.1-2-1

0 comments on commit 1157c0c

Please sign in to comment.
You can’t perform that action at this time.