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 in the following table:
Attribute | Description | Type | Ref URI | Options | Default | Required |
---|
admin_email | Administrator's email | string | - | - | User's email number submitting the request | |
admin_name | Administrator's name | string | - | - | User's name number submitting the request | |
admin_phone | Administrator's phone number | string | - | - | User's phone number submitting the request | |
bill_dept | Billing Department | string | - | - | - | |
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 | - |
|
cpu | CPU count | integer | - | - | 1 | |
description | Short description of the service or application. This will be part of the annotations field. | string | - | - | - | |
disks | Disks in GigaBytes. | array | - | - | [40] | |
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 | |
domain | Fault domain moId (Managed Object Identifier) | string | /v2/domain | - | Fualt Domain 3 | |
folder | Folder moId (Managed Object Identifier) | string | /v2/folder | - | - | |
inform | Informational comma separated emails | string | - | - | User's email number submitting the request | |
iso | ISO image path to be mounted after creation | string | /v2/isos | - | None | |
memory | Memory in GB | integer | - | - | 1 | |
name | Human 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 | - | - | |
usage | Virtual Machine usage. Prod for Production, Test for testing, QA for Quality Assurance, and Dev for Development. | string | - | Prod Test QA Dev | Test | |
source_vm | Source Virtual Machine Uuid. | string | /v2/vm | - | - | only with clone |
source_template | Source Virtual Machine Template Uuid. | string | /v2/template | - | - | only with template |
source_image | Source OVA/OVF Virtual Machine file stored in VSKEY-STOR | string | /v2/image | - | - | only with image |
user_data | Cloud-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. | string | | - | - | only with image |
A new virtual machine can be created with as few as the following attributes in JSON format:
Code Block |
---|
language | py |
---|
title | Request 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 -H "Content-Type: application/json" -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 |
---|
language | text |
---|
title | Response 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 |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"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 |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"_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 ",
"Created in: VSS > Sandbox > jm",
"Network adapter 1: 00:50:56:92:50:6d: VL-1102-UTCS",
"Network adapter 2: 00:50:56:92:3f:91: VL-1072-VSGAN"
]
},
"status": "1604P-desperate_thompson Processed",
"total": 100
},
"status": "SUCCESS"
},
"meta": {
"count": 2,
"time": "0.00028s",
"user": "jm"
}
} |
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 |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"_link": {
"request": "https://vss-api.eis.utoronto.ca:8001/v2/request/new",
"self": "https://vss-api.eis.utoronto.ca:8001/v2/request/new/8180"
},
"data": {
"_links": {
"task": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/fa276e286f642f4b-a8766be1-477a4fba-ab40aabd-0d2d84df9234eab7f6366912",
"user_data": "https://vss-api.eis.utoronto.ca:8001/v2/request/new/180/user_data",
"vm": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50122032501219a5-96b8a563-ac69787c-f584f334-89c43aee7fefe7b65e829dca"
},
"annotation": [
"VM Name: 1604P-cranky_euclid1608T-sw-node2",
"UTvssAdmin: Jose JMManuel Lopez Lujan:123416-123577-12347061:jm.lopez@utoronto.ca",
"UTvssClient: EIS",
"UTvssPurpose: ProdTesting",
"UTvssRequested: 2016-0408-26 1415:2403:2250 ",
"UTvssInform: jm.lopez@utoronto.ca",
"Description: Java web application.", deploying the new docker swarm cluster",
""
],
"built_from": "os_installimage",
"cpu": "1",
"created_on": "2016-0408-26 1415:2403:2250 EDT",
"disks": [
10,
40,
40,
20 40
],
"domain": "domain-c5877",
"dvd_cd": "",
"folder": "group-v4122v7505",
"guest_os": "ubuntu64Guest",
"high_io": false,
"id": 8180,
"memory": "1",
"message": {
"errors": [],
"warnings": null
[ },
"Fault Domain: FD3 ",networks": [
"dvportgroup-77"
],
"Created in: VSS > Sandbox > jm","source_image": "images/wily-server-cloudimg-amd64.ova",
"status": "Processed",
"task_id": "6f642f4b-6be1-4fba-aabd-eab7f6366912",
"Network adapter 1: 00:50:56:92:58:56: VL-1102-UTCSupdated_on": "2016-08-26 15:04:42 EDT",
"user": {
"Network adapter 2: 00:50:56:92:65:2b: VL-1072-VSGAN"
"_links": {
] },
"networks": ["self": "https://vss-api.eis.utoronto.ca:8001/v2/user"
"dvportgroup-95"},
"username": "dvportgroup-92josem"
]},
"sourcevm_templatename": null"1608T-sw-node2",
"sourcevm_vmuuid": null, "501219a5-a563-787c-f334-e7b65e829dca",
"statusworkdir": "Processed",
"task_id": "fa276e28-a876-477a-ab40-0d2d84df9234",/data/imports/5279a6a4-87bc-4d5d-89a6-8458912d1b53"
},
"updated_onmeta": "2016-04-26 14:27:29 EDT", {
"usercount": {
23,
"_linkstime": {
"0.00968s",
"selfuser": "https://vss-api.eis.utoronto.ca:8001/v2/userjosem"
},
"id": 1,
"username": "jm"
},
"vm_name": "1604P-cranky_euclid",
"vm_uuid": "50122032-96b8-ac69-f584-89c43aee7fef"
},
"meta": {
"count": 23,}
} |
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 |
---|
language | py |
---|
title | Request Body |
---|
|
{"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"],
"timenetworks": "0.00563s["dvportgroup-95",
"user":dvportgroup-92"],
"jmdisks": }
} |
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 |
---|
language | py |
---|
title | Request Body |
---|
|
{"bill_dept": "EIS",
"built_from": "template",
"description": "Ubuntu cluster",
"os": "ubuntu64Guest",
"folder": "group-v4122",
"source_template": "[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 "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",
"names": ["Ubuntu1",
"Ubuntu2",
"Ubuntu3"],
"networks": ["dvportgroup-95",
|
CURL
Code Block |
---|
|
curl -H "Content-Type: application/json" -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]} |
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 "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 |
---|
|
curl -H "Content-Type: application/json" -u $TK -X POST "https://vss-' |
If the request was successfully submitted and all parameters were accepted, the following Response Status, Headers and body will be received:
Code Block |
---|
language | text |
---|
title | Response 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 |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"data": {
"_links": {
"requests": [
"https://vss-api.eis.utoronto.ca:8001/v2/request/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 Status, Headers and body will be received:
Code Block |
---|
language | text |
---|
title | Response 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 |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"data": {
"_links": {
"requests": [
new/26",
"https://vss-api.eis.utoronto.ca:8001/v2/request/new/27",
"https://vss-api.eis.utoronto.ca:8001/v2/request/new/28"
],
"tasks": [
"https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2",
"https://vss-api.eis.utoronto.ca:8001/v2/request/new/26task/97d1f968-dec5-4249-b23c-226b46258483",
"https://vss-api.eis.utoronto.ca:8001/v2/request/new/27",task/0ec62b83-6c7f-47ae-8670-588449c3a2cb"
]
"https://vss-api.eis.utoronto.ca:8001/v2/request/new/28"
},
"message": "New VM Requests have been accepted for processing",
], "name": "Accepted",
"tasksstatus": 202
[ },
"meta": {
"time"https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2: "0.10215s",
"user": "jm"
"https://vss-api.eis.utoronto.ca:8001}
} |
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/
97d1f968-dec5-4249-b23c-226b46258483",
<task_id> endpoint.
Code Block |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"_links": {
"request": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/0ec62b83-6c7f-47ae-8670-588449c3a2cb"",
"self": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2"
] },
}, "data": {
"messageresult": "New{
VM Requests have been accepted for processing", "namecurrent": "Accepted"100,
"status": 202 "result": {
}, "meta": { "timeerrors": "0.10215s",[],
"userwarnings": "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 |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"_links": {"Hard disk 1 capacity is the same. No change need to be done.",
"request": "https://vss-api.eis.utoronto.ca:8001/v2/request/",Fault Domain: FD3 ",
"self": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2"Created in: VSS > Sandbox > jm",
}, "data": { "result":Network {adapter 1: 00:50:56:92:08:08: VL-1102-UTCS",
"current": 100, "Network adapter "result": {2: 00:50:56:92:14:fe: VL-1072-VSGAN"
"errors": [],
},
"warnings": [ "status": "1604T-Ubuntu1 Processed",
"Hard disk 1 capacity is the same. No change need to be done.", "total": 100
},
"Fault Domain"status": FD3 "SUCCESS",
},
"meta": {
"count"Created in: VSS > Sandbox > jm"2,
"Network adapter 1: 00:50:56:92:08:08: VL-1102-UTCS"time": "0.00597s",
"user": "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 |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"Network adapter 2: 00:50:56:92:14:fe: VL-1072-VSGAN" "_link": {
"request": "https://vss-api.eis.utoronto.ca:8001/v2/request/new",
] "self": "https://vss-api.eis.utoronto.ca:8001/v2/request/new/26"
},
"data": {
"status_links": "1604T-Ubuntu1 Processed",
{
"totaltask": 100
"https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2",
}, "statusvm": "SUCCESShttps://vss-api.eis.utoronto.ca:8001/v2/vm/5012826a-6a1a-815a-249d-7d6eb640f020"
},
"metaannotation": [
{ "count"VM Name: 21604T-Ubuntu1",
"time": "0.00597s",UTvssAdmin: JM Lopez Lujan:416-123-1234:jm.lopez@utoronto.ca",
"user"UTvssClient: EIS"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 |
---|
language | py |
---|
title | Response Body |
---|
collapse | true |
---|
|
{ "_link": { "UTvssPurpose: Test",
"request"UTvssRequested: "https://vss-api.eis.utoronto.ca:8001/v2/request/new",2016-04-27 10:16:42 ",
"self"UTvssInform: "https://vss-api.eis.utoronto.ca:8001/v2/request/new/26"jm.lopez@utoronto.ca",
}, "data": {Description: Ubuntu cluster",
"_links": {"
],
"taskbuilt_from": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/aa1cc5fa-94fc-473f-b29c-47f022745eb2",
"template",
"cpu": "1",
"vmcreated_on": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012826a-6a1a-815a-249d-7d6eb640f020"2016-04-27 10:16:42 EDT",
},"disks": [
"annotation": [40,
"VM100
Name: 1604T-Ubuntu1", ],
"UTvssAdmin: JM Lopez Lujan:416-123-1234:jm.lopez@utoronto.ca "domain": "domain-c5877",
"dvd_cd": "",
"UTvssClient: EIS", "folder": "group-v4122",
"guest_os": "ubuntu64Guest",
"high_io"UTvssPurpose: Test"false,
"id": 26,
"UTvssRequested: 2016-04-27 10:16:42 ", "memory": "1",
"message"UTvssInform: jm.lopez@utoronto.ca",{
"errors"Description: Ubuntu cluster"[],
"warnings": [
], "built_from": "template",
"cpu": "1"Hard disk 1 capacity is the same. No change need to be done.",
"created_on": "2016-04-27 10:16:42 EDT", "Fault Domain: FD3 "disks":, [
40, "Created in: VSS > Sandbox > jm",
100 ], "Network adapter "domain": "domain-c58771: 00:50:56:92:08:08: VL-1102-UTCS",
"dvd_cd": "", "Network adapter "folder": "group-v4122",2: 00:50:56:92:14:fe: VL-1072-VSGAN"
"guest_os": "ubuntu64Guest", ]
"high_io": false },
"idnetworks": 26,[
"memory": "1dvportgroup-95",
"message": { "dvportgroup-92"
"errors": [],
"source_template": "50123c4c-c810-5c0f-6203-eac67f0cb7e8",
"warnings": [ "source_vm": null,
"Hard disk 1 capacity is the same. No change need to be done.status": "Processed",
"task_id": "aa1cc5fa-94fc-473f-b29c-47f022745eb2",
"Fault Domain: FD3 "updated_on": "2016-04-27 10:26:00 EDT",
"user": {
"Created in: VSS > Sandbox > jm"_links",: {
"self"Network adapter 1: 00:50:56:92:08:08: VL-1102-UTCS","https://vss-api.eis.utoronto.ca:8001/v2/user"
},
"Network adapter 2: 00:50:56:92:14:fe: VL-1072-VSGAN" "id": 1,
]"username": "jm"
},
"networksvm_name": [
"dvportgroup1604T-95Ubuntu1",
"dvportgroup-92"vm_uuid": "5012826a-6a1a-815a-249d-7d6eb640f020"
],
},
"source_templatemeta": "50123c4c-c810-5c0f-6203-eac67f0cb7e8",{
"source_vmcount": null23,
"statustime": "Processed0.00541s",
"task_iduser": "aa1cc5fa-94fc-473f-b29c-47f022745eb2","jm"
}
} |
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 |
---|
|
http -a $TK GET "updated_on": "2016-04-27 10:26:00 EDT",
"user": {
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 |
---|
language | py |
---|
title | Response |
---|
collapse | true |
---|
|
{
"_links": {
"api": "https://vss-api.eis.utoronto.ca:8001/v2/",
"self": "https://vss-api.eis.utoronto.ca:8001/v2/uservm"
},
"data": [
"id": 1, {
"username_links": "jm"
{
}, "vm_nameself": "1604T-Ubuntu1",https://vss-api.eis.utoronto.ca:8001/v2/vm/5012bbfb-137e-c4f5-7a85-c837351f786b"
},
"vm_uuidname": "5012826a1608T-6a1a-815a-249d-7d6eb640f020"ubuntu-15.10_x64",
}, "metauuid": {"5012bbfb-137e-c4f5-7a85-c837351f786b"
"count": 23},
{
"time": "0.00541s", "user_links": "jm" {
}
} |
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.
Name | Type | Description |
---|
uuid | string | 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. |
name | string | Virtual Machine name including VSS prefix. |
guestFullName | string | This is the full name of the guest operating system for the virtual machine. For example: Windows 2000 Professional. |
ipAddress | string | Primary IP address assigned to the guest operating system, if known. |
memoryMB | integer | Memory size of the virtual machine, in megabytes. |
cpuCount | integer | Number 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.
|
powerState | string | The current power state of the virtual machine. |
provisionedGB | integer | Sum 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 |
---|
|
http -a $TK GET "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012aa6d-6e6b-e5c7-87a5-713853308880"
},
"name": "1608T-ubuntu-15.04_x64",
"uuid": "5012aa6d-6e6b-e5c7-87a5-713853308880"
}
{
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/501264bc-5d2d-3330-e0d9-562309e33331"
},
"name": "CentOS-7-x86_64-VMware",
"uuid": "501264bc-5d2d-3330-e0d9-562309e33331"
},
{
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50123967-ab62-e8af-1c1a-9e43683ac208"
curl -u $TK -X GET "https://vss-api.eis.utoronto.ca:8001/v2/vm" |
HTTP response data would look something like:
Code Block |
---|
language | py |
---|
title | Response |
---|
collapse | true |
---|
|
{
"_links": { },
"apiname": "https://vss-api.eis.utoronto.ca:8001/v2/1608T-tender_mccarthy",
"selfuuid": "https://vss-api.eis.utoronto.ca:8001/v2/vm"50123967-ab62-e8af-1c1a-9e43683ac208"
}, }
"data ],
"meta": [{
{
"count": 4,
"time": "_links": {"0.00713s",
"user": "jm"
}
} |
If you wish to display a quick summary in your main VM list, just include summary=1 in the query string as follows:
Code Block |
---|
|
http -a $TK "self":GET "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125944-d5e0-248d-0f3c-c499acbeb1ce?summary=1"
curl -u $TK -X },GET "https://vss-api.eis.utoronto.ca:8001/v2/vm?summary=1" |
Code Block |
---|
language | py |
---|
title | Response |
---|
collapse | true |
---|
|
{
"_links": {
"cpuCountapi": 2"https://vss-api.eis.utoronto.ca:8001/v2/",
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm"
"folder },
"data": {[
{
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/foldervm/group-v6557"
5012689b-071a-145b-584a-9a9b49873510"
},
}, "cpuCount": 2,
"moreffolder": "group-v12342",{
"name_links": "Swarm", {
"parentself": "Sandbox"https://vss-api.eis.utoronto.ca:8001/v2/folder/group-v6736"
},
"guestFullNamemoref": "Other 3.x Linux (64-bit)",group-v6736",
"ipAddressname": "128.100.72.1APIDemo",
"memoryMBparent": 2048,"jm"
"name": "1604P-docker-node2",},
"guestFullName": "Other 3.x "overallStatus": "green"or later Linux (64-bit)",
"powerStateipAddress": "poweredOn"null,
"provisionedGBmemoryGB": 222.0,
"uuidname": "50125944-d5e0-248d-0f3c-c499acbeb1ce"1608T-stoic_carson",
} ],
"overallStatus": "green",
"meta": { "countpowerState": 22"poweredOff",
"timeprovisionedGB": "112.04441s"25,
"useruuid": "jm"5012689b-071a-145b-584a-9a9b49873510"
}
} |
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.
Name | Description |
---|
name | Virtual Machine name string to filter VMs |
ip ...
],
"meta": {
"count": 1,
"time": "0.78135s",
"user": "jm"
}
} |
Included attributes are described in the following table:
Name | Type | Description |
---|
uuid | string | 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. |
name | string | Virtual Machine name including VSS prefix. |
guestFullName | string | This is the full name of the guest operating system for the virtual machine. For example: Windows 2000 Professional. |
ipAddress | string | Primary IP address assigned to the Guest guest operating system, if known. |
dns | Hostname of the guest operating system. |
path | Inventory path in the following format EIS-DCB/vm/Public/jm/APIDemo/1605T-VMTest_1 |
summary | Enables 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 |
---|
|
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?memoryGB | integer | Memory size of the virtual machine, in Gigabytes. |
cpuCount | integer | Number 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.
|
powerState | string | The current power state of the virtual machine. |
provisionedGB | integer | Sum of Committed and Uncommitted storage. |
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.
Name | Description |
---|
name | Virtual Machine name string to filter VMs |
ip | Primary IP address assigned to the Guest operating system. |
dns | Hostname of the guest operating system. |
path | Inventory path in the following format EIS-DCB/vm/Public/jm/APIDemo/1605T-VMTest_1 |
summary | Enables 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 |
---|
|
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 exampleFiltering by name can be done as follows:
Code Block |
---|
|
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm?name=Test&summary=1" |
HTTP response data would look something like:
Code Block |
---|
language | bash |
---|
title | HTTP Response |
---|
collapse | true |
---|
|
{
"_links": {
"api": "https://vss-api.eis.utoronto.ca:8001/v2/",
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm"
},
"data": [
{
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/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.
Name | Type | Description |
---|
uuid | string | VirtualCenter-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. |
name | string | Virtual Machine name including VSS prefix. |
Config | VM Configuration |
bootdelay | integer | Delay 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. |
hotaddCPUos | boolean | Whether virtual processors can be added while this virtual machine is running. |
hotremoveCpu | boolean | Whether virtual processors can be removed while this virtual machine is running. |
hotaddMem | boolean | Whether memory can be added while this virtual machine is running. |
string | Operating system configured in the virtual machine |
Folder | Logical Folder |
name | string | Immediate folder holding VM |
parent | string | Parent folder holding the VM |
path | string | Full path to immediate folder |
moref | string | Managed object reference to parent folder |
Guest | Guest status and configuration |
guestFullName | string | This is the full name of the guest operating system for the virtual machine. For example: Windows 2000 Professional. |
guestId | string | Guest operating system configured on a virtual machine. |
hostName | string | Hostname of the guest operating system, if known. |
ipAddress | string | Primary List of IP address assigned to the guest operating system, if known. |
toolsStatus | string | Current running status of VMware Tools in the guest operating system, if known. |
toolsVersion | string | Current version status of VMware Tools in the guest operating system, if known. |
Hardware | |
Note | Virtual Machine Metadata |
note | string | Virtual Machine full annotation |
client | string | List of client notes in key-value format |
Name | |
full_name | string | VM full name including VSS prefix. |
Hardware | Virtual Machine Hardware configuration |
cpuCount | integer | Number of processors in the virtual machine. |
coresPerSocket | integer | Number of cores used to distribute virtual CPUs among sockets in this virtual machine. If the value is unset it implies to numCoresPerSocket = 1. |
memoryMB | integer | Memory size of the virtual machine, in megabytes. |
numEthernetCards | integer | Number of virtual network adapters. |
numVirtualDisks | integer | Number of virtual disks attached to the virtual machine. |
devices | string | List of strings holding controllers, cd/dvd, disks and nics configured in the VM |
version | string | The version string for this virtual machine. |
Storage | Storage summary |
provisionedGB | integer | Sum of Committed and Uncommitted storage. |
uncommittedGB | integer | Additional storage space, in bytes, potentially used by this virtual machine on all datastores. |
committedGB | integer | Total storage space, in bytes, committed to this virtual machine across all datastores. |
unsharedGB | integer | Total storage space, in bytes, occupied by the virtual machine across all datastores, that is not shared with any other virtual machine. |
StatusState | Runtime status related attributes |
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.
|
powerState | string | The current power state of the virtual machine. |
alarms | boolean | Whether the VM has triggered alarms. | bootTime | String | The timestamp when the virtual machine was most recently powered on. |
Snapshot | Virtual Machine Snapshot information |
exist | boolean | Whether the current virtual machine has Snapshots |
VSS | VSS Management tagsMetadata |
Admin | string | Admin responsible of this VM. |
InformClient | string | Informational contacts to be notified. |
Requested | string | The timestamp when the virtual machine was requested. |
Client | string | Custom 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 |
---|
|
http -a $TK GETCustom 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 |
---|
|
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012bd15-c20c-a971-aa68-af1a3cf3d0db" |
HTTP response data would look something like:
Code Block |
---|
language | py |
---|
title | Response |
---|
collapse | true |
---|
|
{
"data": {
"vss": {
"admin": "JM Lopez Lujan:416-577-7061:jm@eis.utoronto.ca",
"client": "EIS",
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/vss"
}
},
"hardware": {
"version": "vmx-10",
"cpu": {
"cpuCount": 2,
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/cpu"
}
},
"devices": {
"nics": [
{
"macAddress": "00:50:56:92:28:7a",
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/nic/1"
},
"network": {
"moref": "dvportgroup-95",
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/network/dvportgroup-95"
}
},
"unit": "1"
}
],
"disks": [
{
"capacityGB": 10.0,
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012bd155012689b-c20c071a-a971145b-aa68-af1a3cf3d0db" |
HTTP response data would look something like:
Code Block |
---|
language | py |
---|
title | Response |
---|
collapse | true |
---|
|
{584a-9a9b49873510/disk/1"
"_links": { },
.... }, "dataunit": {"1"
}
"config": { ],
"bootDelayMsfloppies": 5000, [
{
"hotaddCpubacking": true"client",
"hotaddMem_links": true, {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/floppy/1"
"hotremoveCpu": false },
}, "folderlabel": {"Floppy drive 1"
"name": "jm",}
"parent": "Sandbox",
],
"pathcds": [
"Public > Sandbox > jm" {
}, "guestbacking": "client", {
"guestFullName_links": "Ubuntu{
Linux (64-bit)", "guestId": "ubuntu64Guest","self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/cd/1"
"hostName": null},
"ipAddressunit": null,"1"
}
"toolsStatus": "guestToolsNotInstalled", ]
},
"toolsVersion": null }, "memory": {
"hardware_links": {
"coresPerSocketself": 1,"https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/memory"
},
"cpuCount": 2, "memoryGB": 2.0
}
"devices": { },
"guest": {
"cdstoolsStatus": []"guestToolsUnmanaged",
"hostName": null,
"controllers_links": [{
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/guest"
},
"IDE 0;IDE 0", "guestId": null,
"ipAddress": [],
"IDE 1;IDE 1", guestFullName": null
},
"uuid": "5012689b-071a-145b-584a-9a9b49873510",
"SCSI controller 0;LSI Logic""storage": {
"uncommittedGB": 11.64,
]"provisionedGB": 12.25,
"committedGB": 0.6,
"disksunsharedGB": [0.6
},
"name": {
"_links": {
"Hard disk 1;Thin;4GB", "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/name"
},
"full_name": "Hard disk 2;Thin;2GB","1608T-stoic_carson"
},
"note": {
"note": {
"_links"Hard: disk 3;Thin;1GB"{
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/note"
], }
},
"nicsclient": [{
"_links": {
"Network adapter 1;Unused_Or_Quarantine_Veth;00:50:56:92:2b:bd",self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/note/client"
},
"Network adapter 2;VL-1102-UTCS;00:50:56:92:11:38""tags": []
}
},
]"state": {
"alarms": false,
}, "powerState": "poweredOff",
"memoryMBoverallStatus": 2048"green",
"_links": {
"numEthernetCardsalarm": 2,
"https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/alarm",
"numVirtualDisksself": 3, "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/state",
"versionevent": "vmx-10"
}https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/event",
"namedomain": "1604Q-VMTest_1",https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/domain"
}
"networks": [ },
"snapshot": {
"Unused_Or_Quarantine_Veth", links": {
"VL-1102-UTCS"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/snapshot"
]},
"snapshotexist": false
},
"folder": {
"statuspath": {"VSS > Sandbox > jm > APIDemo",
"alarmsmoref": false"group-v6736",
"_links": {
"bootTimeself": "",https://vss-api.eis.utoronto.ca:8001/v2/folder/group-v6736"
},
"overallStatusname": "greenAPIDemo",
"powerStateparent": "poweredOffjm"
},
}, "config": {
"storageos": {
"committedGBguestId": 0,
"other3xLinux64Guest",
"provisionedGB_links": 9,{
"uncommittedGBself": 9,"https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/os"
}
"unsharedGB": 0 },
}, "boot": {
"uuiddelayMs": "5012bd15-c20c-a971-aa68-af1a3cf3d0db"0,
"vss_links": {
"adminself": "JM Lopez:416-123-123:jm@eishttps://vss-api.eis.utoronto.ca",:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/boot"
}
"client": "EIS", }
}
},
"informmeta": "jm@eis.utoronto.ca"{
"count": 11,
"user": "jm",
"requested": "2016-04-01 10:38:07time": "0.54539s"
},
"_links": {
} }"export": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/export",
"metaself": {"https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510",
"count": 11,
"console": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/console",
"timetemplate": "0.48864s",
https://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/template",
"userperformance": "jmhttps://vss-api.eis.utoronto.ca:8001/v2/vm/5012689b-071a-145b-584a-9a9b49873510/performance"
}
}
|
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. |
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.