triton icon indicating copy to clipboard operation
triton copied to clipboard

VMAPI LX Branded Zone JSON Error and Documentation

Open kriss9 opened this issue 8 years ago • 2 comments

Currently, when issuing a command to Triton via VMAPI to create a LX branded zone, the POST fails with the following error:

[root@headnode (dc1) /zones/data]# curl -H "Content-Type: application/json" -X POST -d @test.json.lx 10.99.99.27:80/vms
curl: (52) Empty reply from server

[root@headnode (dc1) /zones/data]# cat test.json.lx
{
	"owner_uuid": "930896af-bf8c-48d4-885c-6573a94b1853",
	"image_uuid": "32de63f8-8b6f-11e6-beb6-b3e46c186cc2",
	"brand": "lx",
	"ram": 128,
	"networks": ["dcaad9b7-0c1d-49d6-84d9-e65ad202d6ef"],
	"billing_id":"4462b657-1938-cf89-8ef9-8cf6e6716213"
}

Creating an OS VM with similar specified parameters works well.

See https://gist.github.com/kriss9/8534033c9ed2179bea807816312f680c

This request is to

  1. Determine correct format for creating LX branded zones via VMAPI (documentation needed) [primary]

  2. Recommend improved documentation [optional] For OS machines, LX-branded zones and KVM, a quick getting started with an example command and insights on sources for required inputs (e.g. billing_uuid, owner_uuid), would allow new API users to ramp up quickly.

  3. Recommend JSON equivalence across VMADM/VMAPI [optional] While this may have been considered, being able to specify the same JSON for vmadm as vmapi would create for a much easier transition in using vmapi. Considerations for error messages based on each variable presented in vmadm create JSON (e.g. nics vs networks) would allow users to ramp up quickly.

kriss9 avatar Aug 19 '17 21:08 kriss9

You should use AdminUI or CloudAPI to create instances. It's not recommended to create them directly via vmapi.

Nevertheless, to see the correct format, create an instance via cloudapi or adminui and then inspect the provision job.

bahamat avatar Oct 13 '17 17:10 bahamat

Thanks for the response/insights. This may be helpful, currently the docs suggest developing and/or integrating with vmapi is a desired goal. An update to the docs with a reference to the other APIs and a link to their documentation may make it easier to develop in the environment.

kriss9 avatar Oct 14 '17 14:10 kriss9