Dedicated Servers - API, netboot with ipxeCustomerScript doesn't netboot
... / API, netboot with ipxeCus...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

API, netboot with ipxeCustomerScript doesn't netboot

Von
JoeB
Erstellungsdatum 2021-08-10 22:17:30 (edited on 2024-09-04 14:26:08) in Dedicated Servers

Not sure am I missing something, but I do following Python code:
```
try:
result = client.delete("/me/ipxeScript/ubuntu-2004-test")
except ResourceNotFoundError as e:
pass
with open("ipxe.cmd", "r") as fh:
script_content = fh.read()
if not script_content:
raise Exception("unable to read script content")
result = client.post("/me/ipxeScript",
description = "Testing script for Ubuntu 20.04",
name = "ubuntu-2004-test",
script = script_content,
)
name = "example.ip-12-34-56.eu"
result = client.get("/dedicated/server/{}/boot".format(name),
bootType="ipxeCustomerScript"
)
for boot_id in result:
result = client.get("/dedicated/server/{}/boot/{}".format(name, boot_id))
print(json.dumps(result, indent=2, sort_keys=True))
if result.get("kernel") == "ubuntu-2004-test":
print("Tatget boot ID: {}".format(result.get("bootId")))
target_boot_id = result.get("bootId")
if target_boot_id:
result = client.put("/dedicated/server/{}".format(name), bootId=target_boot_id)
result = client.get("/dedicated/server/{}".format(name))
print(json.dumps(result, indent=2, sort_keys=True))
```
(this is copy pasted ad-hoc, there may be some python errors, but FULL script works here)

above code gives output:
```
Tatget boot ID: 21821
{
"bootId": 21821,
...
```

but when I reboot the server it doesn't do iPXE. When I reboot the server and during POST screen I press F11 for boot menu (IPMI remote console) and I select iPXE it works and installation via custom iPXE script starts. I can see my custom iPXE script works as I have couple of echos and sleep in me `#!ipxe` script and I can see them on IPMI remote glass console.

Not sure how to force netboot via API into my `ipxeCustomerScript` script without a need to press F11 via IPMI remote console.

Any tips?

Regards.


Antworten sind derzeit für diese Frage deaktiviert.