Versions Compared

Key

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


Introduction

By sending requests to the Virtual Machine endpoint /v2/vm you can list, create, update or delete VMs. The Virtual Machine endpoint has the following methods available:

ResourceURIDescriptionGETPOSTPUTDELETE
Virtual Machine/vmVirtual Machine management resource. Read, update, delete, create virtual machines.(tick)(tick)(tick)(tick)


Note
titleOPTIONS HTTP method

Remember, you can also show what methods are allowed and method description, parameters, etc. by making a GET HTTP request to /v2/vm.

Code Block
languagebash
http OPTIONS "https://vss-api.eis.utoronto.ca:8001/v2/vm"
curl -X OPTIONS "https://vss-api.eis.utoronto.ca:8001/v2/vm"




Panel

On this page:

Table of Contents
outlinetrue


Create

Single Virtual Machine

To create a new Virtual Machine, send a POST request to /v2/vm. The attribute values that must be set to successfully create a Virtual Machine are marked with a (tick) in the following table:

AttributeDescriptionTypeRef URIOptionsDefaultRequired
admin_emailAdministrator's emailstring--User's email number submitting the request
 
-
admin_nameAdministrator's namestring--User's name number submitting the request
 
-
admin_phoneAdministrator's phone numberstring--User's phone number submitting the request
 
-
bill_dept
client
Billing
Client Departmentstring---(tick)
built_from

Build process. If you are installing OS from scratch use os_install.

Clone when deploying a VM from a running or powered off virtual Machine.

Template gives the ability to deploy multiple VMs at the same time.

string-

os_install

clone

template

image

contentlib

-(tick)
cpu

CPU count and core per sockets:

Code Block
{
 "count": 4,
 "cpu_per_socket": 2
}


Note

Refer to Setting the number of cores per CPU (https://kb.vmware.com/s/article/1010184) when setting cores per socket.


integer or object--

{"count": 1

 

, "cpu_per_socket": 1}

-
descriptionShort description of the service or application. This will be part of the annotations field.string---(tick)
disksDisks in GigaBytes.array-
scsi

SCSI controllers layout.

Info

Introduced in v2021.6.0.


array of strings or array of objects--

[

40

"paravirtual", "lsilogic"]

 high_io

If set to true,VM will be created with a VMware Paravirtual SCSIController.

PVSCSI controllers are best suited for environments, especially SAN environments, running I/O-intensive applications.

boolean-

True

False

False domainFault domain moId (Managed Object Identifier)string/v2/domain-Fualt Domain 3 folderFolder moId (Managed Object Identifier)string/v2/folder--(tick)informInformational comma separated emailsstring--User's email number submitting the request isoISO image path to be mounted after creationstring/v2/isos-None memoryMemory in GBinteger--1 nameHuman readable name without the VSS Prefix. This prefix will be added before creation.string--Randomly generated networks

Network Managed Object Identifier (moId) array.

Each network will be attached to a Network Adapter VMXNET3, the most recent virtual network device from VMware, and was designed from scratch for high performance and to support new features.

array/v2/network-Unaccessible VLAN os

Supported guest operating system identifier.

string/v2/os--(tick)usageVirtual Machine usage. Prod for Production, Test for testing, QA for Quality Assurance, and Dev for Development.string-

Prod

Test

QA

Dev

Test source_vmSource Virtual Machine Uuid.string

/v2/vm

 

--

(tick) only with clone

source_templateSource Virtual Machine Template Uuid.string/v2/template--(tick) only with templatesource_imageSource OVA/OVF Virtual Machine file stored in VSKEY-STORstring/v2/image--(tick) only with image

A new virtual machine can be created with as few as the following attributes in JSON format:

Code Block
languagepy
titleRequest Body
{"usage": "Prod",
 "os": "ubuntu64Guest",
 "built_from": "os_install",
 "bill_dept": "EIS",
 "description": "Java web application.",
 "folder": "group-v4122",
 "networks": ["dvportgroup-95",
              "dvportgroup-92"],
 "disks": [40, 100]
}

HTTPie

Code Block
http -a $TK POST "https://vss-api.eis.utoronto.ca:8001/v2/vm" usage='Prod' os='ubuntu64Guest' built_from='os_install' bill_dept='EIS' description='Java web application.' folder='group-v4122' networks:='["dvportgroup-95", "dvportgroup-92"]' disks:='[40, 20]'

CURL

Code Block
curl -u $TK -X POST "https://vss-api.eis.utoronto.ca:8001/v2/vm" -d '{"usage": "Prod", "os": "ubuntu64Guest", "built_from": "os_install", "bill_dept": "EIS", "description": "Java web application.", "folder": "group-v4122", "networks": ["dvportgroup-95", "dvportgroup-92"], "disks": [40, 100]}'

If the request was successfully submitted and all parameters were accepted, the following Response Status, Headers and body will be received:

Code Block
languagetext
titleResponse Headers
HTTP/1.0 202 ACCEPTED
Allow: HEAD, POST, OPTIONS, GET
Content-Length: 364
Content-Type: application/json
Date: Tue, 26 Apr 2016 18:24:23 GMT
Location: https://vss-api.eis.utoronto.ca:8001/v2/request/task/fa276e28-a876-477a-ab40-0d2d84df9234
X-RateLimit-Limit: 7200
X-RateLimit-Remaining: 7190
X-RateLimit-Reset: 1461697200
Code Block
languagepy
titleResponse Body
collapsetrue
{
    "data": {
        "_links": {
            "request": "https://vss-api.eis.utoronto.ca:8001/v2/request/new/8", 
            "task": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/fa276e28-a876-477a-ab40-0d2d84df9234"
        }, 
        "message": "New VM Request has been accepted for processing", 
        "name": "Accepted", 
        "status": 202
    }, 
    "meta": {
        "time": "0.08575s", 
        "user": "jm"
    }
}
Note

Note that you will receive as well additional Hypermedia links contained in the _links attribute. Request object is the new virtual machine creation request which stores all parameters previously submitted and Task, is the unique task in charged of processing your request. Request and Task are both related, in terms of status, errors and warnings. Request will store any status or errors caught by the task, also it will pass the recently created VM Uuid.

Task

Request processing is almost instantaneous, however you could check the task progress by making a HTTP GET request to any given /v2/request/task/<task_id> endpoint.

Code Block
languagepy
titleResponse Body
collapsetrue
 { "_links": { "request": "https://vss-api.eis.utoronto.ca:8001/v2/request", "self": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/a57a3d4a-9e94-4822-a1d3-f99db1005dbd" }, "data": { "result": { "current": 100, "result": { "errors": [], "warnings": [ "Fault Domain: FD3

[

{"type": "lsilogic", "bus": 0},

{"type": "paravirtual", "bus": 1}

]

-
disksDisks in Gigabytes.array of strings or array of objects--

[40]

[

{"capacity_gb": 40,

"backing_mode": "persistent",

"backing_sharing": "nosharing",

"scsi": 0},

{"capacity_gb": 200,

"backing_mode": "persistent",

"backing_sharing": "nosharing",

"scsi": 1}

]

-
high_io

If set to true,VM will be created with a VMware Paravirtual SCSIController.

PVSCSI controllers are best suited for environments, especially SAN environments, running I/O-intensive applications.

Warning

Deprecated in v2021.6.0.


boolean-

True

False

False-
domainFault domain moId (Managed Object Identifier)string/v2/domain-Fault Domain -
folderFolder moId (Managed Object Identifier)string/v2/folder--(tick)
informInformational comma separated emails or list of email addresses.string or list of strings--User's email submitting the request-
isoISO image path to be mounted after creationstring/v2/iso-None-
memoryMemory in GBinteger--1-
nameHuman readable name without the VSS Prefix. This prefix will be added before creation.string--Randomly generated-
networks

Network interface controller object.

Code Block
[{"network": "moref-or-name", "type": "valid-type"}]

Each network will be attached to a NIC type specified or if not, vmxnet3, the most recent virtual network device from VMware, and was designed from scratch for high performance and to support new features.

array/v2/network-Unaccessible VLAN-
os

Supported guest operating system identifier.

string/v2/os--(tick)
usageVirtual Machine usage. Prod for Production, Test for testing, QA for Quality Assurance, and Dev for Development.string-

Prod

Test

QA

Dev

Test-
notesClient notes to be stored in the annotation field.string----
source_vmSource Virtual Machine Moref or Uuid.string

/v2/vm


--

(tick) only with clone

source_vm_snap_idClone virtual machine from source snapshotinteger/v2/vm/<id>/snapshot--(tick) only with clone
source_clibSource Deployable (VM or OVF) Content Library item name or ID.string/v2/contentlib/item

(tick) only with contentlib
source_templateSource Virtual Machine Template Moref or UUID.string/v2/template--(tick) only with template
source_imageSource OVA/OVF Virtual Machine file stored in VSKEY-STORstring/v2/image--(tick) only with image
user_dataCloud-init user_data to preconfigure the guest os upon first boot. Note: Experimental feature and currently tested with Ubuntu Cloud Images and VMware Photon OS. Only supported on OVA/OVF deployments.string----
extra_configAllows to Set VMware guestinfo interface properties which are available to the VM guest operating system via VMware Tools. These properties are stored in the VMX file prefixed with "guestinfo.".array of objects----
custom_specCustomize a guest operating system to prevent conflicts if virtual machines are identical after deployed. To customize the guest operating system, you must configure the virtual machine and guest to meet VMware Tools and virtual disk requirements.dict---recommended with clone and template deployment







power_onPower on virtual machine after successful deploymentboolean-False--
templateConvert virtual machine to template once deployed.boolean-False--
ha_groupCreate high availability group metadata (based on morefs)array or string/v2/vm---
vss_optionsSets available VSS Options to virtual machine metadata.array or string/v2/vss/options---
vss_serviceTags Virtual Machine with a specific predefined service.string/v2/vss/service--(tick) only for ITS users
retirement

Create a Retirement request for the virtual machine. The retirement request allows to set a retirement date for a virtual machine.

There are currently two types:

  • timedelta: days, months and hours from now until retirement.
  • datetime: specific timestamp to retire vm.


Code Block
languagepy
titleTimedelta
{
 "value": {"type": "timedelta", "days": 4, "months": 6, "hours": 0},
 "warning": {"days": 15}
}


Code Block
languagepy
titleDatetime
{
 "value": {"type": "datetime", "datetime": "2021-10-20 10:00"},
 "warning": {"days": 15}
}


Note

warning is optional but if not set, no notification will be sent to confirm or cancel retirement.


object----

A new virtual machine can be created with as few as the following attributes in JSON format:

Code Block
languagepy
titleRequest Body
{"usage": "Prod",
 "os": "ubuntu64Guest",
 "built_from": "os_install",
 "client": "EIS",
 "description": "Java web application.",
 "folder": "group-v4122",
 "networks": [{"network": "dvportgroup-95", "type": "e1000"}, {"network": "dvportgroup-92"}],
 "disks": [40, 100],
 "power_on": true
}

HTTPie

Code Block
http POST "https://vss-api.eis.utoronto.ca/v2/vm" "Authorization: Bearer $TK" usage='Prod' os='ubuntu64Guest' built_from='os_install' client='EIS' description='Java web application.' folder='group-v4122' networks:='[{"network": "dvportgroup-95", "type": "e1000"}, {"network": "dvportgroup-92"}]' disks:='[40, 20]' power_on:=true

CURL

Code Block
curl -H "Content-Type: application/json" -H "Authorization: Bearer $TK" -X POST "https://vss-api.eis.utoronto.ca/v2/vm" -d '{"usage": "Prod", "os": "ubuntu64Guest", "built_from": "os_install", "client": "EIS", "description": "Java web application.", "folder": "group-v4122", "networks": [{"network": "dvportgroup-95", "type": "e1000"}, {"network": "dvportgroup-92"}], "disks": [40, 100], "power_on": true}'

If the request was successfully submitted and all parameters were accepted, the following Response Status, Headers and body will be received:

Code Block
languagetext
titleResponse Headers
HTTP/1.0 202 ACCEPTED
Allow: HEAD, POST, OPTIONS, GET
Content-Length: 364
Content-Type: application/json
Date: Tue, 26 Apr 2016 18:24:23 GMT
Location: https://vss-api.eis.utoronto.ca/v2/request/task/fa276e28-a876-477a-ab40-0d2d84df9234
X-RateLimit-Limit: 7200
X-RateLimit-Remaining: 7190
X-RateLimit-Reset: 1461697200


Code Block
languagepy
titleResponse Body
collapsetrue
{
   "data": {
    "_links": {
        "request": "https://vss-api.eis.utoronto.ca/v2/request/new/8",
                     "Created in: VSS > Sandbox > jm""task": "https://vss-api.eis.utoronto.ca/v2/request/task/fa276e28-a876-477a-ab40-0d2d84df9234"
    },
    "message": "Request has been accepted for processing",
          "Network adapter 1: 00:50:56:92:50:6d: VL-1102-UTCS"name": "Accepted",
    "request": {
        "id": 8,
     "Network adapter 2: 00:50:56:92:3f:91: VL-1072-VSGAN" "status": "Submitted",
                ]
            }, 
            "status"task_id": "1604P-desperate_thompson Processed", 
      fa276e28-a876-477a-ab40-0d2d84df9234"
     "total": 100
        }, 
   
    "status": "SUCCESS"202
    }, 
    "meta": {
        "count": 2, 
        "time": "0.00028s", 
        "user": "jm"
    }
}

Request 

Checking the overall status of the request and also the resulting Uuid can be done

}


Note

Note that you will receive as well additional Hypermedia links contained in the _links attribute. Request object is the new virtual machine creation request which stores all parameters previously submitted and Task, is the unique task in charged of processing your request. Request and Task are both related, in terms of status, errors and warnings. Request will store any status or errors caught by the task, also it will pass the recently created VM Uuid.

Task

Request processing is almost instantaneous, however you could check the task progress by making a HTTP GET request to any given /v2/request/newtask/<task_id> endpoint:.

Code Block
languagepy
titleResponse Body
collapsetrue
 {
    "_linklinks": {
        "request": "https://vss-api.eis.utoronto.ca:8001/v2/request/new", 
        "self": "https://vss-api.eis.utoronto.ca:8001/v2/request/new/8task/a57a3d4a-9e94-4822-a1d3-f99db1005dbd"
    }, 
    "data": {
        "_linksresult": {
            "taskcurrent": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/fa276e28-a876-477a-ab40-0d2d84df9234"100, 
            "vmresult": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50122032-96b8-ac69-f584-89c43aee7fef"{
        }, 
        "annotationerrors": [], 
           "VM Name: 1604P-cranky_euclid",          "warnings": [
   "UTvssAdmin: JM Lopez Lujan:123-123-1234:jm.lopez@utoronto.ca",              "UTvssClientFault Domain: FD3 EIS", 
            "UTvssPurpose: Prod",       "Created in: VSS > Sandbox   "UTvssRequested: 2016-04-26 14:24:22 > jm", 
            "UTvssInform: jm.lopez@utoronto.ca",       "Network adapter      "Description: Java web application.1: 00:50:56:92:50:6d: VL-1102-UTCS", 
            ""         ],"Network adapter 2: 00:50:56:92:3f:91: VL-1072-VSGAN"
                ]
"built_from": "os_install",          "cpu": "1", }, 
            "created_onstatus": "2016-04-26 14:24:22 EDT1604P-desperate_thompson Processed", 
        "disks": [   "total": 100
        40}, 
        "status": "SUCCESS"
  20  }, 
     ], "meta": {
        "domaincount": "domain-c5877"2, 
        "dvd_cdtime": "0.00028s", 
        "folderuser": "group-v4122jm",
    }
}

Request 

Checking the overall status of the request and also the resulting Uuid can be done by making a HTTP GET request to /v2/request/new/8 endpoint:

Code Block
languagepy
titleResponse Body
collapsetrue
{
    "guest_oslink": "ubuntu64Guest", {
        "high_iorequest": false"https://vss-api.eis.utoronto.ca/v2/request/new",
         "idself": 8,"https://vss-api.eis.utoronto.ca/v2/request/new/180"
    },
    "memorydata": "1", {
        "message_links": {
            "errorstask": []"https://vss-api.eis.utoronto.ca/v2/request/task/6f642f4b-6be1-4fba-aabd-eab7f6366912",
             "warnings": ["user_data": "https://vss-api.eis.utoronto.ca/v2/request/new/180/user_data",
            "vm": "https://vss-api.eis.utoronto.ca/v2/vm/501219a5-a563-787c-f334-e7b65e829dca"
   "Fault   Domain: FD3 "},
        "annotation": [
       "Created  in: VSS > Sandbox"VM > jmName: 1608T-sw-node2",
            "UTvssAdmin: Jose Manuel   "Network adapter 1: 00:50:56:92:58:56: VL-1102-UTCSLopez Lujan:416-577-7061:jm.lopez@utoronto.ca",
            "UTvssClient: EIS",
   "Network adapter 2: 00:50:56:92:65:2b: VL-1072-VSGAN"     "UTvssPurpose: Testing",
      ]      "UTvssRequested: 2016-08-26 15:03:50 }",
            "networks"UTvssInform: [jm.lopez@utoronto.ca",
            "dvportgroup-95", 
            "dvportgroup-92"
        ],Description: deploying the new docker swarm cluster",
            "source_template": null,
         "source_vm": null, ],
        "statusbuilt_from": "Processedimage", 
        "task_idcpu": "fa276e28-a876-477a-ab40-0d2d84df92341", 
        "updatedcreated_on": "2016-0408-26 1415:2703:2950 EDT", 
        "userdisks": [
{            10,
"_links": {           40,
     "self": "https://vss-api.eis.utoronto.ca:8001/v2/user"      40,
      },      40
       "id": 1],
        "domain": "domain-c5877",
        "usernamedvd_cd": "jm",
         }, "folder": "group-v7505",
        "vmguest_nameos": "1604P-cranky_euclidubuntu64Guest",
        "id": 180,
        "vm_uuidmemory": "50122032-96b8-ac69-f584-89c43aee7fef"
 1",
  },      "metamessage": {
            "counterrors": 23[],
            "timewarnings": "0.00563s",  null
        },
        "usernetworks": "jm" [
       }
}

Multiple Virtual Machines

To create multiple Virtual Machines, send a POST request to /v2/vm. Creating multiple VMs is quite similar to creating a single VM, but instead of sending name as a string, send names as an array and select the right built process, either clone or template. The following request body is used to deploy three VM from a VM template:

Code Block
languagepy
titleRequest Body
{"bill_dept": "EIS",
 "built_from": "template",
 "description": "Ubuntu cluster",
 "os": "ubuntu64Guest",
 "folder": "group-v4122",
 "source_template": "50123c4c-c810-5c0f-6203-eac67f0cb7e8",
 "names": ["Ubuntu1",          {"network": "dvportgroup-95", "type": "e1000"}, 
                 {"network": "dvportgroup-92", "type": "vmxnet3"}
        ],
   "Ubuntu2",     "source_image": "images/wily-server-cloudimg-amd64.ova",
      "Ubuntu3"],  "networksstatus": ["dvportgroup-95Processed",
        "task_id": "6f642f4b-6be1-4fba-aabd-eab7f6366912",
    "dvportgroup-92"],
 "disks": [40, 100]}
Warning

The main difference between selecting clone or template as built process is that a source VM Template can deploy multiple instances concurrently, whereas a VM Clone can only be deployed concurrently when the source Virtual Machine is powered off. If VM is powered On, it can only be cloned one at a time.

HTTPie

Code Block
http -a $TK POST    "updated_on": "2016-08-26 15:04:42 EDT",
        "user": {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm" os='ubuntu64Guest' built_from='template' bill_dept='EIS' description='Ubuntu cluster' folder='group-v4122' networks:='["dvportgroup-95", "dvportgroup-92"]' disks:='[40, 100]' names:='["Ubuntu1", "Ubuntu2", "Ubuntu3"]' source_template=50123c4c-c810-5c0f-6203-eac67f0cb7e8

CURL

Code Block
themeDJango
curl -u $TK -X POST "https://vss-api.eis.utoronto.ca:8001/v2/vm" -d '{"bill_dept": "EIS", "built_from": "template", "description": "Ubuntu cluster", "os": "ubuntu64Guest", "folder": "group-v4122", "source_template": "50123c4c-c810-5c0f-6203-eac67f0cb7e8", "names": ["Ubuntu1", "Ubuntu2", "Ubuntu3"], "networks": ["dvportgroup-95", "dvportgroup-92"], "disks": [40, 100]}'
If the request was successfully submitted and all parameters were accepted, the following Response StatusHeaders and body will be received:
Code Block
languagetext
titleResponse Headers
HTTP/1.0 202 ACCEPTED
Allow: HEAD, POST, OPTIONS, GET
Content-Length: 682
Content-Type: application/json
Date: Wed, 27 Apr 2016 14:16:42 GMT
X-RateLimit-Limit: 7200
X-RateLimit-Remaining: 7191
X-RateLimit-Reset: 1461769200
Code Block
languagepy
titleResponse Body
collapsetrue
{
    "data": {user"
            },
            "username": "josem"
        },
        "vm_name": "1608T-sw-node2",
        "vm_uuid": "501219a5-a563-787c-f334-e7b65e829dca",
        "workdir": "/data/imports/5279a6a4-87bc-4d5d-89a6-8458912d1b53"
    },
    "meta": {
        "count": 23,
        "time": "0.00968s",
        "user": "josem"
    }
}

Multiple Virtual Machines

To create multiple Virtual Machines, send a POST request to /v2/vm. Creating multiple VMs is quite similar to creating a single VM, but instead of sending name as a string, send names as an array and select the right built process, either clone or template. The following request body is used to deploy three VM from a VM template:

Code Block
languagepy
titleRequest Body
{"": "EIS",
 "built_from": "template",
 "description": "Ubuntu cluster",
 "os": "ubuntu64Guest",
 "folder": "group-v4122",
 "source_template": "50123c4c-c810-5c0f-6203-eac67f0cb7e8",
 "names": ["Ubuntu1", 
           "_linksUbuntu2":, 
{           "Ubuntu3"],
 "requestsnetworks": [
                 {"network"https://vss-api.eis.utoronto.ca:8001/v2/request/new/26": "dvportgroup-95", "type": "e1000"}, 
                 {"network"https://vss-api.eis.utoronto.ca:8001/v2/request/new/27", 
: "dvportgroup-92", "type": "vmxnet3"}
        ],
 "disks": [40,   100]}


Warning

The main difference between selecting clone or template as built process is that a source VM Template can deploy multiple instances concurrently, whereas a VM Clone can only be deployed concurrently when the source Virtual Machine is powered off. If VM is powered On, it can only be cloned one at a time.

HTTPie

Code Block
http POST "https://vss-api.eis.utoronto.ca:8001/v2/request/new/28vm" "Authorization: Bearer $TK"          ], 
            "tasks": [
               os='ubuntu64Guest' built_from='template' client='EIS' description='Ubuntu cluster' folder='group-v4122' networks:='[{"network": "dvportgroup-95", "type": "e1000"}, {"network": "dvportgroup-92"}]' disks:='[40, 100]' names:='["Ubuntu1", "Ubuntu2", "Ubuntu3"]' source_template=50123c4c-c810-5c0f-6203-eac67f0cb7e8

CURL

Code Block
curl -H "Content-Type: application/json" -H "Authorization: Bearer $TK" -X POST "https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2", 
                "https://vss-api.eis.utoronto.ca:8001/v2/request/task/97d1f968-dec5-4249-b23c-226b46258483", 
                "https://vss-api.eis.utoronto.ca:8001/v2/request/task/0ec62b83-6c7f-47ae-8670-588449c3a2cb"
            ]
        }, 
        "message": "New VM Requests have been accepted for processing", 
        "name": "Accepted", 
        "status": 202
    }, 
    "meta": {
        "time": "0.10215s", 
        "user": "jm"
    }
}
Note

The main difference between single and multiple vm creation/deployment is the number of requests and tasks returned by the API. In this case, since we required three VMs, we get the same number of requests and tasks as a result of the POST request, which can be queried individually to verify its progress or result.

Task

Request processing is almost instantaneous, however you could check the task progress by making a HTTP GET request to any given /v2/request/task/<task_id> endpoint.

Code Block
languagepy
titleResponse Body
collapsetrue
 {
    "_links": {vm" -d '{"client": "EIS", "built_from": "template", "description": "Ubuntu cluster", "os": "ubuntu64Guest", "folder": "group-v4122", "source_template": "50123c4c-c810-5c0f-6203-eac67f0cb7e8", "names": ["Ubuntu1", "Ubuntu2", "Ubuntu3"], "networks": [{"network": "dvportgroup-95", "type": "e1000"}, {"network": "dvportgroup-92"}], "disks": [40, 100]}'
If the request was successfully submitted and all parameters were accepted, the following Response StatusHeaders and body will be received:
Code Block
languagetext
titleResponse Headers
HTTP/1.0 202 ACCEPTED
Allow: HEAD, POST, OPTIONS, GET
Content-Length: 682
Content-Type: application/json
Date: Wed, 27 Apr 2016 14:16:42 GMT
X-RateLimit-Limit: 7200
X-RateLimit-Remaining: 7191
X-RateLimit-Reset: 1461769200


Code Block
languagepy
titleResponse Body
collapsetrue
{
    "data": {
        "_links": {
            "requests": [
                "https://vss-api.eis.utoronto.ca/v2/request/new/26", 
               "request": "https://vss-api.eis.utoronto.ca:8001/v2/request/new/27", 
        "self":        "https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2"
    }, new/28"
    "data": {         "result": {
            "current": 100], 
            "resulttasks": {[
                "errors": []https://vss-api.eis.utoronto.ca/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2", 
                "warnings": [https://vss-api.eis.utoronto.ca/v2/request/task/97d1f968-dec5-4249-b23c-226b46258483", 
                   "Hard disk 1 capacity is the same. No change need to be done.", 
"https://vss-api.eis.utoronto.ca/v2/request/task/0ec62b83-6c7f-47ae-8670-588449c3a2cb"
            ]
        }, 
         "message"Fault Domain: FD3 ",New VM Requests have been accepted for processing", 
        "name": "Accepted", 
  "Created in: VSS > Sandbox > jm"status",: 202
    }, 
    "meta": {
        "time"Network adapter 1: 00:50:56:92:08:08: VL-1102-UTCS: "0.10215s", 
                    "Network adapter 2: 00:50:56:92:14:fe: VL-1072-VSGAN"
                ]
            }, 
            "status": "1604T-Ubuntu1 Processed","user": "jm"
             "total": 100
        }, 
   }
}


Note

The main difference between single and multiple vm creation/deployment is the number of requests and tasks returned by the API. In this case, since we required three VMs, we get the same number of requests and tasks as a result of the POST request, which can be queried individually to verify its progress or result.

Task

Request processing is almost instantaneous, however you could check the task progress by making a HTTP GET request to any given /v2/request/task/<task_id> endpoint.

Code Block
languagepy
titleResponse Body
collapsetrue
 {
    "status_links": {
"SUCCESS"        "request": "https://vss-api.eis.utoronto.ca/v2/request/", 
        "self": "https://vss-api.eis.utoronto.ca/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2"
    }, 
    "metadata": {
        "countresult": {
  2,          "timecurrent": "0.00597s",100, 
            "userresult": "jm" {
             } }

Requests

Checking the overall status of the requests and also the resulting Uuid can be done by making a HTTP GET request to /v2/request/new/26 - 28 endpoint:

Code Block
languagepy
titleResponse Body
collapsetrue
{
    "_linkerrors": {[], 
       "request": "https://vss-api.eis.utoronto.ca:8001/v2/request/new", 
        "selfwarnings": "https://vss-api.eis.utoronto.ca:8001/v2/request/new/26"[
    },      "data": {         "_links": {
            "task": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2",Hard disk 1 capacity is the same. No change need to be done.", 
             "vm": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012826a-6a1a-815a-249d-7d6eb640f020"      "Fault Domain: FD3 }", 
         "annotation":  [         "Created in: VSS > "VMSandbox Name: 1604T-Ubuntu1> jm", 
              "UTvssAdmin:  JM Lopez Lujan:416-123-1234:jm.lopez@utoronto.ca", 
     "Network adapter 1: 00:50:56:92:08:08: VL-1102-UTCS", 
        "UTvssClient: EIS",           "Network adapter  "UTvssPurpose: Test", 
2: 00:50:56:92:14:fe: VL-1072-VSGAN"
           "UTvssRequested: 2016-04-27 10:16:42 ",  ]
           "UTvssInform: jm.lopez@utoronto.ca" }, 
            "Descriptionstatus": Ubuntu cluster"1604T-Ubuntu1 Processed", 
            "total": 100
        ]}, 
        "built_fromstatus": "templateSUCCESS",
    }, 
    "cpumeta": "1", 
{
        "created_oncount": "2016-04-27 10:16:42 EDT"2, 
        "diskstime": [
            40"0.00597s", 
        "user": "jm"
  100  }
}

Requests

Checking the overall status of the requests and also the resulting Uuid can be done by making a HTTP GET request to /v2/request/new/26 - 28 endpoint:

Code Block
languagepy
titleResponse Body
collapsetrue
{
     ],"_link": {
         "domainrequest": "domain-c5877https://vss-api.eis.utoronto.ca/v2/request/new", 
        "dvd_cdself": "",https://vss-api.eis.utoronto.ca/v2/request/new/26"
    }, 
    "folderdata": "group-v4122", {
        "guest_oslinks": "ubuntu64Guest", {
            "high_iotask": false, 
 "https://vss-api.eis.utoronto.ca/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2", 
     "id": 26,          "memoryvm": "1", https://vss-api.eis.utoronto.ca/v2/vm/5012826a-6a1a-815a-249d-7d6eb640f020"
        "message": {
  }, 
        "errorsannotation": [],
            "VM "warnings"Name: [1604T-Ubuntu1", 
            "UTvssAdmin: JM Lopez "Hard disk 1 capacity is the same. No change need to be done.", 
  Lujan:416-123-1234:jm.lopez@utoronto.ca", 
            "UTvssClient: EIS", 
            "Fault DomainUTvssPurpose: FD3 Test", 
   
            "Created inUTvssRequested: VSS > Sandbox > jm2016-04-27 10:16:42 ", 
              "UTvssInform: jm.lopez@utoronto.ca", 
"Network adapter 1: 00:50:56:92:08:08: VL-1102-UTCS",        "Description: Ubuntu cluster", 
      "Network adapter 2: 00:50:56:92:14:fe: VL-1072-VSGAN"  ""
        ], 
]         }"built_from": "template", 
        "networkscpu": ["1", 
        "created_on": "2016-04-27  "dvportgroup-9510:16:42 EDT", 
        "disks": [
  "dvportgroup-92"          ]40, 
        "source_template": "50123c4c-c810-5c0f-6203-eac67f0cb7e8",    100
       "source_vm": null ], 
        "statusdomain": "Processeddomain-c5877", 
        "taskdvd_idcd": "aa1cc5fa-94fc-473f-b29c-47f022745eb2", 
        "updated_onfolder": "2016-04-27 10:26:00 EDTgroup-v4122", 
        "userguest_os": {
  "ubuntu64Guest", 
        "_linksid": {
      26, 
        "selfmemory": "https://vss-api.eis.utoronto.ca:8001/v2/user"1", 
        "message": {
 }, 
            "iderrors": 1[], 
            "usernamewarnings": "jm"[
        }, 
        "vm_name": "1604T-Ubuntu1",        "Hard disk 1 capacity is the same. No change need to be done.", 
                "vm_uuid": "5012826a-6a1a-815a-249d-7d6eb640f020"Fault Domain: FD3 ", 
      },      "meta": {   "Created in: VSS > Sandbox > "countjm": 23, 
        "time": "0.00541s",       "Network adapter  "user": "jm"1: 00:50:56:92:08:08: VL-1102-UTCS", 
   }
}

List

Virtual machines

In order to list all your Virtual Machines you should make a HTTP GET request to the endpoint /v2/vm, passing of course your access token. You'll get a quick summary of every single virtual machine you have permission to manage in the EIS Virtual Cloud.

NameTypeDescription
uuidstring128-bit UUID of a virtual machine, represented as a hexademical string. This identifier is used by VirtualCenter to uniquely identify all virtual machine instances, including those that may share the same SMBIOS UUID.
namestringVirtual Machine name including VSS prefix.
guestFullNamestringThis is the full name of the guest operating system for the virtual machine. For example: Windows 2000 Professional.
ipAddressstringPrimary IP address assigned to the guest operating system, if known.

memoryMB

integerMemory size of the virtual machine, in megabytes.

cpuCount

integerNumber of processors in the virtual machine. 

overallStatus

string

VM general "health" value:

  • gray: The status is unknown.
  • green: The entity is OK.
  • red: The entity definitely has a problem.
  • yellow: The entity might have a problem.
powerStatestringThe current power state of the virtual machine.
provisionedGBintegerSum of Committed and Uncommitted storage.

The following examples use HTTPie and CURL to request ALL Virtual Machine managed by given user without filters:

Code Block
languagebash
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm"
curl -u $TK -X GET "https://vss-api.eis.utoronto.ca:8001/v2/vm"

HTTP response data would look something like:

Code Block
languagepy
titleResponse
collapsetrue
{
    "_links": {             "Network adapter 2: 00:50:56:92:14:fe: VL-1072-VSGAN"
            ]
        }, 
        "networks": [
            "dvportgroup-95", 
            "dvportgroup-92"
        ], 
        "source_template": "50123c4c-c810-5c0f-6203-eac67f0cb7e8", 
        "source_vm": null, 
        "status": "Processed", 
        "task_id": "aa1cc5fa-94fc-473f-b29c-47f022745eb2", 
        "apiupdated_on": "https://vss-api.eis.utoronto.ca:8001/v2/2016-04-27 10:26:00 EDT", 
        "selfuser": "https://vss-api.eis.utoronto.ca:8001/v2/vm"{
      },      "data_links": [{
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125944-d5e0-248d-0f3c-c499acbeb1ceuser"
            }, 
            "cpuCountid": 21, 
            "folderusername": "jm"
 {       }, 
        "vm_linksname": {
          "1604T-Ubuntu1", 
        "selfvm_uuid": "https://vss-api.eis.utoronto.ca:8001/v2/folder/group-v65575012826a-6a1a-815a-249d-7d6eb640f020"
    }, 
    "meta": {
    },    "count": 23, 
           "moref"time": "group-v123420.00541s", 
       
        "nameuser": "Swarmjm",
    }
}

List

Virtual machines

In order to list all your Virtual Machines you should make a HTTP GET request to the endpoint /v2/vm:

The following examples use HTTPie and CURL to request ALL Virtual Machine managed by given user without filters:

Code Block
languagebash
http GET "https://vss-api.eis.utoronto.ca/v2/vm" "Authorization: Bearer $TK"
curl -H "Authorization: Bearer $TK" -X GET "parent": "Sandbox"https://vss-api.eis.utoronto.ca/v2/vm"

HTTP response data would look something like:

Code Block
languagepy
titleResponse
collapsetrue
{
    "_links": {
      },  "self": "https://vss-api.eis.utoronto.ca/v2/vm?short=1&per_page=5"
     },
    "guestFullNamedata": "Other 3.x Linux (64-bit)",  [
        {
            "ipAddresshostName": "128.100.72.1HOTH",
             "memoryMBipAddress": 2048"",
             "namemoref": "1604Pvm-docker-node24210", 
            "overallStatusname": "green1409P-hoth", 
            "powerState": "poweredOnpoweredOff",
            "uuid": "provisionedGB": 22, 50127974-aa4a-c215-f9f0-e1ab8a4ef050"
        },
        {
            "uuidhostName": "50125944-d5e0-248d-0f3c-c499acbeb1ce"glog-app01.eis.utoronto.ca",
        }     ], 
 "ipAddress": "192.168.2.222",
  "meta": {         "countmoref": 22,"vm-12178",
            "timename": "1.04441s1803D-graylog-app-0",
            "userpowerState": "jmpoweredOn",
    }
}

Filters

The main Virtual Machine resource has three main filters to reduce the number of VMs shown in the result or to locate a VM by hostname or ip address.

NameDescription
nameVirtual Machine name string to filter VMs
ipPrimary IP address assigned to the Guest operating system.
dnsHostname of the guest operating system.
pathInventory path in the following format EIS-DCB/vm/Public/jm/APIDemo/1605T-VMTest_1
summaryDisables VM summary in results.

The following examples show how to implement a GET request with the first three parameters shown below. The result is similar to the previous section.

Code Block
languagebash
themeDJango
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm?name=Test"
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm?ip=10.2.1.2"
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm?dns=wiki.eis.utoronto.ca"
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm?path=EIS-DCB/vm/Public/jm/APIDemo/1605T-VMTest_1

If you decide to add summary in the list of parameters, you'll disable the summary provided by the API about any given VM for this particular request. For example:

Code Block
languagebash
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm?name=Test&summary"

HTTP response data would look something like:

Code Block
languagebash
titleHTTP Response
collapsetrue
{
    "_links": {        "uuid": "5012f72a-f9c7-366f-5cf0-e1ac6afe4466"
        },
        {
            "hostName": "glog-app02.eis.utoronto.ca",
            "ipAddress": "192.168.2.122",
            "moref": "vm-12075",
            "name": "1803D-graylog-es1",
            "powerState": "poweredOn",
            "uuid": "50129e9f-38c5-ba9a-14d1-a1023fbc3aeb"
        },
        {
            "hostName": "gpu-dh-108",
            "apiipAddress": "https://vss-api.eis.utoronto.ca:8001/v2/",192.168.1.155",
            "selfmoref": "https://vss-api.eis.utoronto.ca:8001/v2/vm"vm-15854",
      },      "dataname": ["1811D-ubuntu",
        {    "powerState": "poweredOn",
       "_links": {                 "self"uuid": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db"501257e0-81f5-9c2a-84e5-e900212fef76"
        },
       }, {
            "namehostName": "1604Q-VMTest_1ubuntu",
             "uuidipAddress": "5012bd15-c20c-a971-aa68-af1a3cf3d0db"",
        }     ], 
 "moref": "vm-13053",
  "meta": {         "countname": 1"1807P-Ubuntu-18.04-server-tmpl",
            "timepowerState": "1.86220spoweredOff",
            "useruuid": "jm"50120242-3ea3-d7ba-b6a5-14ffa8565b65"
        }
}
Note

From now on, you will need the UUID of any virtual machine, provided by the either the uuid attribute or in the "_links" section, to get further information and eventually to modify its configuration.

Specific virtual machine info

Some of the attributes will have an object value. Such is the case of guest, hardware, network, config and vss

NameTypeDescription
uuidstringVirtualCenter-specific 128-bit UUID of a virtual machine, represented as a hexademical string. This identifier is used by VirtualCenter to uniquely identify all virtual machine instances, including those that may share the same SMBIOS UUID.
namestringVirtual Machine name including VSS prefix.
ConfigVM Configuration
bootdelayintegerDelay in milliseconds before starting the boot sequence. The boot delay specifies a time interval between virtual machine power on or restart and the beginning of the boot sequence.
hotaddCPUbooleanWhether virtual processors can be added while this virtual machine is running.
hotremoveCpubooleanWhether virtual processors can be removed while this virtual machine is running.
hotaddMembooleanWhether memory can be added while this virtual machine is running.
FolderLogical Folder
namestringImmediate folder holding VM
parentstringParent folder holding the VM
pathstringFull path to immediate folder
GuestGuest status and configuration
guestFullNamestringThis is the full name of the guest operating system for the virtual machine. For example: Windows 2000 Professional.
guestIdstringGuest operating system configured on a virtual machine.
hostNamestringHostname of the guest operating system, if known.
ipAddressstringPrimary IP address assigned to the guest operating system, if known.
toolsStatusstringCurrent running status of VMware Tools in the guest operating system, if known.
toolsVersionstringCurrent version status of VMware Tools in the guest operating system, if known.
Hardware 
cpuCountintegerNumber of processors in the virtual machine. 
coresPerSocketintegerNumber of cores used to distribute virtual CPUs among sockets in this virtual machine. If the value is unset it implies to numCoresPerSocket = 1.
memoryMBintegerMemory size of the virtual machine, in megabytes.
numEthernetCardsintegerNumber of virtual network adapters. 
numVirtualDisksintegerNumber of virtual disks attached to the virtual machine. 
devicesstringList of strings holding controllers, cd/dvd, disks and nics configured in the VM
versionstringThe version string for this virtual machine.
StorageStorage summary
provisionedGBinteger

Sum of Committed and Uncommitted storage.

uncommittedGBintegerAdditional storage space, in bytes, potentially used by this virtual machine on all datastores.
committedGBintegerTotal storage space, in bytes, committed to this virtual machine across all datastores.
unsharedGBintegerTotal storage space, in bytes, occupied by the virtual machine across all datastores, that is not shared with any other virtual machine.
StatusRuntime status related attributes
overallStatusstring

VM general "health" value:

  • gray: The status is unknown.
  • green: The entity is OK.
  • red: The entity definitely has a problem.
  • yellow: The entity might have a problem.
powerStatestringThe current power state of the virtual machine.
alarmsbooleanWhether the VM has triggered alarms.
bootTimeStringThe timestamp when the virtual machine was most recently powered on.
VSSVSS Management tags
AdminstringAdmin responsible of this VM.
InformstringInformational contacts to be notified.
Requestedstring

The timestamp when the virtual machine was requested.

ClientstringCustom client key-value notes.
 The following example, requests information about a particular VM using its base resource /v2/vm and appending the UUID to get the URI /vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/

 

Code Block
languagebash
http -a $TK GET

    ],
    "meta": {
        "count": 5,
        "pages": {
            "first_url": "https://vss-api.eis.utoronto.ca/v2/vm?per_page=5&page=1&expand=True",
            "last_url": "https://vss-api.eis.utoronto.ca/v2/vm?per_page=5&page=5&expand=True",
            "next_url": "https://vss-api.eis.utoronto.ca/v2/vm?per_page=5&page=2&expand=True",
            "page": 1,
            "pages": 5,
            "per_page": 5,
            "prev_url": null,
            "total": 25
        },
        "time": "0.03134s",
        "user": "jm"
    }
}


Included attributes are described in the following table:

NameTypeDescription
uuidstring128-bit UUID of a virtual machine, represented as a hexademical string. This identifier is used by VirtualCenter to uniquely identify all virtual machine instances, including those that may share the same SMBIOS UUID.
morefstringManaged object reference of the vm
namestringVirtual Machine name including VSS prefix.
guest_full_namestringThe full name of the guest operating system for the virtual machine. For example: Windows 2000 Professional.
guest_idstringThe guest operating system identifier.
ip_addressstringPrimary IP address assigned to the guest operating system, if known.
hostnamestringGuest hostname. Provided only when VMware Tools is running.

memoryGB

integerMemory size of the virtual machine, in Gigabytes.

cpu_count

integerNumber of processors in the virtual machine. 

overall_status

string

VM general "health" value:

  • gray: The status is unknown.
  • green: The entity is OK.
  • red: The entity definitely has a problem.
  • yellow: The entity might have a problem.
power_statestringThe current power state of the virtual machine. The state could be: poweredOff or poweredOn
provisioned_gbintegerSum of Committed and Uncommitted storage.
folderobjectFolder object which contains current VM
folder_morefstringFolder managed object reference
tools_running_statusstringVMware Tools running status.
tools_versionstringVMware Tools version.
tools_version_statusstringVMware Tools version status.
versionstringVirtual hardware version.

Paging

All requests to the /vm URL are paginated. The response body includes a 'meta.pages' key with everything to navigate through the results, for instance:

KeyDescription
first_urlContain the URLs to navigate through results.
last_url
prev_url
next_url
pageCurrent page
pagesTotal number of pages
per_pageResults per page. Maximum 250; Default 10.
totalTotal number of results

Results per page can be set by including the parameter in the URL query, so we can get the desired number of elements per page, for example:

Code Block
http GET "https://vss-api.eis.utoronto.ca/v2/vm?per_page=200" "Authorization: Bearer $TK"
curl -H "Authorization: Bearer $TK" -X GET "https://vss-api.eis.utoronto.ca/v2/vm?per_page=1500"

Sorting

The resource provides also attribute sorting by adding the sort parameter in the URL query string in the following format:

Code Block
sort=<field_name>,<asc|desc>

For example:

Code Block
languagebash
http GET "https://vss-api.eis.utoronto.ca/v2/vm?sort=name,desc" "Authorization: Bearer $TK"
http GET "https://vss-api.eis.utoronto.ca/v2/vm?sort=uuid,asc" "Authorization: Bearer $TK"


Filtering

Virtual Machines can be filtered by adding the filter argument to the query string in the following format:

Code Block
filter=<field_name>,<operator>,<value>

Operators can be:

OperatorDescription
eqEquals
neNot equal
ltLower than
leLower equal
gtGreater than
geGreater equal
likeMatching pattern
inMatch value in many items separated by commas

Filter Virtual Machine resource by any of the following

AttributeFilter
namename
ipAddressip_address
hostnamehostname
powerStatepower_state
cpuCountcpu_count
overallStatusoverall_status
toolsVersion

tools_version

toolsVersionStatustools_version_status
versionversion

The following examples show how to implement a GET request with the first three parameters shown below. The result is similar to the previous section.

Code Block
languagebash
http GET "https://vss-api.eis.utoronto.ca/v2/vm?filter=name,like,%Test%" "Authorization: Bearer $TK"
http GET "https://vss-api.eis.utoronto.ca/v2/vm?filter=ip_address,eq,10.2.1.2" "Authorization: Bearer $TK"
http GET "https://vss-api.eis.utoronto.ca/v2/vm?filter=hostname,like,wiki.eis.utoronto.ca" "Authorization: Bearer $TK"

Filtering by name can be done as follows:

Code Block
languagebash
http GET "https://vss-api.eis.utoronto.ca/v2/vm?filter=name,like,%Test%" "Authorization: Bearer $TK"

HTTP response data would look something like:

Code Block
languagebash
titleHTTP Response
collapsetrue
{
    "_links": {
        "api": "https://vss-api.eis.utoronto.ca/v2/", 
        "self": "https://vss-api.eis.utoronto.ca/v2/vm"
    }, 
    "data": [
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db"
            }, 
            "name": "1604Q-VMTest_1", 
            "uuid": "5012bd15-c20c-a971-aa68-af1a3cf3d0db"
        }
    ], 
    "meta": {
        "count": 1, 
        "time": "1.86220s", 
        "user": "jm"
    }
}


Note

From now on, you will need the UUID of any virtual machine, provided by the either the uuid attribute or in the "_links" section, to get further information and eventually to modify its configuration.

Specific virtual machine info

Some of the attributes will have an object value. Such is the case of guest, hardware, network, config and vss

NameTypeDescription
uuidstringVirtualCenter-specific 128-bit UUID of a virtual machine, represented as a hexademical string. This identifier is used by VirtualCenter to uniquely identify all virtual machine instances, including those that may share the same SMBIOS UUID.
namestringVirtual Machine name including VSS prefix.
ConfigVM Configuration
boot.delay_msintegerDelay in milliseconds before starting the boot sequence. The boot delay specifies a time interval between virtual machine power on or restart and the beginning of the boot sequence.
os.guest_idstringOperating system configured in the virtual machine
FolderLogical Folder
namestringImmediate folder holding VM
parentstringParent folder holding the VM
pathstringFull path to immediate folder
morefstringManaged object reference to parent folder
GuestGuest status and configuration
guest_full_namestringThis is the full name of the guest operating system for the virtual machine. For example: Windows 2000 Professional.
guest_idstringGuest operating system configured on a virtual machine.
hostnamestringHostname of the guest operating system, if known.
ip_addressstringList of IP address assigned to the guest operating system, if known.
tools_statusstringCurrent running status of VMware Tools in the guest operating system, if known.
NoteVirtual Machine Metadata
notestringVirtual Machine full annotation
clientstringClient notes
Name
full_namestringVM full name including VSS prefix.
HardwareVirtual Machine Hardware configuration
cpu_countintegerNumber of processors in the virtual machine. 
cores_per_socketintegerNumber of cores used to distribute virtual CPUs among sockets in this virtual machine. If the value is unset it implies to numCoresPerSocket = 1.
memory_mbintegerMemory size of the virtual machine, in megabytes.
devicesstringList of strings holding controllers, cd/dvd, disks and nics configured in the VM
versionstringThe version string for this virtual machine.
StorageStorage summary
provisioned_gbinteger

Sum of Committed and Uncommitted storage.

uncommitted_gbintegerAdditional storage space, in bytes, potentially used by this virtual machine on all datastores.
committed_gbintegerTotal storage space, in bytes, committed to this virtual machine across all datastores.
unshared_gbintegerTotal storage space, in bytes, occupied by the virtual machine across all datastores, that is not shared with any other virtual machine.
StateRuntime status related attributes
overall_statusstring

VM general "health" value:

  • gray: The status is unknown.
  • green: The entity is OK.
  • red: The entity definitely has a problem.
  • yellow: The entity might have a problem.
power_statestringThe current power state of the virtual machine.
alarmsbooleanWhether the VM has triggered alarms.
SnapshotVirtual Machine Snapshot information
existbooleanWhether the current virtual machine has Snapshots
VSSVSS Metadata
adminstringAdmin responsible of this VM.
clientstringCustom client key-value notes.

 The following example, requests information about a particular VM using its base resource /v2/vm and appending the UUID to get the URI /vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/


Code Block
languagebash
http GET "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db" "Authorization: Bearer $TK"

HTTP response data would look something like:

Code Block
languagepy
titleResponse
collapsetrue
  {
    "config": {
      "boot": {
        "_links": {
          "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/boot"
        },
        "delay_ms": 5000
      },
      "os": {
        "_links": {
          "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/os"
        },
        "guest_id": "centos7_64Guest"
      },
      "template": {
        "_links": {
          "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/template"
        },
        "is_template": false
      }
    },
    "folder": {
      "_links": {
        "self": "https://vss-api.eis.utoronto.ca/v2/folder-vc/group-v759"
      },
      "moref": "group-v759",
      "name": "Dev",
      "parent": "Public",
      "path": "Public > Dev"
    },
    "guest": {
      "_links": {
        "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/guest"
      },
      "guest_full_name": "CentOS 6 (64-bit)",
      "guest_id": "centos6_64Guest",
      "hostname": "pi-lab.dcb.eis.utoronto.ca",
      "ip_address": [
        "fe80::1b5b:c11b:dbff:37b8",
        "128.100.111.0",
        "fe80::250:56ff:feb0:3be0"
      ],
      "tools_running_status": "guestToolsRunning",
      "tools_status": "guestToolsUnmanaged",
      "tools_version": "10309"
    },
    "hardware": {
      "cpu": {
        "_links": {
          "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/cpu"
        },
        "cpu_count": 1
      },
      "devices": {
        "cds": [
          {
            "_links": {
              "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/cd/1"
            },
            "backing": "client",
            "unit": 1
          }
        ],
        "disks": [
          {
            "_links": {
              "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/disk/1"
            },
            "capacity_gb": 8.0,
            "unit": 1
          },
          {
            "_links": {
              "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/disk/2"
            },
            "capacity_gb": 1.0,
            "unit": 2
          },
          {
            "_links": {
              "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/disk/3"
            },
            "capacity_gb": 1.0,
            "unit": 3
          }
        ],
        "floppies": [
          {
            "_links": {
              "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/floppy/1"
            },
            "backing": "client",
            "unit": 1
          }
        ],
        "nics": [
          {
            "_links": {
              "self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/nic/1"
            },
            "connected": true,
            "mac_address": "00:50:56:b0:3b:e0",
            "network": {
              "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/vmnetwork-vc/5012bd15-c20c-a971-aa68-af1a3cf3d0db"

HTTP response data would look something like:

Code Block
languagepy
titleResponse
collapsetrue
{dvportgroup-1094"
              },
              "_linksmoref": {
"dvportgroup-1094"
       ....     }, 
 
  "data": {         "configtype": {"vmxnet3",
            "bootDelayMsunit": 5000, 1
          },
        "hotaddCpu": true, {
            "hotaddMem_links": {
true,              "hotremoveCpuself": false"https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/nic/2"
            },
            "folderconnected": {true,
            "namemac_address": "jm"00:50:56:b0:3f:4c", 
            "parentnetwork": {
"Sandbox",              "path_links": "Public > Sandbox > jm"
 {
      },          "guestself": {"https://vss-api.eis.utoronto.ca/v2/network-vc/dvportgroup-1083"
            "guestFullName": "Ubuntu Linux (64-bit)",},
              "guestIdmoref": "ubuntu64Guestdvportgroup-1083",
             "hostName": null, },
            "ipAddresstype": null"vmxnet3", 
            "toolsStatusunit": "guestToolsNotInstalled", 2
          }
     "toolsVersion": null  ]
      }, ,
      "memory": {
        "hardware_links": {
            "coresPerSocket": 1,"self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/memory"
        },
        "cpuCountmemory_gb": 2,1.0
      },
      "devicesversion": {"vmx-13"
           },
    "cdsname": [],{
      "_links":  {
        "controllersself": [
    "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/name"
      },
        "IDE 0;IDE 0","full_name": "1904T-Pi-Lab"
    },
         "note": {
      "IDE 1;IDE 1", client": {
        "_links": {
          "self"SCSI controller 0;LSI Logic: "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/note/client"
                ], 
                "disks": [},
        "value": ""
      },
    "Hard disk 1;Thin;4GB", "note": {
        "_links": {
          "self": "Hard disk 2;Thin;2GB","https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/note"
        }
      }
    },
    "permission"Hard: disk 3;Thin;1GB"{
      "_links": {
         ],"self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/permission"
      }
     },
    "nicssnapshot": [{
      "_links": {
            "Network adapter 1;Unused_Or_Quarantine_Veth;00:50:56:92:2b:bd","self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/snapshot"
      },
      "exist": true,
      "Network adapter 2;VL-1102-UTCS;00:50:56:92:11:38"
                ]"requireDiskConsolidation": false
    },
    "state": {
  },    "_links": {
        "memoryMBalarm": 2048, 
   "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/alarm",
        "numEthernetCardsevent": 2"https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/event",
             "numVirtualDisks": 3,"self": "https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/state"
      },
      "versionalarms": "vmx-10"false,
        }, "domain": {
        "name_links": "1604Q-VMTest_1", {
          "networksself": ["https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/domain"
        },
    "Unused_Or_Quarantine_Veth",    "moref": "domain-c63",
        "VL-1102-UTCSname": "Cluster1"
       ]}, 
 
      "snapshotoverall_status": false"green",
         "status"power_state": { "poweredOn"
      },
    "alarmsstorage": {
false,      "committed_gb": 5.65,
      "bootTimeprovisioned_gb": ""15.65,
      "uncommitted_gb": 10.0,
      "overallStatusunshared_gb": "green",5.53
        },
    "powerStateuuid": "poweredOff"5012bd15-c20c-a971-aa68-af1a3cf3d0db",
        }, 
 "vss": {
      "storage_links": {
   
        "committedGBself": 0,"https://vss-api.eis.utoronto.ca/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db/vss"
      },
      "provisionedGBadmin": 9,"JM Lopez      L:416-577-7062:jm.lopez utoronto.ca",
      "uncommittedGBclient": 9, 
     "EIS2",
      "unsharedGBdescription": 0"This is a       }, 
        "uuid": "5012bd15-c20c-a971-aa68-af1a3cf3d0db", 
 test VM",
      "vssinform": {
  [
         "admin": "JM Lopez:416-123-123:jm@eis."jm.lopez utoronto.ca",
      ],
      "clientoptions": "EIS",[
        "reset_on_restore",
       "inform": "jm@eis.utoronto.ca",reboot_on_restore"
      ],
      "requestedservice": "2016-04-01 10:38:07"{
         }
 "description": "Not Applicable",
  },      "metaid": {112,
        "countname": 11"N/A", 
        "timeservice_group_id": "0.48864s", 15
      },
      "userusage": "jmTest"
    }
 }
 
Note

Links list have been removed from the VM info section due to its size, however, in the next section we'll describe every single sub resource.

 
 }


Delete

Single Virtual Machine

To delete an existent Virtual Machine, send a DELETE request to /v2/vm/<vm_uuid> and a change request to decommission requested VM will be submitted.

HTTPie

Code Block
http -a $TK DELETE "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607" "Authorization: Bearer $TK"

CURL

Code Block
curl -uH "Authorization: Bearer $TK" $TK -X DELETE "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607"
If the request was successfully submitted, the following Response StatusHeaders and body will be received:
Code Block
languagetext
titleResponse Headers
HTTP/1.0 202 ACCEPTED
Allow: HEAD, DELETE, OPTIONS, GET
Content-Length: 398
Content-Type: application/json
Date: Thu, 28 Apr 2016 15:32:55 GMT
Location: https://vss-api.eis.utoronto.ca:8001/v2/request/task/7e8e4a7c-7c09-42d2-86e1-41ff5ea530c6
X-RateLimit-Limit: 7200
X-RateLimit-Remaining: 7195
X-RateLimit-Reset: 1461859200


Code Block
languagepy
titleResponse Body
collapsetrue
{

   "data": {
        "_links": {
            "request": "https://vss-api.eis.utoronto.ca:8001/v2/request/change/12", 
            "task": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/7e8e4a7c-7c09-42d2-86e1-41ff5ea530c6"
        }, 
        	"message": "VM Change Request has been accepted for processing",
         	"name": "Accepted",
         "state	"request": "Submitted",{
     	    "statusid": 20212,
    }, 
	    "metastatus": {"Submitted",
    	    "timetask_id": "0.08944s",7e8e4a7c-7c09-42d2-86e1-41ff5ea530c6"
    	},
    	"userstatus": "jm"202
    }
}

Task

Request processing is almost instantaneous, however you could check the task progress by making a HTTP GET request to any given /v2/request/task/<task_id> endpoint.

Code Block
languagepy
titleResponse Body
collapsetrue
{
    "_links": {
        "request": "https://vss-api.eis.utoronto.ca:8001/v2/request/", 
        "self": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/7e8e4a7c-7c09-42d2-86e1-41ff5ea530c6"
    }, 
    "data": {
        "result": {
            "current": 100, 
            "result": {
                "errors": [], 
                "warnings": [
                    "Virtual Machine 1604T-Ubuntu3 has been deleted."
                ]
            }, 
            "status": "1604T-Ubuntu3 Processed", 
            "total": 100
        }, 
        "status": "SUCCESS"
    }, 
    "meta": {
        "count": 2, 
        "time": "0.00865s", 
        "user": "jm"
    }
}

Requests

Checking the overall status of the requests and also its result can be done by making a HTTP GET request to /v2/request/change/26 - 28 endpoint:

Code Block
languagepy
titleResponse Body
collapsetrue
{
    "_link": {
        "request": "https://vss-api.eis.utoronto.ca:8001/v2/request/change", 
        "self": "https://vss-api.eis.utoronto.ca:8001/v2/request/change/12"
    }, 
    "data": {
        "_links": {
            "task": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/7e8e4a7c-7c09-42d2-86e1-41ff5ea530c6", 
            "vm": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607"
        }, 
        "attribute": "state", 
        "created_on": "2016-04-28 11:32:55 EDT", 
        "id": 12, 
        "message": {
            "errors": [], 
            "warnings": [
                "Virtual Machine 1604T-Ubuntu3 has been deleted."
            ]
        }, 
        "status": "Processed", 
        "task_id": "7e8e4a7c-7c09-42d2-86e1-41ff5ea530c6", 
        "updated_on": "2016-04-28 11:32:56 EDT", 
        "user": {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/user"
            }, 
            "id": 1, 
            "username": "jm"
        }, 
        "user_id": 1, 
        "value": {
            "state": "delete"
        }, 
        "vm_name": "1604T-Ubuntu3", 
        "vm_uuid": "50125d11-a8d6-2af7-c01e-dc6f6be0e607"
    }, 
    "meta": {
        "count": 13, 
        "time": "0.00572s", 
        "user": "jm"
    }
}