Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In order to deploy a new virtual machine, we need at least 5 parameters, however, in case of deploying a vm from image, there's a 6th parameter:

  • bill_dept client = DepartmentName
  • built_from = Image
  • description = Testing image deployment
  • folder
  • os
  • source_image

...

So far, we've got the following parameters ready to deploy a new vm:

  • bill_dept client = DepartmentName
  • built_from = Image
  • description = Testing image deployment
  • folder = group-6666
  • os = ubuntu64Guest
  • source_image = Ubuntu_64-bit-vmx10.ova
  • networks = dvportgroup-92

However, according to the API documentation, the payload sent via a POST request to the /v2/vm endpoint needs to be sent in JSON format.

Code Block
languagepy
{"bill_deptclient": "DepartmentName",
 "built_from": "image",
 "description": "Testing image deployment",
 "folder": "group-6666",
 "os": "ubuntu64Guest",
 "source_image": "Ubuntu_64-bit-vmx10.ova",
 "networks": [{"network": "dvportgroup-92"}],
 "disks": [40, 40]}

...

Code Block
titleCURL Request
curl -H "Authorization: Bearer $TK" -X POST -H "Content-Type: application/json" https://vss-api.eis.utoronto.ca:8001/v2/vm -d {"bill_deptclient": "DepartmentName", "built_from": "image", "description": "Testing image deployment", "folder": "group-6666", "os": "ubuntu64Guest", "source_image": "Ubuntu_64-bit-vmx10.ova", "networks": [{"network": "dvportgroup-92"}], "disks": [40, 40]}

...

Code Block
titleHTTPie Request
http POST "https://vss-api.eis.utoronto.ca:8001/v2/vm bill_deptclient=DepartmentName" "Authorization: Bearer $TK" built_from=image description="Testing image deployment" folder="group-6666" os="ubuntu64Guest" source_image="Ubuntu_64-bit-vmx10.ova" networks:='[{"network": "dvportgroup-92"}]' disks:='[40, 40]'

...