Skip to content

Commit 1e9298e

Browse files
committed
chore: remove new/reset/old password handling
* This is clumsy and very unlikely these values will be an env variable. * Nothing keeps people from securing it with a temporary export but it is not in scope for using stored env vars which tend to be static or change rarely and thus makes more sense to concentrate on for this feature.
1 parent 52f721b commit 1e9298e

File tree

3 files changed

+51
-74
lines changed

3 files changed

+51
-74
lines changed

README.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ curl https://raw.githubusercontent.com/redhat-performance/badfish/master/config
259259

260260
### Use Environment Variables for Secrets
261261
> [!IMPORTANT]
262-
> While you can pass `-u` and `-p` for user and password you should set environment variables instead.
262+
> While you can pass `-u` and `-p` for user and password env variables are more secure.
263263
>
264264
> `export BADFISH_USERNAME="my_username"`
265265
>
@@ -316,13 +316,13 @@ src/main.py --host-list /tmp/hosts -u root -p password -i config/idrac_interface
316316
### Forcing a one time boot to a specific device
317317
To 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.
318318
```bash
319-
badfish -H mgmt-your-server.example.com --boot-to NIC.Integrated.1-3-1
319+
badfish -H mgmt-your-server.example.com --boot-to NIC.Integrated.1-3-1
320320
```
321321

322322
### Forcing a one time boot to a specific mac address
323323
To 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.
324324
```bash
325-
badfish -H mgmt-your-server.example.com --boot-to-mac A9:BB:4B:50:CA:54
325+
badfish -H mgmt-your-server.example.com --boot-to-mac A9:BB:4B:50:CA:54
326326
```
327327

328328
### Forcing a one time boot to a specific type
@@ -344,25 +344,25 @@ badfish -H mgmt-your-server.example.com -i config/idrac_interfaces.yml --pxe
344344
### Rebooting a system
345345
In 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.
346346
```bash
347-
badfish -H mgmt-your-server.example.com --reboot-only
347+
badfish -H mgmt-your-server.example.com --reboot-only
348348
```
349349

350350
### Power cycling a system
351351
For 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.
352352
```bash
353-
badfish -H mgmt-your-server.example.com --power-cycle
353+
badfish -H mgmt-your-server.example.com --power-cycle
354354
```
355355

356356
### Power State Control
357357
You can also turn a server on or off by using options `--power-on` and `--power-off` respectively.
358358
```bash
359-
badfish -H mgmt-your-server.example.com --power-on
359+
badfish -H mgmt-your-server.example.com --power-on
360360
```
361361

362362
### Check Power State
363363
For checking the current power state of a server you can run badfish with the `--power-state` option.
364364
```bash
365-
badfish -H mgmt-your-server.example.com --power-state
365+
badfish -H mgmt-your-server.example.com --power-state
366366
```
367367
Partial Output:
368368
```
@@ -382,15 +382,15 @@ Partial Output:
382382
### Resetting iDRAC
383383
For 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.
384384
```bash
385-
badfish -H mgmt-your-server.example.com --racreset
385+
badfish -H mgmt-your-server.example.com --racreset
386386
```
387387
> [!NOTE]
388388
> Dell specific command, for Supermicro servers there is an equivalent of `--bmc-reset`
389389
390390
### Resetting BMC
391391
For 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.
392392
```bash
393-
badfish -H mgmt-your-server.example.com --bmc-reset
393+
badfish -H mgmt-your-server.example.com --bmc-reset
394394
```
395395
> [!NOTE]
396396
> Supermicro specific command, for Dell servers there is an equivalent of `--racreset`
@@ -401,7 +401,7 @@ badfish -H mgmt-your-server.example.com --bmc-reset
401401
402402
You can restore BIOS default settings by calling Badfish with the option `--factory-reset`.
403403
```bash
404-
badfish -H mgmt-your-server.example.com --factory-reset
404+
badfish -H mgmt-your-server.example.com --factory-reset
405405
```
406406

407407
### Check current boot order
@@ -413,7 +413,7 @@ badfish -H mgmt-your-server.example.com -i config/idrac_interfaces.yml --check-
413413
### Toggle boot device
414414
If 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.
415415
```bash
416-
badfish -H mgmt-your-server.example.com --toggle-boot-device NIC.Integrated.1-3-1```
416+
badfish -H mgmt-your-server.example.com --toggle-boot-device NIC.Integrated.1-3-1```
417417
```
418418

419419
### Variable number of retries
@@ -425,127 +425,127 @@ badfish -H mgmt-your-server.example.com -i config/idrac_interfaces.yml -t forem
425425
### Firmware inventory
426426
If 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.
427427
```bash
428-
badfish -H mgmt-your-server.example.com --firmware-inventory
428+
badfish -H mgmt-your-server.example.com --firmware-inventory
429429
```
430430

431431
### Delta of firmware inventories
432432
If 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.
433433
```bash
434-
badfish -H mgmt-your-server.example.com --firmware-inventory --delta mgmt-your-other-server.example.com
434+
badfish -H mgmt-your-server.example.com --firmware-inventory --delta mgmt-your-other-server.example.com
435435
```
436436
437437
### Clear Job Queue
438438
If 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.
439439
```bash
440-
badfish -H mgmt-your-server.example.com --clear-jobs
440+
badfish -H mgmt-your-server.example.com --clear-jobs
441441
```
442442
443443
You can also force the clearing of Dell iDRAC job queues by passing the `--force` option.
444444
445445
```bash
446-
badfish -H mgmt-your-server.example.com --clear-jobs --force
446+
badfish -H mgmt-your-server.example.com --clear-jobs --force
447447
```
448448
449449
### List Job Queue
450450
If 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.
451451
```bash
452-
badfish -H mgmt-your-server.example.com --ls-jobs
452+
badfish -H mgmt-your-server.example.com --ls-jobs
453453
```
454454
455455
### Check Job Status
456456
If 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.
457457
```bash
458-
badfish -H mgmt-your-server.example.com --check-job JID_340568202796
458+
badfish -H mgmt-your-server.example.com --check-job JID_340568202796
459459
```
460460
461461
### Set Bios Password
462462
If 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.
463463
```bash
464-
badfish -H mgmt-your-server.example.com --set-bios-password --new-password new_pass --old-password old_pass
464+
badfish -H mgmt-your-server.example.com -u root --set-bios-password --new-password new_pass --old-password old_pass
465465
```
466466
467467
### Remove Bios Password
468468
If 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```.
469469
```bash
470-
badfish -H mgmt-your-server.example.com --remove-bios-password --old-password old_pass
470+
badfish -H mgmt-your-server.example.com -u root --remove-bios-password --old-password old_pass
471471
```
472472
473473
### List Network Interfaces
474474
For getting a list of network interfaces with individual metadata for each you can run ```badfish``` with the ```--ls-interfaces``` option.
475475
```bash
476-
badfish -H mgmt-your-server.example.com --ls-interfaces
476+
badfish -H mgmt-your-server.example.com --ls-interfaces
477477
```
478478
479479
### List Memory
480480
For getting a detailed list of memory devices you can run ```badfish``` with the ```--ls-memory``` option.
481481
```bash
482-
badfish -H mgmt-your-server.example.com --ls-memory
482+
badfish -H mgmt-your-server.example.com --ls-memory
483483
```
484484
485485
### List Processors
486486
For getting a detailed list of processors you can run ```badfish``` with the ```--ls-processors``` option.
487487
```bash
488-
badfish -H mgmt-your-server.example.com --ls-processors
488+
badfish -H mgmt-your-server.example.com --ls-processors
489489
```
490490
491491
### List Serial Number or Service Tag
492492
For 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.
493493
```bash
494-
badfish -H mgmt-your-server.example.com --ls-serial
494+
badfish -H mgmt-your-server.example.com --ls-serial
495495
```
496496

497497
### Check Virtual Media
498498
If 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.
499499
```bash
500-
badfish -H mgmt-your-server.example.com --check-virtual-media
500+
badfish -H mgmt-your-server.example.com --check-virtual-media
501501
```
502502

503503
### Mount Virtual Media
504504
If 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.
505505
```bash
506-
badfish -H mgmt-your-server.example.com --mount-virtual-media http://storage.example.com/folder/linux.iso
506+
badfish -H mgmt-your-server.example.com --mount-virtual-media http://storage.example.com/folder/linux.iso
507507
```
508508

509509
### Unmount Virtual Media
510510
If 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.
511511
```bash
512-
badfish -H mgmt-your-server.example.com --unmount-virtual-media
512+
badfish -H mgmt-your-server.example.com --unmount-virtual-media
513513
```
514514

515515
### Boot to Virtual Media
516516
If 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.
517517
```bash
518-
badfish -H mgmt-your-server.example.com --boot-to-virtual-media
518+
badfish -H mgmt-your-server.example.com --boot-to-virtual-media
519519
```
520520

521521
### Check Remote Image
522522
If 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.
523523
```bash
524-
badfish -H mgmt-your-server.example.com --check-remote-image
524+
badfish -H mgmt-your-server.example.com --check-remote-image
525525
```
526526
> [!NOTE]
527527
> This is only supported on DELL devices.
528528

529529
### Boot to Remote Image
530530
If 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.
531531
```bash
532-
badfish -H mgmt-your-server.example.com --boot-remote-image nfs-storage.example.com:/mnt/folder/linux.iso
532+
badfish -H mgmt-your-server.example.com --boot-remote-image nfs-storage.example.com:/mnt/folder/linux.iso
533533
```
534534
> [!NOTE]
535535
> This is only supported on DELL devices.
536536

537537
### Detach Remote Image
538538
If you would like to detach an ISO from DellOSDeployment service you can run ```badfish``` with the ```--detach-remote-image``` option.
539539
```bash
540-
badfish -H mgmt-your-server.example.com --detach-remote-image
540+
badfish -H mgmt-your-server.example.com --detach-remote-image
541541
```
542542
> [!NOTE]
543543
> This is only supported on DELL devices.
544544

545545
### Get SRIOV mode
546546
For checking if the global SRIOV mode is enabled you can use ```--get-sriov```
547547
```bash
548-
badfish -H mgmt-your-server.example.com --get-sriov
548+
badfish -H mgmt-your-server.example.com --get-sriov
549549
```
550550
> [!NOTE]
551551
> This is only supported on DELL devices.
@@ -554,25 +554,25 @@ badfish -H mgmt-your-server.example.com --get-sriov
554554
For changing the mode of the SRIOV glabal BIOS attribute, we have included 2 new arguments.
555555
In case the setting is in disabled mode, you can enable it by passing ```--enable-sriov```
556556
```bash
557-
badfish -H mgmt-your-server.example.com --enable-sriov
557+
badfish -H mgmt-your-server.example.com --enable-sriov
558558
```
559559
On the contrary, if you would like to disable the SRIOV mode, you can now pass ```--disable-sriov```
560560
```bash
561-
badfish -H mgmt-your-server.example.com --disable-sriov
561+
badfish -H mgmt-your-server.example.com --disable-sriov
562562
```
563563
> [!NOTE]
564564
> This is only supported on DELL devices.
565565

566566
### Get FQDDs for all nics
567567
To get a list of all FQDDs for all NICs on the server you can run badfish with ```--get-nic-fqdds```.
568568
```bash
569-
badfish -H mgmt-your-server.example.com --get-nic-fqdds
569+
badfish -H mgmt-your-server.example.com --get-nic-fqdds
570570
```
571571

572572
### Get NIC attributes
573573
To 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.
574574
```bash
575-
badfish -H mgmt-your-server.example.com --get-nic-attribute NIC.Integrated.1-1-1
575+
badfish -H mgmt-your-server.example.com --get-nic-attribute NIC.Integrated.1-1-1
576576
```
577577

578578
### Set NIC attribute
@@ -581,25 +581,25 @@ badfish -H mgmt-your-server.example.com --get-nic-attribute NIC.Integrated.1-1-
581581

582582
To change the value of a NIC attribute you can use ```--set-nic-attribute``` with the desired FQDD, passing both ```--attribute``` and desired ```--value```.
583583
```bash
584-
badfish -H mgmt-your-server.example.com --set-nic-attribute NIC.Integrated.1-1-1 --attribute LegacyBootProto --value PXE
584+
badfish -H mgmt-your-server.example.com --set-nic-attribute NIC.Integrated.1-1-1 --attribute LegacyBootProto --value PXE
585585
```
586586

587587
### Get BIOS attributes
588588
To 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.
589589
```bash
590-
badfish -H mgmt-your-server.example.com --get-bios-attribute
590+
badfish -H mgmt-your-server.example.com --get-bios-attribute
591591
```
592592

593593
### Get specific BIOS attribute
594594
In 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```.
595595
```bash
596-
badfish -H mgmt-your-server.example.com --get-bios-attribute --attribute ProcC1E
596+
badfish -H mgmt-your-server.example.com --get-bios-attribute --attribute ProcC1E
597597
```
598598

599599
### Set BIOS attribute
600600
To change the value of a bios attribute you can use ```--set-bios-attribute``` passing both ```--attribute``` and ```--value```.
601601
```bash
602-
badfish -H mgmt-your-server.example.com --set-bios-attribute --attribute ProcC1E --value Enabled
602+
badfish -H mgmt-your-server.example.com --set-bios-attribute --attribute ProcC1E --value Enabled
603603
```
604604
> [!NOTE]
605605
> 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.
@@ -613,15 +613,15 @@ badfish -H mgmt-your-server.example.com --set-bios-attribute --attribute ProcC1
613613
#### Querying bootmode
614614
* First determine what bootmode state your server is using before proceeding.
615615
```bash
616-
badfish -H mgmt-your-server.example.com --get-bios-attribute --attribute BootMode
616+
badfish -H mgmt-your-server.example.com --get-bios-attribute --attribute BootMode
617617
```
618618
#### Setting UEFI mode
619619
```bash
620-
badfish -H mgmt-your-server.example.com --set-bios-attribute --attribute BootMode --value Uefi
620+
badfish -H mgmt-your-server.example.com --set-bios-attribute --attribute BootMode --value Uefi
621621
```
622622
### Setting BIOS mode
623623
```bash
624-
badfish -H mgmt-your-server.example.com --set-bios-attribute --attribute BootMode --value Bios
624+
badfish -H mgmt-your-server.example.com --set-bios-attribute --attribute BootMode --value Bios
625625
```
626626
627627
> [!IMPORTANT]
@@ -631,13 +631,13 @@ badfish -H mgmt-your-server.example.com --set-bios-attribute --attribute BootMo
631631
### Get server screenshot
632632
If 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.
633633
```bash
634-
badfish -H mgmt-your-server.example.com --screenshot
634+
badfish -H mgmt-your-server.example.com --screenshot
635635
```
636636
637637
### Targets for server configuration profile
638638
If 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.
639639
```
640-
badfish -H mgmt-your-server.example.com --get-scp-targets (Export | Import)
640+
badfish -H mgmt-your-server.example.com --get-scp-targets (Export | Import)
641641
```
642642
> [!NOTE]
643643
> This is only supported on Dell devices.
@@ -646,23 +646,23 @@ badfish -H mgmt-your-server.example.com --get-scp-targets (Export | Import)
646646
### Export server configuration profile
647647
If 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.
648648
```
649-
badfish -H mgmt-your-server.example.com --export-scp "./" --scp-targets IDRAC,BIOS --scp-include-read-only
649+
badfish -H mgmt-your-server.example.com --export-scp "./" --scp-targets IDRAC,BIOS --scp-include-read-only
650650
```
651651
> [!NOTE]
652652
> This is only supported on Dell devices.
653653
654654
### Import server configuration profile
655655
If 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.
656656
```
657-
badfish -H mgmt-your-server.example.com --import-scp "./example_export.json" --scp-targets IDRAC,BIOS
657+
badfish -H mgmt-your-server.example.com --import-scp "./example_export.json" --scp-targets IDRAC,BIOS
658658
```
659659
> [!NOTE]
660660
> This is only supported on Dell devices.
661661
662662
### Bulk actions via text file with list of hosts
663663
In 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.
664664
```bash
665-
badfish --host-list /tmp/bad-hosts --clear-jobs
665+
badfish --host-list /tmp/bad-hosts --clear-jobs
666666
```
667667
668668
### Verbose output
@@ -686,7 +686,7 @@ If you would like to easier query some information listed by badfish, you can te
686686
- `--check-virtual-media`
687687
- `--power-state`.
688688
```bash
689-
badfish -H mgmt-your-server.example.com --output json/yaml --firmware-inventory
689+
badfish -H mgmt-your-server.example.com --output json/yaml --firmware-inventory
690690
```
691691

692692
## iDRAC and Data Format

0 commit comments

Comments
 (0)