Skip to content
Permalink
Browse files

Merge pull request #50 from redhat-performance/development

fix: better error messages for check-boot on non-supported
  • Loading branch information...
sadsfae committed Oct 7, 2019
2 parents d3a7174 + 09ecddc commit 4c74e8d054ec46cb8e18579b7c2a8b6a692c2261
Showing with 14 additions and 0 deletions.
  1. +9 −0 README.md
  2. +5 −0 badfish.py
@@ -13,6 +13,7 @@
* [Enforcing an OpenStack Director-style interface order](#enforcing-an-openstack-director-style-interface-order)
* [Enforcing a Foreman-style interface order](#enforcing-a-foreman-style-interface-order)
* [Forcing a one time boot to a specific device](#forcing-a-one-time-boot-to-a-specific-device)
* [Forcing a one time boot to a specific type](#forcing-a-one-time-boot-to-a-specific-type)
* [Forcing a one-time boot to PXE](#forcing-a-one-time-boot-to-pxe)
* [Rebooting a System](#rebooting-a-system)
* [Power Cycling a System](#power-cycling-a-system)
@@ -97,6 +98,14 @@ To force systems to perform a one-time boot to a specific device you can use the

* 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 a specific type
To force systems to perform a one-time boot to a specific type you can use the ```--boot-to-type``` option and pass as an argument the device type of either foreman or director 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.
```
./badfish.py -H mgmt-your-server.example.com -u root -p yourpass -i config/idrac_interfaces.yml --boot-to-type foreman
```

* 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.
```
@@ -144,6 +144,11 @@ def get_boot_devices(self):
_uri = "%s%s/BootSources" % (self.host_uri, self.system_resource)
_response = self.get_request(_uri)

if _response.status_code == 404:
self.logger.debug(_response.text)
self.logger.error("Boot order modification is not supported by this host.")
sys.exit(1)

data = _response.json()
if "Attributes" in data:
return data[u"Attributes"][_boot_seq]

0 comments on commit 4c74e8d

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