add qcow2 and vmdk boot images

This commit is contained in:
Mikaël Cluseau
2025-06-12 11:53:08 +02:00
parent 1871eac7bb
commit 58cfaa7d0f
5 changed files with 72 additions and 10 deletions

View File

@ -54,6 +54,13 @@ func (ws wsHost) register(rws *restful.WebService, alterRB func(*restful.RouteBu
Produces(mime.DISK + "+lz4").
Doc("Get the " + ws.hostDoc + "'s boot disk image (lz4 compressed)"),
b("boot.qcow2").
Produces(mime.DISK + "+qcow2").
Doc("Get the " + ws.hostDoc + "'s boot disk image (qcow2)"),
b("boot.vmdk").
Produces(mime.DISK + "+vmdk").
Doc("Get the " + ws.hostDoc + "'s boot disk image (VMDK)"),
// metal/local HDD upgrades
b("boot.tar").
Produces(mime.TAR).
@ -186,6 +193,10 @@ func renderHost(w http.ResponseWriter, r *http.Request, what string, host *local
err = renderCtx(w, r, ctx, what, buildBootImgGZ)
case "boot.img.lz4":
err = renderCtx(w, r, ctx, what, buildBootImgLZ4)
case "boot.qcow2":
err = renderCtx(w, r, ctx, what, buildBootQcow2)
case "boot.vmdk":
err = renderCtx(w, r, ctx, what, buildBootVmdk)
default:
http.NotFound(w, r)