Hi there,
I was given the task of managing vm-clients via the api of an existing maas installation (version 3.5.8).
Unfortunately I can’t set the initial storage of a machine by using the official JSON parameters. My curl call looks like this:
response=$(curl -H “$AUTH_HEADER” -H “Accept: application/json” “$MAAS_API_URL/vm-hosts/$host_id/op-compose”
-X POST
-F “cores=$CORES”
-F “memory=$MEMORY”
-F “architecture=$ARCH”
-F “storage=$STORAGE”
-s)
where $STORAGE is “root:50G(default),additional:50G(default)”
The calls returns this error message:
{“storage”: [“Malformed storage constraint, "root:50G(default),additional:50G(default)".”]}
I tried every suggested syntax I could think of (only 1 harddisk, square brackets instead of round brackets, no pool tag etc.)
The maas api documentation points to the cli part of the document which points to itself for more details - which is rather pointless:
API doc (MAAS API):
storage (string): Optional. A list of storage constraint identifiers in the form label:size(tag,tag,.), label:size(tag,tag,.). For more information please see the CLI VM host management page of the official MAAS documentation.
CLI Doc (https://canonical.com/maas/docs/vm-host)
Keyword “storage”
Optional String. A list of storage constraint identifiers in the form label:size(tag,tag,), label:size(tag,tag,). For more information please see the CLI VM host management page of the official MAAS documentation.
Has anyone successfully commissioned a VM client with a custom storage size via the MAAS API?