feat: add DNS setup blueprint and infrastructure automation scripts
This commit is contained in:
51
scripts/apply_bios_tuning.py
Normal file
51
scripts/apply_bios_tuning.py
Normal file
@@ -0,0 +1,51 @@
|
||||
import paramiko
|
||||
import time
|
||||
|
||||
targets = [
|
||||
{
|
||||
"name": "Node 1 (140.44.44.121)",
|
||||
"ip": "140.44.44.121",
|
||||
"settings": [
|
||||
("bios.IntegratedDevices.SriovGlobalEnable", "Enabled")
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Node 4 (140.44.44.124)",
|
||||
"ip": "140.44.44.124",
|
||||
"settings": [
|
||||
("bios.SysProfileSettings.SysProfile", "PerfOptimized")
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
for t in targets:
|
||||
print(f"\n==========================================")
|
||||
print(f"Applying BIOS settings to {t['name']}...")
|
||||
try:
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect(t['ip'], username='root', password='Katzir476!', timeout=15)
|
||||
|
||||
for key, val in t['settings']:
|
||||
cmd = f"racadm set {key} {val}"
|
||||
stdin, stdout, stderr = c.exec_command(cmd)
|
||||
out = stdout.read().decode().strip()
|
||||
print(f" racadm set {key} {val}:\n {out}")
|
||||
time.sleep(1)
|
||||
|
||||
# Create BIOS job
|
||||
stdin, stdout, stderr = c.exec_command("racadm jobqueue create BIOS.Setup.1-1")
|
||||
job_out = stdout.read().decode().strip()
|
||||
print(f" racadm jobqueue create BIOS.Setup.1-1:\n {job_out}")
|
||||
|
||||
# View job queue
|
||||
stdin, stdout, stderr = c.exec_command("racadm jobqueue view")
|
||||
q_out = stdout.read().decode().strip()
|
||||
print(f" Job Queue:\n {q_out[:200]}")
|
||||
|
||||
c.close()
|
||||
except Exception as e:
|
||||
print(f" Error on {t['name']}: {e}")
|
||||
|
||||
print("\nDone applying BIOS settings!")
|
||||
|
||||
Reference in New Issue
Block a user