redhat-performance / badfish

Vendor-agnostic tool for managing bare-metal systems via the Redfish API
https://quads.dev
GNU General Public License v3.0
93 stars 26 forks source link

--host-list not working #57

Closed bengland2 closed 4 years ago

bengland2 commented 4 years ago

Your System Details

Lenovo ThinkPad T470 [bengland@localhost upi]$ podman images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/quads/badfish latest 6c3ff7c5d8f3 12 days ago 142 MB

Describe the bug --host-list parameter does not work, always gets this:

[bengland@localhost upi]$ podman run -it --rm quads/badfish \
  --host-list /home/bengland/openshift/upi/masters.list \
  -u quads -p 502328 -i config/idrac_interfaces.yml --check-boot
- ERROR    - There was something wrong reading from /home/bengland/openshift/upi/masters.list
[bengland@localhost upi]$ cat /home/bengland/openshift/upi/masters.list
mgmt-e26-h03-740xd
mgmt-e26-h05-740xd
mgmt-e26-h07-740xd

However, if I drop --host-list masters.list and substitute a -H hostname, it works.

[bengland@localhost upi]$ podman run -it --rm quads/badfish -H mgmt-e26-h03-740xd -u quads -p 502328 -i config/idrac_interfaces.yml --check-boot
- INFO     - Systems service: /redfish/v1/Systems/System.Embedded.1.
- INFO     - Managers service: /redfish/v1/Managers/iDRAC.Embedded.1.
- WARNING  - Current boot order does not match any of the given.
- INFO     - Current boot order:
- INFO     - 1: NIC.Integrated.1-1-1
- INFO     - 2: NIC.Integrated.1-3-1
- INFO     - 3: NIC.Slot.7-1-1
- INFO     - 4: NIC.Slot.7-2-1
- INFO     - 5: NIC.Integrated.1-2-1
- INFO     - 6: NIC.Integrated.1-4-1
- INFO     - 7: HardDisk.List.1-1

If this is not the correct format for the list, what is? Documentation doesn't say.

Expected Behavior It should perform the requested action for each host in the input host list, or say why it couldn't.

I can workaround by doing 1 host at a time, but would be nice to have this feature.

grafuls commented 4 years ago

You are pointing to a file on your localhost which is not mounted inside the container. You can run podman linking the file to a volume like: podman run -it --rm -v /home/bengland/openshift/upi/masters.list:/masters.list quads/badfish --host-list /masters.list -u {USER} -p {PASS} -i config/idrac_interfaces.yml --check-boot

grafuls commented 4 years ago

Reopening this to display a more appropriate error message on non existing file.

bengland2 commented 4 years ago

Thanks @grafuls

bengland2 commented 4 years ago

another option is to just pass a list of hostnames (separated by commas for example) in the CLI using the -H option, then you don't have to worry about whether the file exists or not. I should have thought of the reason for file not found though. Maybe you could document the use of -v option when passing --host-list?

bengland2 commented 4 years ago

This can be closed, I use --host-list all the time now, I've updated ocp4_upi_baremetal documentation to get rid of unnecessary scripting on top of badfish and just use this feature instead!