Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Abiquo 4.4

Skip to end of metadata
Go to start of metadata

Contents:

Virtual Machines Resource

This resource represents a virtual machine in the platform. See also API Tutorials about VMs, for example, to add a NIC or a disk, see the corresponding tutorials. To add a bootstrap script to a VM, see Manage virtual machine metadata via API

Main URI of the Resource

This class operates mainly over the Resource URI: /cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines

Exposed Methods

List virtual machines in a virtual appliance

Retrieve all VMs that belong to this virtual appliance with the standard virtual machine data transfer object. A similar method is also available at the virtual datacenters level. 

Paging Method

This method works with paging. Check out Basic Behaviors for information about how it works

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines 
Roles Required: VDC_ENUMERATE,VDC_MANAGE_VAPP,VAPP_CUSTOMISE_SETTINGS,VAPP_ASSIGN_NETWORK,VAPP_PERFORM_ACTIONS,VAPP_DEPLOY_UNDEPLOY,VAPP_CREATE_STATEFUL,VAPP_ASSIGN_VOLUME,MANAGE_HARD_DISKS,VAPP_CREATE_INSTANCE
Request Headers: Accept:  application/vnd.abiquo.virtualmachines+json; version=4.4; application/vnd.abiquo.virtualmachines+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

startwith

false

0

offset

by

false

name

by default ordered by name

has

false

 

name filter

limit

false

25

number of items to retrieve

asc

false

true

whether the sorting of the list is ascendent or descendent

key

false

 

related with metadata information, allows to filter content in this field

Request Message Body Entity: 
Response Message Body Entity: VirtualMachines Media Type 
Request Example:

 Click here to show or hide the request example

List virtual machines

GET_cld_vdcs_X_vapps_X_vms_AC_vms_j_lmt.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines?limit=0 \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachines+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "totalSize": 2, 
  "duplicatedvms": [], 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines?limit=0&by=name&asc=true", 
      "rel": "first"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines?startwith=0&limit=0&by=name&asc=true", 
      "rel": "last"
    }
  ], 
  "collection": [
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/datacenters/3367/racks/973/machines/1020", 
          "type": "application/vnd.abiquo.machine+json", 
          "rel": "machine", 
          "title": "TEST_HYPERVISOR"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/locations/3367", 
          "type": "application/vnd.abiquo.datacenter+json", 
          "rel": "location", 
          "title": "29005"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "edit", 
          "title": "29048"
        }, 
        {
          "href": "http://localhost:9009/api/admin/datacenters/3367/racks/973/machines/1020/virtualmachines/1330/action/sendmail", 
          "type": "application/vnd.abiquo.mail+json", 
          "rel": "sendmail", 
          "title": "send mail"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/3966", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "29007"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/3966/users/4163", 
          "type": "application/vnd.abiquo.user+json", 
          "rel": "user", 
          "title": "29028 29029"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "29014"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351", 
          "type": "application/vnd.abiquo.virtualappliance+json", 
          "rel": "virtualappliance", 
          "title": "29016"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/metadata", 
          "type": "application/vnd.abiquo.metadata+json", 
          "rel": "metadata", 
          "title": "metadata"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/network/configurations", 
          "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
          "rel": "configurations", 
          "title": "vlan network configurations"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/network/nics", 
          "type": "application/vnd.abiquo.nics+json", 
          "rel": "nics", 
          "title": "nics"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/storage/disks", 
          "type": "application/vnd.abiquo.harddisks+json", 
          "rel": "harddisks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/state", 
          "type": "application/vnd.abiquo.virtualmachinestate+json", 
          "rel": "state", 
          "title": "NOT_ALLOCATED"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/action/undeploy", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "undeploy", 
          "title": "virtual machine undeploy"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/action/deploy", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "deploy", 
          "title": "virtual machine deploy"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/action/reset", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "reset", 
          "title": "virtual machine reset"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/action/instance", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "instance", 
          "title": "virtual machine snapshot"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/config/rdpaccess", 
          "type": "application/vnd.abiquo.virtualmachineconsole+json", 
          "rel": "rdpaccess", 
          "title": "remote access"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/firewalls", 
          "type": "application/vnd.abiquo.links+json", 
          "rel": "firewalls", 
          "title": "firewalls"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/loadbalancers", 
          "type": "application/vnd.abiquo.loadbalancers+json", 
          "rel": "loadbalancers", 
          "title": "load balancers"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/backup/action/request", 
          "type": "application/vnd.abiquo.ondemandbackup+json", 
          "rel": "requestbackup", 
          "title": "request on demand backup"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/backup/action/restore", 
          "type": "application/vnd.abiquo.restore+json", 
          "rel": "requestrestore", 
          "title": "request a restore of a backup"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/storage/volumes", 
          "type": "application/vnd.abiquo.volumes+json", 
          "rel": "volumes", 
          "title": "volumes"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/action/protect", 
          "type": "text/plain", 
          "rel": "protect", 
          "title": "protect"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/action/unprotect", 
          "type": "text/plain", 
          "rel": "unprotect", 
          "title": "unprotect"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/metrics", 
          "type": "application/vnd.abiquo.metricsmetadata+json", 
          "rel": "metricsmetadata", 
          "title": "metricsmetadata"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/metrics/collectd", 
          "type": "application/json", 
          "rel": "collectd", 
          "title": "collectd"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/alarms", 
          "type": "application/vnd.abiquo.alarms+json", 
          "rel": "alarms", 
          "title": "alarms"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/actionplans", 
          "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
          "rel": "actionplans", 
          "title": "actionplans"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/actionplans", 
          "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
          "rel": "actionplansflat", 
          "title": "actionplansflat"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1330/action/clone", 
          "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
          "rel": "clone", 
          "title": "clone"
        }, 
        {
          "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
          "type": "application/vnd.abiquo.hypervisortype+json", 
          "rel": "hypervisortype", 
          "title": "TestHypervisor"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/3966/datacenterrepositories/3367/virtualmachinetemplates/1574", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "virtualmachinetemplate", 
          "title": "29044"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/1541", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "29045"
        }
      ], 
      "vdrpPort": 0, 
      "variables": {}, 
      "ram": 4, 
      "highDisponibility": 0, 
      "natrules": [], 
      "creationTimestamp": 1520514008000, 
      "id": 1330, 
      "name": "29048", 
      "idType": 0, 
      "backuppolicies": [], 
      "monitored": false, 
      "uuid": "b9fbf0ec-3ca7-4798-9e55-9a54f8dec1bf", 
      "idState": 1, 
      "vdrpEnabled": true, 
      "state": "NOT_ALLOCATED", 
      "protected": false, 
      "lastSynchronize": 1520514008000, 
      "type": "NOT_MANAGED", 
      "cpu": 1, 
      "generateGuestInitialPassword": false, 
      "metadata": null
    }, 
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/datacenters/3367/racks/974/machines/1021", 
          "type": "application/vnd.abiquo.machine+json", 
          "rel": "machine", 
          "title": "TEST_HYPERVISOR"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/locations/3367", 
          "type": "application/vnd.abiquo.datacenter+json", 
          "rel": "location", 
          "title": "29005"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "edit", 
          "title": "29074"
        }, 
        {
          "href": "http://localhost:9009/api/admin/datacenters/3367/racks/974/machines/1021/virtualmachines/1331/action/sendmail", 
          "type": "application/vnd.abiquo.mail+json", 
          "rel": "sendmail", 
          "title": "send mail"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/3966", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "29007"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/3966/users/4164", 
          "type": "application/vnd.abiquo.user+json", 
          "rel": "user", 
          "title": "29054 29055"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "29014"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351", 
          "type": "application/vnd.abiquo.virtualappliance+json", 
          "rel": "virtualappliance", 
          "title": "29016"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/metadata", 
          "type": "application/vnd.abiquo.metadata+json", 
          "rel": "metadata", 
          "title": "metadata"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/network/configurations", 
          "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
          "rel": "configurations", 
          "title": "vlan network configurations"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/network/nics", 
          "type": "application/vnd.abiquo.nics+json", 
          "rel": "nics", 
          "title": "nics"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/storage/disks", 
          "type": "application/vnd.abiquo.harddisks+json", 
          "rel": "harddisks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/state", 
          "type": "application/vnd.abiquo.virtualmachinestate+json", 
          "rel": "state", 
          "title": "NOT_ALLOCATED"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/action/undeploy", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "undeploy", 
          "title": "virtual machine undeploy"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/action/deploy", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "deploy", 
          "title": "virtual machine deploy"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/action/reset", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "reset", 
          "title": "virtual machine reset"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/action/instance", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "instance", 
          "title": "virtual machine snapshot"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/config/rdpaccess", 
          "type": "application/vnd.abiquo.virtualmachineconsole+json", 
          "rel": "rdpaccess", 
          "title": "remote access"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/firewalls", 
          "type": "application/vnd.abiquo.links+json", 
          "rel": "firewalls", 
          "title": "firewalls"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/loadbalancers", 
          "type": "application/vnd.abiquo.loadbalancers+json", 
          "rel": "loadbalancers", 
          "title": "load balancers"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/backup/action/request", 
          "type": "application/vnd.abiquo.ondemandbackup+json", 
          "rel": "requestbackup", 
          "title": "request on demand backup"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/backup/action/restore", 
          "type": "application/vnd.abiquo.restore+json", 
          "rel": "requestrestore", 
          "title": "request a restore of a backup"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/storage/volumes", 
          "type": "application/vnd.abiquo.volumes+json", 
          "rel": "volumes", 
          "title": "volumes"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/action/protect", 
          "type": "text/plain", 
          "rel": "protect", 
          "title": "protect"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/action/unprotect", 
          "type": "text/plain", 
          "rel": "unprotect", 
          "title": "unprotect"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/metrics", 
          "type": "application/vnd.abiquo.metricsmetadata+json", 
          "rel": "metricsmetadata", 
          "title": "metricsmetadata"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/metrics/collectd", 
          "type": "application/json", 
          "rel": "collectd", 
          "title": "collectd"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/alarms", 
          "type": "application/vnd.abiquo.alarms+json", 
          "rel": "alarms", 
          "title": "alarms"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/actionplans", 
          "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
          "rel": "actionplans", 
          "title": "actionplans"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/actionplans", 
          "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
          "rel": "actionplansflat", 
          "title": "actionplansflat"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2371/virtualappliances/1351/virtualmachines/1331/action/clone", 
          "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
          "rel": "clone", 
          "title": "clone"
        }, 
        {
          "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
          "type": "application/vnd.abiquo.hypervisortype+json", 
          "rel": "hypervisortype", 
          "title": "TestHypervisor"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/3966/datacenterrepositories/3367/virtualmachinetemplates/1575", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "virtualmachinetemplate", 
          "title": "29070"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/1542", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "29071"
        }
      ], 
      "vdrpPort": 0, 
      "variables": {}, 
      "ram": 4, 
      "highDisponibility": 0, 
      "natrules": [], 
      "creationTimestamp": 1520514008000, 
      "id": 1331, 
      "name": "29074", 
      "idType": 0, 
      "backuppolicies": [], 
      "monitored": false, 
      "uuid": "939c444a-4f64-4874-9ae2-10893263e617", 
      "idState": 1, 
      "vdrpEnabled": true, 
      "state": "NOT_ALLOCATED", 
      "protected": false, 
      "lastSynchronize": 1520514008000, 
      "type": "NOT_MANAGED", 
      "cpu": 1, 
      "generateGuestInitialPassword": false, 
      "metadata": null
    }
  ]
}

Create a virtual machine

To create a VM, you will need the link of the virtual appliance where the VM will be created and a VM data transfer object. 

Virtual Machine Entity Example 1

The simplest VM data transfer object is a link to the VM template in the datacenter repository (Apps library), in the VM format as shown in the following XML example.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<virtualMachine> 
      <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/4" 
rel="virtualmachinetemplate" title="Core"/>
</virtualMachine>

Virtual Machine Entity Example 2

When creating a VM, you can set more values in the data transfer object, which is the VirtualMachine Media Type. In this XML example we will give the VM a higher specification than the template default (2 CPUs instead of 1, and 128 MB of RAM instead of 64). And we will enable remote access and set a custom password.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<virtualMachine>
    <link title="Core" rel="virtualmachinetemplate" type="application/vnd.abiquo.virtualmachinetemplate+xml" href="http://10.60.1.31:80/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/4"/>
    <cpu>2</cpu>
    <ram>128</ram>
    <vdrpEnabled>true</vdrpEnabled>
    <password>myvmpass</password>
</virtualMachine>

Create the Virtual Machine

With the link of the VM template in the entity, you can instantiate the VM at the URL of the virtualmachines link from the virtual appliance.

In the Abiquo API, the VM has a "uuid" attribute, a "name" attribute and a "label".  The "label" is the user friendly name that is displayed on the VM icon in the UI and by default it is the name of the template from the Apps library, with numbering of  templates used more than once. The "name" attribute is the name of the VM in the hypervisor.  

In general, you can add links to VM resources to your VM data object, for example, to create a VM with a hardware profile, add the link to the hardware profile.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines 

Roles Required: VDC_MANAGE_VAPP
Request Headers: Accept:  application/vnd.abiquo.virtualmachine+json; version=4.4; application/vnd.abiquo.virtualmachine+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachine+json; version=4.4; application/vnd.abiquo.virtualmachine+xml; version=4.4;  
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VirtualMachine Media Type 
Response Message Body Entity: VirtualMachine Media Type 
Request Example:

Create a virtual machine

 Click here to show or hide the request example
POST_cld_vdcs_X_vapps_X_vms_CT_vm_j_AC_vm_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969", 
      "rel": "enterprise"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969/datacenterrepositories/3383/virtualmachinetemplates/1672", 
      "rel": "virtualmachinetemplate"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 4, 
  "highDisponibility": 0, 
  "creationTimestamp": 0, 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "Template", 
  "idState": 0, 
  "protected": false, 
  "type": "NOT_MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

{
  "description": "RZtkUStbPkIXdDSpHFQWJxWQbHonUHrpiKUFwcHbtseEaUZkGcErUbRfeENvCHPACZGbwzBCczsIsOZeQSjnDCkwNFGPIZuInzipUksPTmJQcfBzEGmhMsXrgvIhSsRETStFLWtDzCnPexilFqguXImYOhmZUwGDETtGBpTTJdSrNXyOAxhgEhGCWqFNXirsrWCWAzXCcdAPxnvqggPIZRzUmFkCmjFRYBFdxLOMPxFMUNmMYzLOliSaDSHdiZK", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "ABQ_b30886d1-300a-4654-af0c-58551953eaac"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "2"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969/users/4165", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "5 6"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "8"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "10"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "NOT_ALLOCATED"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/disks/9250", 
      "rel": "disk0", 
      "title": "8e6b631e-9241-4ae4-b10e-f0ee59f972a2", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "TestHypervisor"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969/datacenterrepositories/3383/virtualmachinetemplates/1672", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "14"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/1648", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "13"
    }
  ], 
  "vdrpPort": 0, 
  "variables": {}, 
  "ram": 4, 
  "fqdn": "abq-b30886d1-300a-4654-af0c-58551953eaac.localdomain", 
  "highDisponibility": 0, 
  "password": "4TmB4Wgf", 
  "creationTimestamp": 1512487717000, 
  "id": 1253, 
  "name": "ABQ_b30886d1-300a-4654-af0c-58551953eaac", 
  "idType": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "uuid": "b30886d1-300a-4654-af0c-58551953eaac", 
  "idState": 1, 
  "vdrpEnabled": false, 
  "state": "NOT_ALLOCATED", 
  "protected": false, 
  "type": "MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Create a virtual machine using hardware profiles

 Click here to show/hide the request example


POST_cld_vdcs_X_vapps_X_vms_CT_vm_j_AC_vm_j.0034.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/4028", 
      "rel": "enterprise"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4028/datacenterrepositories/3439/virtualmachinetemplates/1725", 
      "rel": "virtualmachinetemplate"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3439/hardwareprofiles/206", 
      "rel": "hardwareprofile"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 68, 
  "highDisponibility": 0, 
  "creationTimestamp": 0, 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "Template", 
  "idState": 0, 
  "protected": false, 
  "type": "NOT_MANAGED", 
  "cpu": 3, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "ABQ_a43d2588-d4e6-4748-a108-e141610a29dc"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4028", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "23054"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4028/users/4221", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "23057 23058"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "23060"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "23062"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "NOT_ALLOCATED"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3439/hardwareprofiles/206", 
      "type": "application/vnd.abiquo.hardwareprofile+json", 
      "rel": "hardwareprofile", 
      "title": "23078"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/disks/14394", 
      "rel": "disk0", 
      "title": "f28cc9fb-bf1f-4a41-b9c7-c98545bdc5cf", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2388/virtualappliances/1263/virtualmachines/1294/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "TestHypervisor"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4028/datacenterrepositories/3439/virtualmachinetemplates/1725", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "23066"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/1701", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "23065"
    }
  ], 
  "vdrpPort": 0, 
  "variables": {}, 
  "ram": 68, 
  "fqdn": "abq-a43d2588-d4e6-4748-a108-e141610a29dc.localdomain", 
  "highDisponibility": 0, 
  "password": "fCuY8oeV", 
  "creationTimestamp": 1512487732000, 
  "id": 1294, 
  "name": "ABQ_a43d2588-d4e6-4748-a108-e141610a29dc", 
  "idType": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "uuid": "a43d2588-d4e6-4748-a108-e141610a29dc", 
  "idState": 1, 
  "vdrpEnabled": false, 
  "state": "NOT_ALLOCATED", 
  "protected": false, 
  "type": "MANAGED", 
  "cpu": 3, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Create a virtual machine with hard disks

 Click here to show/hide the request example


POST_cld_vdcs_X_vapps_X_vms_CT_vm_j_AC_vm_j.0026.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/4012", 
      "rel": "enterprise"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4012/datacenterrepositories/3422/virtualmachinetemplates/1709", 
      "rel": "virtualmachinetemplate"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/disks/13610", 
      "type": "application/vnd.abiquo.harddisk+json", 
      "rel": "disk3"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/disks/13611", 
      "type": "application/vnd.abiquo.harddisk+json", 
      "rel": "disk4"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3422/datastoretiers/691", 
      "rel": "datastoretier2"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3422/datastoretiers/690", 
      "rel": "datastoretier3"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 4, 
  "highDisponibility": 0, 
  "creationTimestamp": 0, 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "vm", 
  "idState": 0, 
  "protected": false, 
  "type": "NOT_MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "ABQ_68de9f29-9e46-4730-ba35-1526f45ac180"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4012", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "19516"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4012/users/4205", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "19519 19520"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "19522"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "19524"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "NOT_ALLOCATED"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "3187", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/disks/13610", 
      "rel": "disk3", 
      "title": "2665ca36-a887-4166-a303-087c4759557b", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3422/datastoretiers/690", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier3", 
      "title": "19534"
    }, 
    {
      "length": "3195", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/disks/13611", 
      "rel": "disk4", 
      "title": "77d7410d-5a91-463a-a843-a9d2c291abe9", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3422/datastoretiers/691", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier4", 
      "title": "19536"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/disks/13612", 
      "rel": "disk0", 
      "title": "3a6b39b3-7630-4ece-a569-9d35c9363b5c", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3422/datastoretiers/690", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier0", 
      "title": "19534"
    }, 
    {
      "length": "19541", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/disks/13613", 
      "rel": "disk1", 
      "title": "7fc8a9a5-9719-441b-a3c0-96851f091d11", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3422/datastoretiers/691", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier1", 
      "title": "19536"
    }, 
    {
      "length": "19545", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/disks/13614", 
      "rel": "disk2", 
      "title": "a69613d1-8889-44bf-baf8-0b07fa388702", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3422/datastoretiers/691", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier2", 
      "title": "19536"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2372/virtualappliances/1247/virtualmachines/1285/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "TestHypervisor"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4012/datacenterrepositories/3422/virtualmachinetemplates/1709", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "19528"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/1685", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "19527"
    }
  ], 
  "vdrpPort": 0, 
  "variables": {}, 
  "ram": 4, 
  "fqdn": "abq-68de9f29-9e46-4730-ba35-1526f45ac180.localdomain", 
  "highDisponibility": 0, 
  "password": "I4RE6sMt", 
  "creationTimestamp": 1512487728000, 
  "id": 1285, 
  "name": "ABQ_68de9f29-9e46-4730-ba35-1526f45ac180", 
  "idType": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "uuid": "68de9f29-9e46-4730-ba35-1526f45ac180", 
  "idState": 1, 
  "vdrpEnabled": false, 
  "state": "NOT_ALLOCATED", 
  "protected": false, 
  "type": "MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Create a virtual machine with a NIC

 Click here to show/hide the request example


POST_cld_vdcs_X_vapps_X_vms_CT_vm_j_AC_vm_j.0038.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/4036", 
      "rel": "enterprise"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4036/datacenterrepositories/3447/virtualmachinetemplates/1733", 
      "rel": "virtualmachinetemplate"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/privatenetworks/1203/ips/14398", 
      "type": "application/vnd.abiquo.privateip+json", 
      "rel": "nic0"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 4, 
  "highDisponibility": 0, 
  "creationTimestamp": 0, 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "Template", 
  "idState": 0, 
  "protected": false, 
  "type": "NOT_MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "ABQ_f8dcab0f-8492-42a2-ad60-a41af6be4e16"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4036", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "23280"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4036/users/4229", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "23283 23284"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "23286"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "23288"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "NOT_ALLOCATED"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/disks/14652", 
      "rel": "disk0", 
      "title": "3e96fe25-d496-41ae-b664-4183c26cf28f", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/privatenetworks/1203/ips/14398", 
      "type": "application/vnd.abiquo.privateip+json", 
      "rel": "nic0", 
      "title": "192.168.1.1"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2396/virtualappliances/1271/virtualmachines/1299/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "TestHypervisor"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4036/datacenterrepositories/3447/virtualmachinetemplates/1733", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "23292"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/1709", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "23291"
    }
  ], 
  "vdrpPort": 0, 
  "variables": {}, 
  "ram": 4, 
  "fqdn": "abq-f8dcab0f-8492-42a2-ad60-a41af6be4e16.localdomain", 
  "highDisponibility": 0, 
  "password": "ORM3JcEN", 
  "creationTimestamp": 1512487734000, 
  "id": 1299, 
  "name": "ABQ_f8dcab0f-8492-42a2-ad60-a41af6be4e16", 
  "idType": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "uuid": "f8dcab0f-8492-42a2-ad60-a41af6be4e16", 
  "idState": 1, 
  "vdrpEnabled": false, 
  "state": "NOT_ALLOCATED", 
  "protected": false, 
  "type": "MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Create a virtual machine with firewall policies

 Click here to show/hide the request example


POST_cld_vdcs_X_vapps_X_vms_CT_vm_j_AC_vm_j.0033.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/4027", 
      "rel": "enterprise"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4027/datacenterrepositories/3438/virtualmachinetemplates/1724", 
      "rel": "virtualmachinetemplate"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3438/devices/976/firewalls/445", 
      "rel": "firewall"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3438/devices/976/firewalls/446", 
      "rel": "firewall"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 4, 
  "highDisponibility": 0, 
  "creationTimestamp": 0, 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "Template", 
  "idState": 0, 
  "protected": false, 
  "type": "NOT_MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "ABQ_97093076-bdf9-4c8d-bbd8-f65962e3ab41"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4027", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "22006"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4027/users/4220", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "22009 22010"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "22012"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "22014"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "NOT_ALLOCATED"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3438/devices/976/firewalls/445", 
      "type": "application/vnd.abiquo.firewallpolicy+json", 
      "rel": "firewall", 
      "title": "22028"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3438/devices/976/firewalls/446", 
      "type": "application/vnd.abiquo.firewallpolicy+json", 
      "rel": "firewall", 
      "title": "22029"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/disks/14393", 
      "rel": "disk0", 
      "title": "55381ae1-caaa-42e7-ba1e-5b8e37a94001", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2387/virtualappliances/1262/virtualmachines/1293/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "TestHypervisor"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4027/datacenterrepositories/3438/virtualmachinetemplates/1724", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "22018"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/1700", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "22017"
    }
  ], 
  "vdrpPort": 0, 
  "variables": {}, 
  "ram": 4, 
  "fqdn": "abq-97093076-bdf9-4c8d-bbd8-f65962e3ab41.localdomain", 
  "highDisponibility": 0, 
  "password": "E03ZhFjf", 
  "creationTimestamp": 1512487732000, 
  "id": 1293, 
  "name": "ABQ_97093076-bdf9-4c8d-bbd8-f65962e3ab41", 
  "idType": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "uuid": "97093076-bdf9-4c8d-bbd8-f65962e3ab41", 
  "idState": 1, 
  "vdrpEnabled": false, 
  "state": "NOT_ALLOCATED", 
  "protected": false, 
  "type": "MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}


Create a virtual machine for Amazon

This example shows how to create a virtual machine for AWS. Before you create a VM, import the AMI template details into the Apps library. Hardware profiles are imported when the user adds cloud provider credentials and automatically enabled for the enterprise.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines
Roles Required: VDC_MANAGE_VAPP
Request Headers: Accept:  application/vnd.abiquo.virtualmachine+json; version=4.4; application/vnd.abiquo.virtualmachine+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachinewithnode+json; version=4.4; application/vnd.abiquo.virtualmachinewithnode+xml; version=4.4;  
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VirtualMachine Media Type 
Response Message Body Entity: VirtualMachine Media Type 
Request Example:

 Click here to show or hide the request example
curl -X POST 'https://mjsabiquo.bcn.abiquo.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines' \
	-H 'Content-Type: application/vnd.abiquo.virtualmachine+json;version=4.0' \
	-H 'Accept: application/vnd.abiquo.virtualmachine+json;version=4.0' \
	-d '{ 
   "label":"amzn-ami-hvm-2016.09.1.20170119-x86_64-gp2",
   "links":[  
      {  
         "title":"amzn-ami-hvm-2016.09.1.20170119-x86_64-gp2",
         "rel":"virtualmachinetemplate",
         "type":"application/vnd.abiquo.virtualmachinetemplate+json",
         "href":"https://example.com/api/admin/enterprises/1/datacenterrepositories/3/virtualmachinetemplates/170"
      },
      {  
         "title":"t2.nano",
         "rel":"hardwareprofile",
         "type":"application/vnd.abiquo.hardwareprofile+json",
         "href":"https://example.com/api/cloud/locations/3/hardwareprofiles/79"
      }
   ],
   "vdrpEnabled":false
}'
	-u user:password -- verbose \

Success status code: 201

Response example:

{
   "id":61,
   "uuid":"7f57f039-6c3c-4f14-9cc9-92d716623705",
   "name":"ABQ_7f57f039-6c3c-4f14-9cc9-92d716623705",
   "label":"amzn-ami-hvm-2016.09.1.20170119-x86_64-gp2",
   "cpu":1,
   "ram":512,
   "vdrpEnabled":false,
   "vdrpPort":0,
   "idState":1,
   "state":"NOT_ALLOCATED",
   "idType":0,
   "type":"MANAGED",
   "highDisponibility":0,
   "password":"DI9pcnE9",
   "metadata":null,
   "monitored":false,
   "protected":false,
   "variables":{
   },
   "creationTimestamp":1490866898000,
   "backuppolicies":[
   ],
   "links":[
      {
         "title":"ABQ_7f57f039-6c3c-4f14-9cc9-92d716623705",
         "rel":"edit",
         "type":"application/vnd.abiquo.virtualmachine+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61"
      },
      {
         "title":"Abiquo",
         "rel":"enterprise",
         "type":"application/vnd.abiquo.enterprise+json",
         "href":"https://example.com/api/admin/enterprises/1"
      },
      {
         "title":"Cloud Administrator",
         "rel":"user",
         "type":"application/vnd.abiquo.user+json",
         "href":"https://example.com/api/admin/enterprises/1/users/1"
      },
      {
         "title":"awseuwest1",
         "rel":"virtualdatacenter",
         "type":"application/vnd.abiquo.virtualdatacenter+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3"
      },
      {
         "title":"awesomewest",
         "rel":"virtualappliance",
         "type":"application/vnd.abiquo.virtualappliance+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12"
      },
      {
         "title":"metadata",
         "rel":"metadata",
         "type":"application/vnd.abiquo.metadata+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/metadata"
      },
      {
         "title":"vlan network configurations",
         "rel":"configurations",
         "type":"application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/network/configurations"
      },
      {
         "title":"nics",
         "rel":"nics",
         "type":"application/vnd.abiquo.nics+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/network/nics"
      },
      {
         "title":"disks",
         "rel":"harddisks",
         "type":"application/vnd.abiquo.harddisks+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/storage/disks"
      },
      {
         "title":"NOT_ALLOCATED",
         "rel":"state",
         "type":"application/vnd.abiquo.virtualmachinestate+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/state"
      },
      {
         "title":"virtual machine undeploy",
         "rel":"undeploy",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/action/undeploy"
      },
      {
         "title":"virtual machine deploy",
         "rel":"deploy",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/action/deploy"
      },
      {
         "title":"virtual machine reset",
         "rel":"reset",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/action/reset"
      },
      {
         "title":"virtual machine snapshot",
         "rel":"instance",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/action/instance"
      },
      {
         "title":"remote access",
         "rel":"rdpaccess",
         "type":"text/plain",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/config/rdpaccess"
      },
      {
         "title":"tasks",
         "rel":"tasks",
         "type":"application/vnd.abiquo.tasks+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/tasks"
      },
      {
         "title":"firewalls",
         "rel":"firewalls",
         "type":"application/vnd.abiquo.links+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/firewalls"
      },
      {
         "title":"load balancers",
         "rel":"loadbalancers",
         "type":"application/vnd.abiquo.loadbalancers+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/loadbalancers"
      },
      {
         "title":"request on demand backup",
         "rel":"requestbackup",
         "type":"application/vnd.abiquo.ondemandbackup+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/backup/action/request"
      },
      {
         "title":"request a restore of a backup",
         "rel":"requestrestore",
         "type":"application/vnd.abiquo.restore+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/backup/action/restore"
      },
      {
         "title":"volumes",
         "rel":"volumes",
         "type":"application/vnd.abiquo.volumes+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/storage/volumes"
      },
      {
         "title":"t2.nano",
         "rel":"hardwareprofile",
         "type":"application/vnd.abiquo.hardwareprofile+json",
         "href":"https://example.com/api/cloud/locations/3/hardwareprofiles/79"
      },
      {
         "diskControllerType":"IDE",
         "length":"8192",
         "title":"66df00e9-b62f-46a8-a023-3621a24ce184",
         "rel":"disk0",
         "type":"application/vnd.abiquo.harddisk+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/disks/55"
      },
      {
         "title":"protect",
         "rel":"protect",
         "type":"text/plain",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/action/protect"
      },
      {
         "title":"unprotect",
         "rel":"unprotect",
         "type":"text/plain",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/action/unprotect"
      },
      {
         "title":"metrics",
         "rel":"metrics",
         "type":"application/vnd.abiquo.metrics+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/metrics"
      },
      {
         "title":"metricsmetadata",
         "rel":"metricsmetadata",
         "type":"application/vnd.abiquo.metricsmetadata+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/metrics"
      },
      {
         "title":"createcustommetric",
         "rel":"createcustommetric",
         "type":"application/vnd.abiquo.custommetric+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/metrics"
      },
      {
         "title":"enablemonitoringlevel",
         "rel":"enablemonitoringlevel",
         "type":"application/vnd.abiquo.monitoringlevel+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/enablemonitoringlevel"
      },
      {
         "title":"enablemonitoring",
         "rel":"enablemonitoring",
         "type":"",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/enablemonitoring"
      },
      {
         "title":"collectd",
         "rel":"collectd",
         "type":"application/json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/collectd"
      },
      {
         "title":"alarms",
         "rel":"alarms",
         "type":"application/vnd.abiquo.alarms+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/alarms"
      },
      {
         "title":"actionplans",
         "rel":"actionplans",
         "type":"application/vnd.abiquo.virtualmachineactionplans+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/actionplans"
      },
      {
         "title":"actionplansflat",
         "rel":"actionplansflat",
         "type":"application/vnd.abiquo.virtualmachineactionplansflat+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/actionplans"
      },
      {
         "title":"clone",
         "rel":"clone",
         "type":"application/vnd.abiquo.virtualmachinecloneoptions+json",
         "href":"https://example.com/api/cloud/virtualdatacenters/3/virtualappliances/12/virtualmachines/61/action/clone"
      },
      {
         "title":"Amazon",
         "rel":"hypervisortype",
         "type":"application/vnd.abiquo.hypervisortype+json",
         "href":"https://example.com/api/config/hypervisortypes/AMAZON"
      },
      {
         "title":"amzn-ami-hvm-2016.09.1.20170119-x86_64-gp2",
         "rel":"virtualmachinetemplate",
         "type":"application/vnd.abiquo.virtualmachinetemplate+json",
         "href":"https://example.com/api/admin/enterprises/1/datacenterrepositories/3/virtualmachinetemplates/170"
      },
      {
         "title":"Others",
         "rel":"category",
         "type":"application/vnd.abiquo.category+json",
         "href":"https://example.com/api/config/categories/1"
      }
   ]
}

 

Capture a virtual machine

This method requires a VM that has already been imported (also called retrieved) into Abiquo from the host.

It captures the VM into a virtual appliance so that it can be managed by Abiquo.

It requires a link to the imported VM, which means a link from infrastructure (host/api/datacenters/*/rask/*/machines/*/virtualmachines/*).

The resources:

  • External volumes are not supported for capture
  • Disks need the correct size in the correct sequence 
  • NICs need a link of a vlan (any type of VLAN) and an ip value of this vlan. If you are working with a network that is not a private network, the VLAN tags assigned to the VM in the platform must match the ones used in the hypervisor.

Note: It might be useful to use this get virtualmachineflat call to retrieve all the information from the remote VM, then complete the result dto in order to use it as the content of this request. 

See also the tutorial on Capture a VM via API

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines 
Roles Required: VDC_MANAGE_VAPP
Request Headers: Accept:  application/vnd.abiquo.virtualmachineflat+json; version=4.4; application/vnd.abiquo.virtualmachineflat+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachineflat+json; version=4.4; application/vnd.abiquo.virtualmachineflat+xml; version=4.4;  
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VirtualMachineFlat Media Type 
Response Message Body Entity: VirtualMachineFlat Media Type 
Request Example:

 Click here to show or hide the request example

POST_cld_vdcs_X_vapps_X_vms_CT_vm_j_AC_vm_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969", 
      "rel": "enterprise"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969/datacenterrepositories/3383/virtualmachinetemplates/1672", 
      "rel": "virtualmachinetemplate"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 4, 
  "highDisponibility": 0, 
  "creationTimestamp": 0, 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "Template", 
  "idState": 0, 
  "protected": false, 
  "type": "NOT_MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

{
  "description": "RZtkUStbPkIXdDSpHFQWJxWQbHonUHrpiKUFwcHbtseEaUZkGcErUbRfeENvCHPACZGbwzBCczsIsOZeQSjnDCkwNFGPIZuInzipUksPTmJQcfBzEGmhMsXrgvIhSsRETStFLWtDzCnPexilFqguXImYOhmZUwGDETtGBpTTJdSrNXyOAxhgEhGCWqFNXirsrWCWAzXCcdAPxnvqggPIZRzUmFkCmjFRYBFdxLOMPxFMUNmMYzLOliSaDSHdiZK", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "ABQ_b30886d1-300a-4654-af0c-58551953eaac"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "2"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969/users/4165", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "5 6"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "8"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "10"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "NOT_ALLOCATED"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/disks/9250", 
      "rel": "disk0", 
      "title": "8e6b631e-9241-4ae4-b10e-f0ee59f972a2", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2335/virtualappliances/1210/virtualmachines/1253/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "TestHypervisor"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3969/datacenterrepositories/3383/virtualmachinetemplates/1672", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "14"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/1648", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "13"
    }
  ], 
  "vdrpPort": 0, 
  "variables": {}, 
  "ram": 4, 
  "fqdn": "abq-b30886d1-300a-4654-af0c-58551953eaac.localdomain", 
  "highDisponibility": 0, 
  "password": "4TmB4Wgf", 
  "creationTimestamp": 1512487717000, 
  "id": 1253, 
  "name": "ABQ_b30886d1-300a-4654-af0c-58551953eaac", 
  "idType": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "uuid": "b30886d1-300a-4654-af0c-58551953eaac", 
  "idState": 1, 
  "vdrpEnabled": false, 
  "state": "NOT_ALLOCATED", 
  "protected": false, 
  "type": "MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

 

Get a task on a virtual machine

Displays a specific task on the VM. Tasks are a set of jobs (operations on hypervisors). Any of these tasks may still be in progress. Every task has a UUID.

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/tasks/{id} 
Roles Required: VDC_ENUMERATE,VDC_MANAGE_VAPP,VAPP_CUSTOMISE_SETTINGS,VAPP_ASSIGN_NETWORK,VAPP_PERFORM_ACTIONS,VAPP_DEPLOY_UNDEPLOY, VAPP_CREATE_INSTANCE,VAPP_ASSIGN_VOLUME,MANAGE_HARD_DISKS, VAPP_CREATE_STATEFUL
Request Headers: Accept:  application/vnd.abiquo.task+json; version=4.4; application/vnd.abiquo.task+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: Task Media Type 
Request Example:

 Click here to show or hide the request example

GET_cld_vdcs_X_vapps_X_vms_X_tsks_X_AC_tsk_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/1828/virtualappliances/839/virtualmachines/867/tasks/c27d9858-7fb3-456b-8ef6-20e62cae72c6 \ 
	 -H 'Accept:application/vnd.abiquo.task+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "creationTimestamp": 1512487622, 
  "jobs": {
    "links": [], 
    "collection": [
      {
        "type": "SCHEDULE", 
        "description": "Deploy task's schedule on virtual machine with id 867", 
        "links": [], 
        "parentTaskId": "c27d9858-7fb3-456b-8ef6-20e62cae72c6", 
        "rollbackState": "UNKNOWN", 
        "state": "PENDING", 
        "timestamp": 1512487622, 
        "creationTimestamp": 1512487622, 
        "id": "c27d9858-7fb3-456b-8ef6-20e62cae72c6.a78308d6-1d88-4b3e-8e17-0ea7f1d654ad"
      }, 
      {
        "type": "CONFIGURE", 
        "description": "Deploy task's configure on virtual machine with id 867", 
        "links": [], 
        "parentTaskId": "c27d9858-7fb3-456b-8ef6-20e62cae72c6", 
        "rollbackState": "UNKNOWN", 
        "state": "PENDING", 
        "timestamp": 1512487622, 
        "creationTimestamp": 1512487622, 
        "id": "c27d9858-7fb3-456b-8ef6-20e62cae72c6.e372aae1-6ef9-490a-a3dc-6777dc0bd3bd"
      }, 
      {
        "type": "POWER_ON", 
        "description": "Deploy task's power on on virtual machine with id 867", 
        "links": [], 
        "parentTaskId": "c27d9858-7fb3-456b-8ef6-20e62cae72c6", 
        "rollbackState": "UNKNOWN", 
        "state": "PENDING", 
        "timestamp": 1512487622, 
        "creationTimestamp": 1512487622, 
        "id": "c27d9858-7fb3-456b-8ef6-20e62cae72c6.411f62cb-16e6-4292-8f65-fdc3851448a4"
      }
    ]
  }, 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1828/virtualappliances/839/virtualmachines/867/tasks/c27d9858-7fb3-456b-8ef6-20e62cae72c6", 
      "rel": "self"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1828/virtualappliances/839/virtualmachines/867/tasks", 
      "rel": "parent"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1828/virtualappliances/839/virtualmachines/867/tasks/c27d9858-7fb3-456b-8ef6-20e62cae72c6/action/cancel", 
      "rel": "cancel"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1828/virtualappliances/839/virtualmachines/867/tasks/c27d9858-7fb3-456b-8ef6-20e62cae72c6/action/continue", 
      "rel": "continue"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/3387/users/3532", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "sysadmin"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1828/virtualappliances/839/virtualmachines/867", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "virtualmachine", 
      "title": "allocatedVM"
    }
  ], 
  "timestamp": 1512487622, 
  "userId": "3532", 
  "state": "QUEUEING", 
  "taskId": "c27d9858-7fb3-456b-8ef6-20e62cae72c6", 
  "ownerId": "867", 
  "type": "DEPLOY"
}

Get a virtual machine

Retrieve the virtual machine from the cloud virtual datacenters and virtual appliances path.

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine} 
Roles Required: VDC_ENUMERATE,VDC_MANAGE_VAPP,VAPP_CUSTOMISE_SETTINGS,VAPP_ASSIGN_NETWORK,VAPP_PERFORM_ACTIONS,VAPP_DEPLOY_UNDEPLOY,VAPP_CREATE_STATEFUL, VAPP_ASSIGN_VOLUME,MANAGE_HARD_DISKS,VAPP_CREATE_INSTANCE
Request Headers: Accept:  application/vnd.abiquo.virtualmachine+json; version=4.4; application/vnd.abiquo.virtualmachine+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: VirtualMachine Media Type 
Request Example:

 Click here to show or hide the request example

GET_cld_vdcs_X_vapps_X_vms_X_AC_vm_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4 \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/datacenters/4/racks/2/machines/2", 
      "type": "application/vnd.abiquo.machine+json", 
      "rel": "machine", 
      "title": "ONE"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/4", 
      "type": "application/vnd.abiquo.datacenter+json", 
      "rel": "location", 
      "title": "6"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "allocatedVM"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/4/racks/2/machines/2/virtualmachines/4/action/sendmail", 
      "type": "application/vnd.abiquo.mail+json", 
      "rel": "sendmail", 
      "title": "send mail"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/6", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "0"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/6/users/6", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "3 4"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "41"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "89"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "OFF"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "98", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/volumes/30", 
      "rel": "disk1", 
      "title": "vol0", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.volume+json", 
      "diskController": "100"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/disks/29", 
      "rel": "disk0", 
      "title": "9ecdb726-583e-47c6-90e6-0b0f165ba1f4", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json", 
      "diskLabel": "97"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/4/datastoretiers/2", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier0", 
      "title": "39"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/privatenetworks/3/ips/19", 
      "type": "application/vnd.abiquo.privateip+json", 
      "rel": "nic0", 
      "title": "10.60.1.24"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/ONE", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "ONE"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/6/datacenterrepositories/4/virtualmachinetemplates/4", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "86"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/9", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "85"
    }
  ], 
  "vdrpPort": 0, 
  "variables": {}, 
  "ram": 4, 
  "highDisponibility": 0, 
  "natrules": [], 
  "creationTimestamp": 1520513456000, 
  "id": 4, 
  "name": "allocatedVM", 
  "idType": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "uuid": "48551474-d7b7-4160-9213-6aa79e486a3d", 
  "idState": 6, 
  "vdrpEnabled": true, 
  "state": "OFF", 
  "protected": false, 
  "lastSynchronize": 1520513456000, 
  "type": "MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Delete a virtual machine

A VM can be deleted if its state is DEPLOYED, NOT_ALLOCATED or UNKNOWN.

If the VM exists in the hypervisor, it will be removed from the hypervisor as well.

  • If the VM is deployed, the delete operation will return a 202 and a link to a task.

If the VM is not deployed, a successful request will return a status code of 204 no content.

  • If the VM is in the unknown state, there may have been a lost connection with the hypervisor, so the administrator should also check the hypervisor. 

Synopsis: DELETE http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine} 
Roles Required: VDC_MANAGE_VAPP
Request Headers: Accept: ; Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

force

no

no

Force delete of the virtual machine in Abiquo, even if the delete cannot be performed in the provider due to missing or invalid credentials

Response Message Body Entity:  
Request Example:

 Click here to show or hide the request example

Delete a virtual machine that is not deployed

DELETE_cld_vdcs_X_vapps_X_vms_X.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/cloud/virtualdatacenters/2181/virtualappliances/1056/virtualmachines/1097 \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Delete a virtual machine with force option

DELETE_cld_vdcs_X_vapps_X_vms_X_force_T.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/cloud/virtualdatacenters/2474/virtualappliances/1382/virtualmachines/1385?force=true \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Delete a virtual machine that is deployed

DELETE_cld_vdcs_X_vapps_X_vms_X_AC_text_j.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/cloud/virtualdatacenters/77/virtualappliances/78/virtualmachines/80 \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

--none--

Response payload:

{"message":"You can keep track of the progress in the link","links":[{"rel":"status","href":"http://localhost:9009/api/cloud/virtualdatacenters/77/virtualappliances/78/virtualmachines/80/tasks/01e60755-661c-455e-b1af-f61bee9c0567"}]}

Release a captured virtual machine

Returns a captured virtual machine into the imported state, which means that the virtual machine won't be managed by Abiquo and it is ready to be captured again.

Note 1: This feature is also useful as "undo capture" if the VM was been captured into a incorrect virtual appliance or with incorrect networks.

Note 2: This request only differs from the delete action in the release query parameter, so if you forget it or give it the value false the VM will be deleted instead of released.

Synopsis: DELETE http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine} 
Roles Required: VDC_MANAGE_VAPP
Request Headers: Accept: ; Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

release

true 

false

Convertes the delete action into a release action 

Request Message Body Entity: 
Response Message Body Entity: 
Request Example:

 Click here to show or hide the request example

DELETE_cld_vdcs_X_vapps_X_vms_X_release_T.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/cloud/virtualdatacenters/100/virtualappliances/101/virtualmachines/103?release=true \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Deploy a virtual machine

Deploys the VM by launching it into the hypervisor or public cloud provider. This call returns a 202 HTTP code (accepted) and a URI where you can keep track of the deploy.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/action/deploy 
Roles Required: VAPP_DEPLOY_UNDEPLOY
Request Headers: Accept:  application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

force

NO

false

Possible values are "true" or "false". If "true", soft limits of virtual datacenters could be surpassed.

Request Message Body Entity: 
Response Message Body Entity: AcceptedRequest Media Type 
Request Example:

 Click here to show or hide the request example

POST_cld_vdcs_X_vapps_X_vms_X_act_deploy_AC_acrq_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2185/virtualappliances/1060/virtualmachines/1101/action/deploy \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

--none--

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2185/virtualappliances/1060/virtualmachines/1101/tasks/83ec63cf-1e5a-444c-ac75-51c2796300cd", 
      "rel": "status"
    }
  ]
}

Deploy a Virtual Machine example
curl --verbose -X POST -u user:password 'http://example.com/api/cloud/virtualdatacenters/4/virtualappliances/3/virtualmachines/1/action/deploy?force=true'
* About to connect() to example.com port 80 (#0)
* Trying example.com... % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected
* Connected to example.com (example.com) port 80 (#0)
* Server auth using Basic with user 'user'
> POST /api/cloud/virtualdatacenters/4/virtualappliances/3/virtualmachines/1/action/deploy HTTP/1.1
> Authorization: Basic YWRtaaLLSDFKLSADFeGFiaXF1bw==
> User-Agent: curl/7.21.7 (x86_64-apple-darwin10.8.0) libcurl/7.21.7 OpenSSL/1.0.0d zlib/1.2.5 libidn/1.22
> Host: example.com

< HTTP/1.1 202 Accepted
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaaLLSDFKLSADFMTMwMjc3MjE5MzQ5NDozYzMwZmFlNGIwMDJkYWZjMjA2ZTQyNDAwOTFkYTkwNw; Expires=Thu, 14-Nov-2011 09:09:53 GMT; Path=/api
< Set-Cookie: JSESSIONID=AECBF199F8F60E25F2B93FCE64AF784B; Path=/api
< Date: Thu, 14 Nov 2011 08:39:55 GMT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<acceptedrequest>
  <link href="http://example.com/api/cloud/virtualdatacenters/4/virtualappliances/3/virtualmachines/1/tasks/169f1877-5f17-4f62-9563-974001295c54" rel=”task"/>
</acceptedrequest>



Get the bootstrap configuration of a virtual machine

Retrieve bootstrap configuration of a VM, which is the Chef runlist. Note: to add a configuration to VM for use with cloud-init, use VM metadata. For more information see the API tutorial on Manage virtual machine metadata via API

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/config/runlist 
Roles Required: ONE_TIME
Request Headers: Accept:  application/vnd.abiquo.extended-bootstrap+json; version=4.4; application/vnd.abiquo.extended-bootstrap+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: Bootstrap Media Type 
Request Example:

 Click here to show or hide the request example
GET_cld_vdcs_X_vapps_X_vms_X_cfg_runlst_AC_runlstelements_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/2268/virtualappliances/1143/virtualmachines/1184/config/runlist \ 
	 -H 'Accept:application/vnd.abiquo.runlistelements+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": [
    {
      "priority": 33, 
      "selected": true, 
      "name": "recipe[0]", 
      "links": [], 
      "description": "description"
    }, 
    {
      "priority": 36, 
      "selected": true, 
      "name": "recipe[1]", 
      "links": [], 
      "description": "description"
    }
  ]
}

 

Retrieve bootstrap configuration for Virtual Machine example
curl --verbose 'http://example.com/api/cloud/virtualdatacenters/4/virtualappliances/3/virtualmachines/1/config/runlist' -X GET -u "user:password"
> GET /api/cloud/virtualdatacenters/4/virtualappliances/3/virtualmachines/1/config/runlist HTTP/1.1
> Authorization: Basic YWRtaaLLSDFKLSADFeGFiaXF1bw== > User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: example.com
> Accept: */*

< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=ADE28672605A34711A2E4F8B5A0618A3; Path=/api; HttpOnly
< Content-Type: application/atom+xml < Content-Length: 432 < Date: Wed, 01 Dec 2010 13:55:57 GMT
<
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<runlist>
    <element>
        <name>recipe[openssh]</name>
        <description>Installs openssh</description>
        <priority>0</priority>
        <selected>true</selected>
    </element>
</runlist>


List tasks for a virtual machine

Displays the tasks on the VM. Tasks are a set of jobs (operations on hypervisors). Any of these tasks may still be in progress.

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}//tasks 
Roles Required: VDC_ENUMERATE,VDC_MANAGE_VAPP,VAPP_CUSTOMISE_SETTINGS,VAPP_ASSIGN_NETWORK,VAPP_PERFORM_ACTIONS,VAPP_DEPLOY_UNDEPLOY, VAPP_CREATE_INSTANCE,VAPP_ASSIGN_VOLUME,MANAGE_HARD_DISKS, VAPP_CREATE_STATEFUL
Request Headers: Accept:  application/vnd.abiquo.tasks+json; version=4.4; application/vnd.abiquo.tasks+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: Tasks Media Type 
Request Example:

 Click here to show or hide the request example

GET_cld_vdcs_X_vapps_X_vms_X_tsks_AC_tsks_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/2764/virtualappliances/1547/virtualmachines/1571/tasks \ 
	 -H 'Accept:application/vnd.abiquo.tasks+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2764/virtualappliances/1547/virtualmachines/1571/tasks", 
      "rel": "self"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2764/virtualappliances/1547/virtualmachines/1571", 
      "rel": "parent"
    }
  ], 
  "collection": [
    {
      "creationTimestamp": 1512487868, 
      "jobs": {
        "links": [], 
        "collection": [
          {
            "type": "POWER_ON", 
            "description": "Random description", 
            "links": [], 
            "parentTaskId": "93951902-9a8f-441d-bb17-7cb596758b4f", 
            "rollbackState": "UNKNOWN", 
            "state": "PENDING", 
            "timestamp": 1512487868, 
            "creationTimestamp": 1512487868, 
            "id": "6fe19c0f-d5e4-4229-982b-d17b716df8ba"
          }
        ]
      }, 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2764/virtualappliances/1547/virtualmachines/1571/tasks/93951902-9a8f-441d-bb17-7cb596758b4f", 
          "rel": "self"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2764/virtualappliances/1547/virtualmachines/1571/tasks", 
          "rel": "parent"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2764/virtualappliances/1547/virtualmachines/1571/tasks/93951902-9a8f-441d-bb17-7cb596758b4f/action/ack", 
          "rel": "acknowledge"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/2764/virtualappliances/1547/virtualmachines/1571", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "296"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/4977/users/5147", 
          "type": "application/vnd.abiquo.user+json", 
          "rel": "user", 
          "title": "278"
        }
      ], 
      "timestamp": 1512487868, 
      "userId": "5147", 
      "state": "FINISHED_UNSUCCESSFULLY", 
      "taskId": "93951902-9a8f-441d-bb17-7cb596758b4f", 
      "ownerId": "1571", 
      "type": "POWER_ON"
    }
  ]
}

 

Change the state of a virtual machine

The power states that can be changed to are: OFF, PAUSED, ON.

Synopsis: PUT http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/state 
Roles Required: VAPP_PERFORM_ACTIONS
Request Headers: Accept:  application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachinestate+json; version=4.4; application/vnd.abiquo.virtualmachinestate+xml; version=4.4;  
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VirtualMachineState Media Type 
Response Message Body Entity: AcceptedRequest Media Type 
Request Example:

 Click here to show or hide the request example

PUT_cld_vdcs_X_vapps_X_vms_X_state_CT_vmstate_j_AC_acrq_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/cloud/virtualdatacenters/2205/virtualappliances/1080/virtualmachines/1121/state \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinestate+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "state": "OFF", 
  "links": []
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2205/virtualappliances/1080/virtualmachines/1121/tasks/1fd663d5-1e66-4443-b94c-f78d13c9e62f", 
      "rel": "status"
    }
  ]
}

Reset a virtual machine

Power cycles a VM that is in the ON state.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/action/reset 
Roles Required: VAPP_PERFORM_ACTIONS
Request Headers: Accept:  application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: AcceptedRequest Media Type 
Request Example:

 Click here to show or hide the request example

POST_cld_vdcs_X_vapps_X_vms_X_act_reset_AC_acrq_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2210/virtualappliances/1085/virtualmachines/1126/action/reset \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

--none--

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2210/virtualappliances/1085/virtualmachines/1126/tasks/1fd663d5-1e66-4443-b94c-f78d13c9e62f", 
      "rel": "status"
    }
  ]
}

Instance a virtual machine

Create an instance of a VM (clone the disks to create a template) with the given name. In a private cloud datacenter, you can supply links to the disks that you wish to include in the instance.

This call returns a 202 HTTP code (accepted) and a URI where you can keep track of the instance task.

Send the final name for the instance in a virtual machine instance DTO, as shown in the example below.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/action/instance 
Roles Required: VAPP_CREATE_INSTANCE
Request Headers: Accept:  application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachineinstance+json; version=4.4; application/vnd.abiquo.virtualmachineinstance+xml; version=4.4;  
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VirtualMachineInstance Media Type 
Response Message Body Entity: AcceptedRequest Media Type 
Request Example:

 Ex Instance a virtual machine

POST_cld_vdcs_X_vapps_X_vms_X_act_inst_CT_vminst_j_AC_acrq_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2763/virtualappliances/1546/virtualmachines/1570/action/instance \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachineinstance+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "instanceName": "validName", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2763/virtualappliances/1546/virtualmachines/1570/storage/disks/18675", 
      "rel": "disk0"
    }
  ]
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2763/virtualappliances/1546/virtualmachines/1570/tasks/9a2e805b-3e62-4d87-bad2-8222c0b2d19b", 
      "rel": "status"
    }
  ]
}

 

Get the state of a virtual machine

Retrieve the current state of the VM. 

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/state 
Roles Required: VDC_ENUMERATE,VDC_MANAGE_VAPP,VAPP_CUSTOMISE_SETTINGS,VAPP_ASSIGN_NETWORK,VAPP_PERFORM_ACTIONS,VAPP_DEPLOY_UNDEPLOY,VAPP_CREATE_STATEFUL,VAPP_ASSIGN_VOLUME,MANAGE_HARD_DISKS,VAPP_CREATE_INSTANCE
Request Headers: Accept:  application/vnd.abiquo.virtualmachinestate+json; version=4.4; application/vnd.abiquo.virtualmachinestate+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: VirtualMachineState Media Type 
Request Example:

 Click here to show or hide the request example

GET_cld_vdcs_X_vapps_X_vms_X_state_AC_vmstate_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/2180/virtualappliances/1055/virtualmachines/1096/state \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachinestate+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "state": "LOCKED", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2180/virtualappliances/1055/virtualmachines/1096", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "parent", 
      "title": "allocatedVM"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2180/virtualappliances/1055/virtualmachines/1096/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "edit", 
      "title": "LOCKED"
    }
  ]
}

Undeploy a virtual machine

Perform an undeploy. A successful undeploy will put the VM in Abiquo into the NOT_ALLOCATED state. If the undeploy is successful, the VM will be deleted from the hypervisor. If the VM is in the ON state, Abiquo will perform a power off before the deconfigure. You can also set the forceUndeploy attribute in the VirtualMachineTask entity. If this attribute is set to true, Abiquo undeploys VMs without templates (e.g. captured virtual machines). 

This call returns a 202 HTTP code (accepted) and a URI where you can keep track of the undeploy.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/action/undeploy 
Roles Required: VAPP_DEPLOY_UNDEPLOY
Request Headers: Accept:  application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachinetask+json; version=4.4; application/vnd.abiquo.virtualmachinetask+xml; version=4.4;  
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VirtualMachineTask Media Type 
Response Message Body Entity: AcceptedRequest Media Type 
Request Example:

 Click here to show or hide the request example

Undeploy a virtual machine

POST_cld_vdcs_X_vapps_X_vms_X_act_undep_CT_vmtsk_j_AC_acrq_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2007/virtualappliances/985/virtualmachines/967/action/undeploy \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinetask+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "forceVdcLimits": false, 
  "forceEnterpriseSoftLimits": false, 
  "forceUndeploy": false, 
  "links": []
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2007/virtualappliances/985/virtualmachines/967/tasks/bb8b1e28-436e-4dc6-881d-1fb5c6dabd48", 
      "rel": "status"
    }
  ]
}

Undeploy a virtual machine with force

POST_cld_vdcs_X_vapps_X_vms_X_act_undep_CT_vmtsk_j_AC_acrq_j_force_T.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/1805/virtualappliances/1308/virtualmachines/1376/action/undeploy \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.0' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinetask+json; version=4.0' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "forceUndeploy": true
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1805/virtualappliances/1308/virtualmachines/1376/tasks/0cdfa21e-1472-4204-8950-c8dea6c7615c", 
      "rel": "status"
    }
  ]
}

 

Update a virtual machine

Modify a VM that is deployed or undeployed.

If the VM is deployed, a successful request will return a status code of 202 and an accepted request with links to follow the tasks that will modify the VM. If the VM is not deployed, then a successful request will simply update the database and return a status code of 204. 

If the VM is deployed and your environment does not support hot-add or hot-reconfigure, you may need to power off the VM before making changes.

For more information and examples of modifying a VM, please see API Tutorials, in particular for the process of adding a NIC or a hard disk to a VM. 

To add a startup script, see Manage virtual machine metadata via API.

Synopsis: PUT http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine} 
Roles Required: VAPP_CUSTOMISE_SETTINGS
Request Headers: Accept:  application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachine+json; version=4.4; application/vnd.abiquo.virtualmachine+xml; version=4.4;  
Request Parameters:

Parameter

Required

Default Value

Description

force

false

false

force to update

 

 

 

 

Request Message Body Entity: VirtualMachine Media Type 
Response Message Body Entity: AcceptedRequest Media Type 
Request Examples:

Update a virtual machine that is deployed

 Click here to expand...

PUT_cld_vdcs_X_vapps_X_vms_X_CT_vm_j_AC_acrq_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4 \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/datacenters/4/racks/2/machines/2", 
      "type": "application/vnd.abiquo.machine+json", 
      "rel": "machine", 
      "title": "ONE"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/4", 
      "type": "application/vnd.abiquo.datacenter+json", 
      "rel": "location", 
      "title": "5"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "allocatedVM"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/4/racks/2/machines/2/virtualmachines/4/action/sendmail", 
      "type": "application/vnd.abiquo.mail+json", 
      "rel": "sendmail", 
      "title": "send mail"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/6", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "0"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/6/users/6", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "2 3"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "40"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "88"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "OFF"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "97", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/volumes/30", 
      "rel": "disk1", 
      "title": "vol0", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.volume+json", 
      "diskController": "99"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/disks/29", 
      "rel": "disk0", 
      "title": "83229f37-431f-4e06-ae59-e78f00002a37", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json", 
      "diskLabel": "96"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/4/datastoretiers/2", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier0", 
      "title": "38"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/privatenetworks/3/ips/19", 
      "type": "application/vnd.abiquo.privateip+json", 
      "rel": "nic0", 
      "title": "10.60.1.24"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/ONE", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "ONE"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/6/datacenterrepositories/4/virtualmachinetemplates/4", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "85"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/9", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "84"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/volumes/31", 
      "type": "application/vnd.abiquo.volume+json", 
      "rel": "disk2"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 4, 
  "highDisponibility": 0, 
  "creationTimestamp": 1512487234000, 
  "id": 4, 
  "uuid": "b1419a41-4983-444f-86ec-80aff496c73d", 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "allocatedVM", 
  "idState": 6, 
  "vdrpEnabled": true, 
  "state": "OFF", 
  "protected": false, 
  "lastSynchronize": 1512487234000, 
  "type": "MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/3/virtualappliances/5/virtualmachines/4/tasks/49414519-67d6-4a15-bbc3-bce278188ea6", 
      "rel": "status"
    }
  ]
}

Update a virtual machine that is not deployed

 Click here to expand...

PUT_cld_vdcs_X_vapps_X_vms_X_CT_vm_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743 \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "notDeployedVMName0.887822138395811"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/2879", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "313"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/2879/users/2993", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "371 372"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "322"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "324"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "NOT_ALLOCATED"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/disks/2220", 
      "rel": "disk0", 
      "title": "ba1a544c-db5d-4cee-84f0-040ff9cc8c2f", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/2403/datastoretiers/351", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier0", 
      "title": "398"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/virtualmachines/743/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "TestHypervisor"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/2879/datacenterrepositories/2403/virtualmachinetemplates/1169", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "387"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/1136", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "388"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1578/virtualappliances/759/layers/layer", 
      "rel": "layer"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 4, 
  "highDisponibility": 0, 
  "creationTimestamp": 1512487548000, 
  "id": 743, 
  "uuid": "e28ea54e-fa64-4319-82b2-a84e9829ba37", 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "notDeployedVMName0.887822138395811", 
  "idState": 1, 
  "vdrpEnabled": true, 
  "state": "NOT_ALLOCATED", 
  "protected": false, 
  "lastSynchronize": 1512487548000, 
  "type": "NOT_MANAGED", 
  "cpu": 1, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

--none--

Update a virtual machine with force

 Click here to show or hide the request example

PUT_cld_vdcs_X_vapps_X_vms_X_CT_vm_j_AC_acrq_j_force_T.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701?force=true \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/datacenters/4580/racks/1299/machines/1403", 
      "type": "application/vnd.abiquo.machine+json", 
      "rel": "machine", 
      "title": "TEST_HYPERVISOR"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/4580", 
      "type": "application/vnd.abiquo.datacenter+json", 
      "rel": "location", 
      "title": "660"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "edit", 
      "title": "vmName"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/4580/racks/1299/machines/1403/virtualmachines/1701/action/sendmail", 
      "type": "application/vnd.abiquo.mail+json", 
      "rel": "sendmail", 
      "title": "send mail"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/5219", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "655"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/5219/users/5487", 
      "type": "application/vnd.abiquo.user+json", 
      "rel": "user", 
      "title": "657 658"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885", 
      "type": "application/vnd.abiquo.virtualdatacenter+json", 
      "rel": "virtualdatacenter", 
      "title": "664"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667", 
      "type": "application/vnd.abiquo.virtualappliance+json", 
      "rel": "virtualappliance", 
      "title": "666"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/metadata", 
      "type": "application/vnd.abiquo.metadata+json", 
      "rel": "metadata", 
      "title": "metadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/network/configurations", 
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
      "rel": "configurations", 
      "title": "vlan network configurations"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/network/nics", 
      "type": "application/vnd.abiquo.nics+json", 
      "rel": "nics", 
      "title": "nics"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/storage/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "harddisks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/state", 
      "type": "application/vnd.abiquo.virtualmachinestate+json", 
      "rel": "state", 
      "title": "OFF"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/action/undeploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "undeploy", 
      "title": "virtual machine undeploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/action/deploy", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "deploy", 
      "title": "virtual machine deploy"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/action/reset", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "reset", 
      "title": "virtual machine reset"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/action/instance", 
      "type": "application/vnd.abiquo.acceptedrequest+json", 
      "rel": "instance", 
      "title": "virtual machine snapshot"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/config/rdpaccess", 
      "type": "application/vnd.abiquo.virtualmachineconsole+json", 
      "rel": "rdpaccess", 
      "title": "remote access"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/firewalls", 
      "type": "application/vnd.abiquo.links+json", 
      "rel": "firewalls", 
      "title": "firewalls"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/loadbalancers", 
      "type": "application/vnd.abiquo.loadbalancers+json", 
      "rel": "loadbalancers", 
      "title": "load balancers"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/backup/action/request", 
      "type": "application/vnd.abiquo.ondemandbackup+json", 
      "rel": "requestbackup", 
      "title": "request on demand backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/backup/action/restore", 
      "type": "application/vnd.abiquo.restore+json", 
      "rel": "requestrestore", 
      "title": "request a restore of a backup"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/storage/volumes", 
      "type": "application/vnd.abiquo.volumes+json", 
      "rel": "volumes", 
      "title": "volumes"
    }, 
    {
      "length": "10", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/disks/18891", 
      "rel": "disk0", 
      "title": "18a2fac6-dd9c-4ff9-ac0f-487dd0554a5b", 
      "diskControllerType": "IDE", 
      "type": "application/vnd.abiquo.harddisk+json"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/4580/datastoretiers/1103", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier0", 
      "title": "707"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/privatenetworks/1862/ips/18880", 
      "type": "application/vnd.abiquo.privateip+json", 
      "rel": "nic0", 
      "title": "151.27.200.22"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/action/protect", 
      "type": "text/plain", 
      "rel": "protect", 
      "title": "protect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/action/unprotect", 
      "type": "text/plain", 
      "rel": "unprotect", 
      "title": "unprotect"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/metrics", 
      "type": "application/vnd.abiquo.metricsmetadata+json", 
      "rel": "metricsmetadata", 
      "title": "metricsmetadata"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/metrics/collectd", 
      "type": "application/json", 
      "rel": "collectd", 
      "title": "collectd"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/alarms", 
      "type": "application/vnd.abiquo.alarms+json", 
      "rel": "alarms", 
      "title": "alarms"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
      "rel": "actionplans", 
      "title": "actionplans"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/actionplans", 
      "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
      "rel": "actionplansflat", 
      "title": "actionplansflat"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/action/clone", 
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
      "rel": "clone", 
      "title": "clone"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "TestHypervisor"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/5219/datacenterrepositories/4580/virtualmachinetemplates/2151", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "virtualmachinetemplate", 
      "title": "695"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/2094", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "696"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/privatenetworks/1862/ips/18880", 
      "type": "application/vnd.abiquo.privateip+json", 
      "rel": "privateip"
    }, 
    {
      "length": "8914", 
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/disks/18892", 
      "type": "application/vnd.abiquo.harddisk+json", 
      "rel": "disk1"
    }
  ], 
  "idType": 0, 
  "variables": {}, 
  "ram": 128, 
  "highDisponibility": 0, 
  "creationTimestamp": 1512487914000, 
  "id": 1701, 
  "uuid": "e6602b6c-d59a-46b9-8661-f12f00e3ea58", 
  "vdrpPort": 0, 
  "backuppolicies": [], 
  "monitored": false, 
  "name": "vmName", 
  "idState": 6, 
  "vdrpEnabled": false, 
  "state": "OFF", 
  "protected": false, 
  "lastSynchronize": 1512487914000, 
  "type": "NOT_MANAGED", 
  "cpu": 2, 
  "generateGuestInitialPassword": false, 
  "metadata": null
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2885/virtualappliances/1667/virtualmachines/1701/tasks/cb02a085-3c54-4961-ab14-4e70e134b68e", 
      "rel": "status"
    }
  ]
}

 

Update a virtual machine to add or remove backup configuration

Modify a VM as usual to add or remove the desired backup configuration under the backupPolicies attribute.

 Click here to expand...
Request Message Body Example:

The virtual machine example has been shortened to highlight the backup example.

{
  "cpu": 1,
  "ram": 1024,
  ....
  "backupPolicies":[
    {
      "links": [
        {
          "rel": "policy",
          "href": "https://example.com/api/datacenter/*/backuppolicies/*"
        }
      ],
      "configurations": [
        {
          "type": "COMPLETE",
          "subtype": "DAILY",
          "value": "13:30:00 +0200"
        },
        {
          "type": "SNAPSHOT",
          "subtype": "WEEKLY",
          "value": "15:00:02 +0100",
          "days": ["WEDNESDAY", "SUNDAY"],
          "sources": [
            {
              "links": [
                {
                  "rel": "disk",
                  "href": "https://example.com/api/cloud/virtualdatacenter/*/disks/*"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "links": [
        {
          "rel": "policy",
          "href": "https://example.com/api/datacenter/*/backuppolicies/*"
        }
      ],
      "configurations": [
        {
          "type": "OPTIONS",
          "subtype": "REPLICATION",
          "value": "true"
        }
      ]
    }
  ],
  ...
}

Success Status Code: 202

Request Message Body Example:

{
  "links": [
    {
      "rel": "status",
      "href": "https://example.com/api/cloud/virtualdatacenters/*/virtualappliances/*/virtualmachines/*/tasks/*"
    }
  ],
  "entity": "You can keep track of the progress in the link"
}

 

Get virtual machine and retrieve backup configuration

Retrieve the VM, which includes its backup configuration under the backupPolicies attribute.

 Click here to expand...

Response Message Body Example:

The virtual machine example has been shortened to highlight the backup example.

{
  "cpu": 1,
  "ram": 1024,
  ....
  "backupPolicies":[
    {
      "links": [
        {
          "rel": "policy",
          "href": "https://example.com/api/datacenter/*/backuppolicies/*"
        }
      ],
      "configurations": [
        {
          "type": "COMPLETE",
          "subtype": "DAILY",
          "value": "13:30:00 +0200"
        },
        {
          "type": "SNAPSHOT",
          "subtype": "WEEKLY",
          "value": "15:00:02 +0100",
          "days": ["WEDNESDAY", "SUNDAY"],
          "sources": [
            {
              "links": [
                {
                  "rel": "disk",
                  "href": "https://example.com/api/cloud/virtualdatacenter/*/disks/*"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "links": [
        {
          "rel": "policy",
          "href": "https://example.com/api/datacenter/*/backuppolicies/*"
        }
      ],
      "configurations": [
        {
          "type": "OPTIONS",
          "subtype": "REPLICATION",
          "value": "true"
        }
      ]
    }
  ],
  ...
}

 

Get virtual machine metadata

Retrieve the Abiquo metadata of a VM. A metadata object has the "metadata" root key. 

  • The "startup-script" attribute contains a cloud-init configuration or a command that you could execute with Docker run. 
  • The "monitoring-metrics" attribute contains VM metrics data with the names of the metrics the platform retrieves for this VM
  • The "chef" attribute contains attributes for VM Chef.
  • Users can create other attributes as required

For more information, see Manage virtual machine metadata via API

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/metadata 
Roles Required: VDC_ENUMERATE,VAPP_MANAGE_BACKUP,VAPP_CUSTOMISE_SETTINGS
Request Headers: Accept:  application/vnd.abiquo.metadata+json; version=4.4; application/vnd.abiquo.metadata+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: Metadata Media Type 
Request Example:


 Click here to expand...


GET_cld_vdcs_X_vapps_X_vms_X_md_AC_md_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/2224/virtualappliances/1099/virtualmachines/1140/metadata \ 
	 -H 'Accept:application/vnd.abiquo.metadata+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "metadata": {
    "monitoring-metrics": [
      "CPU", 
      "Disk latency"
    ]
  }
}


Update virtual machine metadata

Modify virtual machine metadata information. This request will replace ALL existing metadata.

  • The startup-script attribute can contain a cloud-init configuration or a command that you could execute with Docker run, as entered on the VM dialog  
  • The monitoring-metrics attribute contains VM metrics data with the names of the metrics that the platform will retrieve for this VM
  • The "chef" attribute contains attributes for VM Chef, as entered on the Chef tab of the VM dialog in the UI
  • Users can create other attributes as required

For more information, see Manage virtual machine metadata via API

Synopsis: PUT http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/metadata 
Roles Required: VAPP_MANAGE_BACKUP, VAPP_CUSTOMISE_SETTINGS
Request Headers: Accept:  application/vnd.abiquo.metadata+json; version=4.4; application/vnd.abiquo.metadata+xml; version=4.4;  Content-type:  application/vnd.abiquo.metadata+json; version=4.4; application/vnd.abiquo.metadata+xml; version=4.4;  
Request Parameters: VAPP_MANAGE_BACKUP,VAPP_CUSTOMISE_SETTINGS

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: Metadata Media Type 
Response Message Body Entity: Metadata Media Type 
Request Example:

 

 Click here to expand...

PUT_cld_vdcs_X_vapps_X_vms_X_md_CT_md_j_AC_md_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/cloud/virtualdatacenters/2224/virtualappliances/1099/virtualmachines/1140/metadata \ 
	 -H 'Accept:application/vnd.abiquo.metadata+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.metadata+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

{
  "links": [], 
  "metadata": {
    "monitoring-metrics": [
      "CPU", 
      "Disk latency"
    ]
  }
}

Response payload:

{
  "links": [], 
  "metadata": {
    "monitoring-metrics": [
      "CPU", 
      "Disk latency"
    ]
  }
}

 

Manage virtual machine backups

See VirtualMachineBackupResource

Protect a virtual machine

An administrator (or user with the correct privilege) can protect a VM from all Abiquo operations, so no user can perform operations on this VM while it is still protected.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/action/protect

Request Headers: Accept:  Content-type:  text/plain; version=4.4; 
Roles Required: VM_PROTECT_ACTION

 Click here to expand...

POST_cld_vdcs_X_vapps_X_vms_X_act_protect_CT_tp.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2287/virtualappliances/1162/virtualmachines/1205/action/protect \ 
	 -H 'Accept:text/plain' \ 
	 -H 'Content-Type:text/plain' \ 
	 -d @requestpayload.text \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

because I need to test the feature

Response payload:

--none--

curl -X POST http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/protect
	 -H 'Content-Type: text/plain; version=3.2'	\
	 -d 'Is being cooked by a monkey'	\
	 -u user:password --verbose

HTTP/1.1 204 No Content  

Unprotect a virtual machine

When the work has been finished for a protected VM, the administrator can release it from the protected state or "unprotect" it.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/action/unprotect

Request Headers: Accept:  Content-Type:
Roles Required: VM_PROTECT_ACTION

 Click here to expand...

POST_cld_vdcs_X_vapps_X_vms_X_act_unprotect.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2295/virtualappliances/1170/virtualmachines/1213/action/unprotect \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

curl -X POST http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/unprotect
	 -u user:password --verbose

HTTP/1.1 204 No Content  

Delete virtual machine metadata

Delete metedata information of a VM, which deletes startup-script, monitoring-metrics, and customized metadata.

Synopsis: DELETE http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/metadata 
Roles Required: VAPP_MANAGE_BACKUP,VAPP_CUSTOMISE_SETTINGS
Request Headers: Accept: ; Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: 
Request Example:

 

 Click here to expand...
curl -X DELETE http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/metadata\
	 -u user:password --verbose

DELETE http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/metadata HTTP/1.1

HTTP/1.1 204 No Content
Date: Tue, 04 Jun 2013 15:15:18 GMT

 

List load balancers of a virtual machine 

Retrieve all load balancers associated with a VM.

Synopsis: GET /cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/loadbalancers
Roles required: VDC_ENUMERATE,VDC_MANAGE_VAPP,VAPP_CUSTOMISE_SETTINGS,VAPP_ASSIGN_NETWORK,VAPP_PERFORM_ACTIONS,VAPP_DEPLOY_UNDEPLOY,VAPP_CREATE_STATEFUL, VAPP_ASSIGN_VOLUME,MANAGE_HARD_DISKS,VAPP_CREATE_INSTANCE,MANAGE_LOADBALANCERS,ASSIGN_LOADBALANCERS
Request headers: Accept:  application/vnd.abiquo.loadbalancers+json; version=4.4; application/vnd.abiquo.loadbalancers+xml; version=4.4;  
Request parameters:

Sample request

curl --verbose -XGET http://admin:xabiquo@10.60.1.223:80/api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/1/loadbalancers

Response

 Click here to show/hide example

GET_cld_vdcs_X_vapps_X_vms_X_lbs_AC_lbs_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/2163/virtualappliances/1038/virtualmachines/1081/loadbalancers \ 
	 -H 'Accept:application/vnd.abiquo.loadbalancers+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "totalSize": 1, 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2163/virtualappliances/1038/virtualmachines/1081/loadbalancers?limit=25&by=name&asc=true", 
      "rel": "first"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2163/virtualappliances/1038/virtualmachines/1081/loadbalancers?startwith=0&limit=25&by=name&asc=true", 
      "rel": "last"
    }
  ], 
  "collection": [
    {
      "providerId": "", 
      "name": "name3", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/locations/3211/devices/926/loadbalancers/288", 
          "type": "application/vnd.abiquo.loadbalancer+json", 
          "rel": "edit", 
          "title": "name3"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/locations/3211/devices/926", 
          "type": "application/vnd.abiquo.device+json", 
          "rel": "device", 
          "title": "24-device"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/locations/3211/devices/926/loadbalancers/288/addresses", 
          "type": "application/vnd.abiquo.loadbalanceraddresses+json", 
          "rel": "addresses", 
          "title": "addresses"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/locations/3211/devices/926/loadbalancers/288/routingrules", 
          "type": "application/vnd.abiquo.routingrules+json", 
          "rel": "routingrules", 
          "title": "routingrules"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/locations/3211/devices/926/loadbalancers/288/healthchecks", 
          "type": "application/vnd.abiquo.healthchecks+json", 
          "rel": "healthchecks", 
          "title": "healthchecks"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/locations/3211/devices/926/loadbalancers/288/healthstates", 
          "type": "application/vnd.abiquo.healthstates+json", 
          "rel": "healthstates", 
          "title": "virtual machines health state"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/locations/3211/devices/926/loadbalancers/288/virtualmachines", 
          "type": "application/vnd.abiquo.links+json", 
          "rel": "virtualmachines", 
          "title": "virtual machines"
        }
      ]
    }
  ]
}

{ 
  "totalSize": 1,
  "collection": [
    {
      "providerId": "a",
      "algorithm": "ELBSecurityPolicy-2014-01",
      "name": "a",
      "links": [
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1/loadbalancers/1",
          "type": "application/vnd.abiquo.loadbalancer+json",
          "rel": "edit",
          "title": "a"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1",
          "type": "application/vnd.abiquo.publiccloudregion+json",
          "rel": "location",
          "title": "a"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1/loadbalancers/1/addresses",
          "type": "application/vnd.abiquo.loadbalanceraddresses+json",
          "rel": "addresses",
          "title": "addresses"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1/loadbalancers/1/routingrules",
          "type": "application/vnd.abiquo.routingrules+json",
          "rel": "routingrules",
          "title": "routingrules"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1/loadbalancers/1/healthchecks",
          "type": "application/vnd.abiquo.healthchecks+json",
          "rel": "healthchecks",
          "title": "healthchecks"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1/loadbalancers/1/healthstates",
          "type": "application/vnd.abiquo.healthstates+json",
          "rel": "healthstates",
          "title": "virtual machines health state"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1/loadbalancers/1/virtualmachines",
          "type": "application/vnd.abiquo.links+json",
          "rel": "virtualmachines",
          "title": "virtual machines"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/virtualdatacenters/2",
          "type": "application/vnd.abiquo.virtualdatacenter+json",
          "rel": "virtualdatacenter",
          "title": "a"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/virtualdatacenters/2/privatenetworks/1",
          "type": "application/vnd.abiquo.vlan+json",
          "rel": "privatenetwork",
          "title": "default_private_network"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1/loadbalancers/addresses/1",
          "type": "application/vnd.abiquo.loadbalanceraddress+json",
          "rel": "loadbalanceraddress",
          "title": "a-747436504.eu-west-1.elb.amazonaws.com"
        },
        {
          "href": "http://10.60.1.223:80/api/cloud/locations/1/firewalls/1",
          "type": "application/vnd.abiquo.firewallpolicy+json",
          "rel": "firewall",
          "title": "default"
        }
      ]
    }
  ],
  "links": [
    {
      "href": "http://10.60.1.223:80/api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/1/loadbalancers?limit=25&by=name",
      "rel": "first"
    },
    {
      "href": "http://10.60.1.223:80/api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/1/loadbalancers?startwith=0&limit=25&by=name",
      "rel": "last"
    }
  ]
}

This new endpoint is returned as a link in the virtualmachine representation

curl --verbose -XGET http://admin:xabiquo@10.60.1.223:80/api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/1

Extract of the response showing the link to load balancers

 Click here to show/hide example
...
    {
      "href": "http://10.60.1.223:80/api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/1/loadbalancers",
      "type": "application/vnd.abiquo.loadbalancers+json",
      "rel": "loadbalancers",
      "title": "load balancers"
    },
...

Enable fetch of metrics for a virtual machine

Enable the retrieve of available builtin metrics from the virtualization technology for a VM. For UI functionality, see VM monitoring and metrics

Synopsis: POST api/cloud/virtualdatecenters/{virtualdatacenters}/virtualappliances/{virtualappliances}/virtualmachines/{virtualmachines}/enablemonitoring
Roles requiredUSERS_ENABLE_DISABLE_VM_METRICS
Request headers: Accept: ; Content-Type: ;

 Click to show or hide the request example

POST_cld_vdcs_X_vapps_X_vms_X_enablemtrg.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2700/virtualappliances/1499/virtualmachines/1522/enablemonitoring \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

 

curl -v -u user:password -X POST http://localhost/api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/2/enablemonitoring

> POST /api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/2/enablemonitoring HTTP/1.1
> Authorization: Basic dXNlcjpwYXNzd29yZA==
> User-Agent: curl/7.35.0
> Host: localhost
> Accept: */*
>
< HTTP/1.1 204 No Content
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTQxMjMyNjExNTM3MDo3YzlmZjk1Mjg5ZDM4MDI0OTYzMjNiOTk0M2NkNzk1NDpBQklRVU8; Expires=Fri, 03-Oct-2014 08:48:35 GMT; Path=/
< Set-Cookie: ABQSESSIONID=2259504872402404071; Expires=Fri, 03-Oct-2014 08:48:35 GMT; Path=/
< Date: Fri, 03 Oct 2014 08:18:35 GMT
<

 

Disable fetch of metrics for a virtual machine

Stop retrieving native metrics from the virtualization technology. For UI functionality, see  VM monitoring and metrics

Synopsis: POST api/cloud/virtualdatecenters/{virtualdatacenters}/virtualappliances/{virtualappliances}/virtualmachines/{virtualmachines}/disablemonitoring
Roles required: USERS_ENABLE_DISABLE_VM_METRICS
Request headers: Accept: ; Content-Type: ;

 Click to show or hide the request example

POST_cld_vdcs_X_vapps_X_vms_X_disablemtrg.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2694/virtualappliances/1493/virtualmachines/1516/disablemonitoring \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

curl -v -u user:password -X POST http://localhost/api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/2/disablemonitoring

> POST /api/cloud/virtualdatacenters/2/virtualappliances/1/virtualmachines/2/disablemonitoring HTTP/1.1
> Authorization: Basic dXNlcjpwYXNzd29yZA==
> User-Agent: curl/7.35.0
> Host: localhost
> Accept: */*
>
< HTTP/1.1 204 No Content
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTQxMjMyNjExNTM3MDo3YzlmZjk1Mjg5ZDM4MDI0OTYzMjNiOTk0M2NkNzk1NDpBQklRVU8; Expires=Fri, 03-Oct-2014 08:48:35 GMT; Path=/
< Set-Cookie: ABQSESSIONID=2259504872402404071; Expires=Fri, 03-Oct-2014 08:48:35 GMT; Path=/
< Date: Fri, 03 Oct 2014 08:18:35 GMT
<

 

Get compatible hosts for virtual machine relocation

An administrator with the Relocate VM into a compatible host privilege can use this method to obtain compatible hosts (relocate candidates) and then use the relocate VM method (vMotion) for hypervisor plugins that support this action.

The links returned include two types of "rel":

  • currentmachine: where the VM is currently deployed

  • targetmachine: (multiple links with same rel) candidate for the VM to be relocated to. These machines are on the same rack and have enough resources when considering loadlevel rules.

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/relocatecandidates

Request Headers: Accept:   application/vnd.abiquo.links+json; version=4.4; application/vnd.abiquo.links+xml; version=4.4; Content-type: 
Roles Required: VM_RELOCATE

 Click here to expand...
curl -X GET http://localhost:80/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/relocatecandidates
	 -H 'Accept: application/vnd.abiquo.links+json; version=3.10'	\
	 -u user:password --verbose \

HTTP/1.1 200 OK
< Content-Type: application/vnd.abiquo.links+json
{
  "links": [
    {
      "title": "ucs-blade-3.bcn.abiquo.com.",
      "rel": "targetmachine",
      "type": "application/vnd.abiquo.machine+json",
      "href": "http://localhost:80/api/admin/datacenters/1/racks/1/machines/2"
    },
    {
      "title": "thunder05.bcn.abiquo.com.",
      "rel": "currentmachine",
      "type": "application/vnd.abiquo.machine+json",
      "href": "http://localhost:80/api/admin/datacenters/1/racks/1/machines/1"
    }
  ]
}  

 

Relocate virtual machine

An administrator with Relocate VM into a compatible host privilege can use this method to relocate the VM (vMotion) for hypervisor plugins that support this action. Before you relocate the VM with this method, first obtain compatible hosts as described above.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/relocate

Request Headers: Accept:   application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type:  application/vnd.abiquo.links+json; version=4.4; application/vnd.abiquo.links+xml; version=4.4;
Roles Required: VM_RELOCATE

 Click here to expand...
curl -X POST http://localhost:80/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/relocate
	 -H 'Content-Type: application/vnd.abiquo.links+json; version=3.10'	\
	 -H 'Accept: application/vnd.abiquo.acceptedrequest+json; version=3.10'	\
	 -u user:password --verbose \
	 -d '{
    		"links": [
        		{
            		"href": "http://localhost:80/api/admin/datacenters/1/racks/1/machines/2",
		            "rel": "targetmachine",
        		    "type": "application/vnd.abiquo.machine+json"
        		}
    		]
	 }'	

HTTP/1.1 202 Accepted
< Content-Type: application/vnd.abiquo.acceptedrequest+json
{
    "entity": "You can keep track of the progress in the link",
    "links": [
        {
            "href": "http://localhost:80/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks/9fa9f0c2-bb7b-4f6f-b6e9-fa442114a218",
            "rel": "status"
        }
    ]
}  

 

Clone a virtual machine

This method was created to clone a VM for horizontal autoscaling. The original VM can be undeployed or deployed. 

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/action/clone
Roles required: VAPP_DEPLOY_UNDEPLOY
Request headers: Accept: application/vnd.abiquo.virtualmachinecloneoptions+json;
Request parameters:

Parameter

Required

Default value

Description

Request Message Body Entity:
Response Message Body Entity: VirtualMachine Media Type
Request Example:

curl 'http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/clone' \
	-X POST \
	-H "Content-type:application/vnd.abiquo.virtualmachinecloneoptions+json" \
	-H "Accept:application/vnd.abiquo.virtualmachine+json"

Response Example:

 Click here to expand...
Response example
HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
Set-Cookie: ABQSESSIONID=7011745406076348356; Expires=Mon, 13-Mar-2017 11:54:39 GMT; Path=/; HttpOnly
Set-Cookie: auth=YWRtaW46MTQ4OTQwNjA3OTg5Mzo5YWEyMDgwNTAxZDhkZDkxYTUxODFiNDNjMzRiMmEzMjpBQklRVU8; Expires=Mon, 13-Mar-2017 11:54:39 GMT; Path=/; HttpOnly
Content-Type: application/vnd.abiquo.virtualmachine+json
Transfer-Encoding: chunked
Date: Mon, 13 Mar 2017 11:24:39 GMT
{
   "id":2,
   "uuid":"be19daad-da41-4cea-8ebd-9abbd8ffc4bb",
   "name":"ABQ_be19daad-da41-4cea-8ebd-9abbd8ffc4bb",
   "label":"grml-sync - 2017/03/13 12:24:39 CET",
   "cpu":1,
   "ram":128,
   "vdrpEnabled":true,
   "vdrpPort":0,
   "idState":1,
   "state":"NOT_ALLOCATED",
   "idType":0,
   "type":"MANAGED",
   "highDisponibility":0,
   "password":"tWLtn6IF",
   "metadata":null,
   "monitored":false,
   "protected":false,
   "variables":{
   },
   "creationTimestamp":1489404279000,
   "backuppolicies":[
   ],
   "links":[
      {
         "title":"ABQ_be19daad-da41-4cea-8ebd-9abbd8ffc4bb",
         "rel":"edit",
         "type":"application/vnd.abiquo.virtualmachine+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2"
      },
      {
         "title":"Abiquo",
         "rel":"enterprise",
         "type":"application/vnd.abiquo.enterprise+json",
         "href":"http://example.com/api/admin/enterprises/1"
      },
      {
         "title":"Cloud Administrator",
         "rel":"user",
         "type":"application/vnd.abiquo.user+json",
         "href":"http://example.com/api/admin/enterprises/1/users/1"
      },
      {
         "title":"vdc",
         "rel":"virtualdatacenter",
         "type":"application/vnd.abiquo.virtualdatacenter+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1"
      },
      {
         "title":"vapp_vdc",
         "rel":"virtualappliance",
         "type":"application/vnd.abiquo.virtualappliance+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1"
      },
      {
         "title":"metadata",
         "rel":"metadata",
         "type":"application/vnd.abiquo.metadata+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/metadata"
      },
      {
         "title":"vlan network configurations",
         "rel":"configurations",
         "type":"application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/network/configurations"
      },
      {
         "title":"nics",
         "rel":"nics",
         "type":"application/vnd.abiquo.nics+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/network/nics"
      },
      {
         "title":"disks",
         "rel":"harddisks",
         "type":"application/vnd.abiquo.harddisks+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/storage/disks"
      },
      {
         "title":"NOT_ALLOCATED",
         "rel":"state",
         "type":"application/vnd.abiquo.virtualmachinestate+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/state"
      },
      {
         "title":"virtual machine undeploy",
         "rel":"undeploy",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/undeploy"
      },
      {
         "title":"virtual machine deploy",
         "rel":"deploy",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/deploy"
      },
      {
         "title":"virtual machine reset",
         "rel":"reset",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/reset"
      },
      {
         "title":"virtual machine snapshot",
         "rel":"instance",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/instance"
      },
      {
         "title":"remote access",
         "rel":"rdpaccess",
         "type":"text/plain",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/config/rdpaccess"
      },
      {
         "title":"tasks",
         "rel":"tasks",
         "type":"application/vnd.abiquo.tasks+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/"
      },
      {
         "title":"firewalls",
         "rel":"firewalls",
         "type":"application/vnd.abiquo.links+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/firewalls"
      },
      {
         "title":"load balancers",
         "rel":"loadbalancers",
         "type":"application/vnd.abiquo.loadbalancers+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/loadbalancers"
      },
      {
         "title":"request on demand backup",
         "rel":"requestbackup",
         "type":"application/vnd.abiquo.ondemandbackup+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/backup/action/request"
      },
      {
         "title":"request a restore of a backup",
         "rel":"requestrestore",
         "type":"application/vnd.abiquo.restore+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/backup/action/restore"
      },
      {
         "title":"volumes",
         "rel":"volumes",
         "type":"application/vnd.abiquo.volumes+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/storage/volumes"
      },
      {
         "diskController":"lsilogic",
         "diskControllerType":"SCSI",
         "length":"1024",
         "title":"e7ba1ba2-6637-477d-bcbd-0a11077e9c97",
         "rel":"disk0",
         "type":"application/vnd.abiquo.harddisk+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/disks/3"
      },
      {
         "title":"Default Tier",
         "rel":"datastoretier0",
         "type":"application/vnd.abiquo.datastoretier+json",
         "href":"http://example.com/api/cloud/locations/1/datastoretiers/1"
      },
      {
         "title":"protect",
         "rel":"protect",
         "type":"text/plain",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/protect"
      },
      {
         "title":"unprotect",
         "rel":"unprotect",
         "type":"text/plain",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/unprotect"
      },
      {
         "title":"metrics",
         "rel":"metrics",
         "type":"application/vnd.abiquo.metrics+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/metrics"
      },
      {
         "title":"metricsmetadata",
         "rel":"metricsmetadata",
         "type":"application/vnd.abiquo.metricsmetadata+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/metrics"
      },
      {
         "title":"createcustommetric",
         "rel":"createcustommetric",
         "type":"application/vnd.abiquo.custommetric+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/metrics"
      },
      {
         "title":"enablemonitoring",
         "rel":"enablemonitoring",
         "type":"",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/enablemonitoring"
      },
      {
         "title":"collectd",
         "rel":"collectd",
         "type":"application/json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/collectd"
      },
      {
         "title":"alarms",
         "rel":"alarms",
         "type":"application/vnd.abiquo.alarms+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/alarms"
      },
      {
         "title":"actionplans",
         "rel":"actionplans",
         "type":"application/vnd.abiquo.virtualmachineactionplans+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/actionplans"
      },
      {
         "title":"actionplansflat",
         "rel":"actionplansflat",
         "type":"application/vnd.abiquo.virtualmachineactionplansflat+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/actionplans"
      },
      {
         "title":"clone",
         "rel":"clone",
         "type":"application/vnd.abiquo.virtualmachinecloneoptions+json",
         "href":"http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/2/action/clone"
      },
      {
         "title":"KVM",
         "rel":"hypervisortype",
         "type":"application/vnd.abiquo.hypervisortype+json",
         "href":"http://example.com/api/config/hypervisortypes/KVM"
      },
      {
         "title":"grml-sync",
         "rel":"virtualmachinetemplate",
         "type":"application/vnd.abiquo.virtualmachinetemplate+json",
         "href":"http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/4"
      },
      {
         "title":"Others",
         "rel":"category",
         "type":"application/vnd.abiquo.category+json",
         "href":"http://example.com/api/config/categories/1"
      }
   ]
}

Get remote access details for a virtual machine

Retrieve the remote access details for the virtual machine.

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/config/rdpaccess 
Roles Required: ROLE_VDC_ENUMERATE,ROLE_VDC_MANAGE_VAPP
Request Headers: Accept:  application/vnd.abiquo.virtualmachineconsole+json; version=4.4; application/vnd.abiquo.virtualmachineconsole+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: VirtualMachineConsole Media Type 
Request Example:

 Click here to show or hide the request example


GET_cld_vdcs_X_vapps_X_vms_X_cfg_rdpacss_AC_vmconsole_j.0002.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/2840/virtualappliances/1623/virtualmachines/1654/config/rdpaccess \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachineconsole+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "url": "/vmconsole/45ed347a321254741ff7844e049ff6049975fc11be5f4f0e8559b73a6127a953ee37fb61a7f62a3f136fe79e09e510ad", 
  "protocol": "RDP", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2840/virtualappliances/1623/virtualmachines/1654", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "virtualmachine", 
      "title": "4098"
    }
  ], 
  "parameters": {
    "vmid": "1654"
  }
}

Get firewalls attached to a virtual machine

Retrieve the firewalls attached to a virtual machine as a collection of links. 

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/firewalls
Roles Required: VDC_ENUMERATE,ASSIGN_FIREWALLS,MANAGE_FIREWALLS
Request Headers: Accept:  application/vnd.abiquo.links+json; version=4.4; application/vnd.abiquo.links+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity: Links Media Type 
Request Example:

 Click here to expand...

GET_cld_vdcs_X_vapps_X_vms_X_fws_AC_lnks_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/2139/virtualappliances/1015/virtualmachines/1035/firewalls \ 
	 -H 'Accept:application/vnd.abiquo.links+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/locations/3175/devices/898/firewalls/391", 
      "type": "application/vnd.abiquo.firewallpolicy+json", 
      "rel": "firewall", 
      "title": "68"
    }
  ]
}

Update firewalls attached to a virtual machine

Change the firewalls attached to a virtual machine from the given collection of links. 

Synopsis: PUT http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/firewalls
Roles Required: ASSIGN_FIREWALLS,MANAGE_FIREWALLS
Request Headers: Accept:  application/vnd.abiquo.links+json; version=4.4; application/vnd.abiquo.links+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: Links Media Type 
Response Message Body Entity:  AcceptedRequest Media Type
Request Example:


 Click here to expand...

PUT_cld_vdcs_X_vapps_X_vms_X_fws_CT_lnks_j_AC_acrq_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/cloud/virtualdatacenters/2152/virtualappliances/1027/virtualmachines/1059/firewalls \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.links+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/locations/3196/devices/909/firewalls/402", 
      "rel": "firewall"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/locations/3196/devices/909/firewalls/403", 
      "rel": "firewall"
    }
  ]
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2152/virtualappliances/1027/virtualmachines/1059/firewalls/tasks/1a95e749-55d4-4b3a-b7d3-c07f88458562", 
      "rel": "status"
    }
  ]
}

List alarms of a virtual machine

List all the alarms associated with a virtual machine.

Synopsis: GET http://example.com/api/cloud/virtualdatecenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/virtualmachines/{virtualmachine}/alarms
Roles required:  USERS_VM_VIEW_ALARMS
Request Headers: Accept:  application/vnd.abiquo.alarms+json; version=4.4; application/vnd.abiquo.alarms+xml; version=4.4;  Content-type:;

Request example:

 Click here to expand...


GET_cld_vdcs_X_vapps_X_vms_X_alarms_AC_alarms_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/556/virtualappliances/340/virtualmachines/322/alarms \ 
	 -H 'Accept:application/vnd.abiquo.alarms+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": [
    {
      "evaluationPeriods": 5, 
      "name": "f7b3a5a2-f3f2-40c1-82e1-bfc70f9e42d3", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/556/virtualappliances/340/virtualmachines/322/metrics/metric_c", 
          "type": "application/vnd.abiquo.metric+json", 
          "rel": "metric", 
          "title": "metric_c"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/556/virtualappliances/340/virtualmachines/322", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "1131"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/556/virtualappliances/340/virtualmachines/322/metrics/metric_c/alarms/d544617a-cc64-49d3-9fe4-20c6ccc31bf5", 
          "type": "application/vnd.abiquo.alarm+json", 
          "rel": "edit", 
          "title": "d544617a-cc64-49d3-9fe4-20c6ccc31bf5"
        }
      ], 
      "period": 67, 
      "threshold": 0.6141984068522678, 
      "statistic": "maximum", 
      "active": false, 
      "formula": "greaterthan", 
      "description": "8774db75-69d6-4134-a36f-8ba062cf776d"
    }, 
    {
      "evaluationPeriods": 10, 
      "name": "66af3e47-f5b9-46a1-95f4-92e894c07dd5", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/556/virtualappliances/340/virtualmachines/322/metrics/metric_c", 
          "type": "application/vnd.abiquo.metric+json", 
          "rel": "metric", 
          "title": "metric_c"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/556/virtualappliances/340/virtualmachines/322", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "1131"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/556/virtualappliances/340/virtualmachines/322/metrics/metric_c/alarms/e947dbdb-3747-42bc-9ac6-2422759acdc5", 
          "type": "application/vnd.abiquo.alarm+json", 
          "rel": "edit", 
          "title": "e947dbdb-3747-42bc-9ac6-2422759acdc5"
        }
      ], 
      "period": 67, 
      "threshold": 0.9233871833610948, 
      "statistic": "sum", 
      "active": false, 
      "formula": "lessthan", 
      "description": "dfd38d46-43f0-4229-8334-6a95c211677c"
    }
  ]
}

 

Enable monitoring level for a virtual machine

For supported providers, enable the monitoring level for retrieve of available builtin metrics from the virtualization technology for a VM. For UI functionality, see VM monitoring and metrics

Synopsis: POST http://example.com/api/cloud/virtualdatecenters/{virtualdatacenters}/virtualappliances/{virtualappliances}/virtualmachines/{virtualmachines}/enablemonitoringlevel
Roles required: USERS_ENABLE_DISABLE_VM_METRICS
Request headers: Accept: ; application/vnd.abiquo.monitoringlevel+json; version=4.4; application/vnd.abiquo.monitoringlevel+xml; version=4.4; Content-Type: application/vnd.abiquo.monitoringlevel+json; version=4.4; application/vnd.abiquo.monitoringlevel+xml; version=4.4; ;

 Click to show or hide the request example

POST_cld_vdcs_X_vapps_X_vms_X_enablemtrglvl_CT_mtrglvl_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/2698/virtualappliances/1497/virtualmachines/1520/enablemonitoringlevel \ 
	 -H 'Accept:application/vnd.abiquo.monitoringlevel+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.monitoringlevel+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

{
  "name": "LVL_A", 
  "links": []
}

Response payload:

--none--