Versions Compared

Key

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

...

This simple walkthrough shows how to reconfigure a virtual machineVM, in this case we will add a volume of external storage using the API. The basic procedure for adding a volume to a virtual machine VM is:

  1. Retrieve the virtual machineVM
  2. Retrieve an available volume 
  3. Add the volume to the virtual machineVM
  4. Reconfigure the virtual machineVM

Prerequisites

This tutorial should be used in a test environment. You can set up the following basic environment in the GUI and then work on the tutorial using the API. After you have finished, you should see the new volume on your virtual machineVM.

Environment

You will need:

  • A deployed virtual machine VM that is powered off
    • the VM used in this tutorial is configured with the following disks:
      • disk1 - system hard disk on the hypervisor datastore
      • disk2 - a volume attached to the virtual machineVM
  • A storage device and a volume that is not attached to a virtual machineVM
    • tipTip: for a test system, enable the creation of small volumes through the GUI by setting sizes of 0.1, 0.2 GB in Configuration view
  • The ID number of your enterprise and datacenter
    this tutorial uses an environment with: Abiquo Enterprise 1 and Datacenter 1
  • Privileges as described below
    • if you are a CLOUD_ADMIN or ENTERPRISE_ADMIN user, no extra privileges are required

In an Abiquo test environment you can do these steps using the Abiquo GUI

  1. Create a virtual appliance and virtual machineVM
  2. Deploy the virtual appliance
  3. Power off the virtual machineVM
  4. Create two volumes
  5. Attach one volume to the virtual machineVM

Privileges Required

This tutorial is designed to be used by an Enterprise Administrator or Cloud Administrator in a test environment. 

See privilege definitions.

ROLE_VDC_ENUMERATE
ROLE_VAPP_CUSTOMISE_SETTINGS
ROLE_VDC_MANAGE_VAPP
VDC_MANAGE_STORAGE

Preparation

First, you can use the AllVirtualMachinesResource to retrieve all the virtual machinesyour VMs

Div
classwidecode tinycode


Expand

cURL:

Code Block
curl -X GET https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualmachines \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachines+json;version=34.62' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

Code Block
{
    "links": [
        {
            "rel": "first",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualmachines?limit=25&by=name&asc=true"
        },
        {
            "rel": "last",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualmachines?startwith=0&limit=25&by=name&asc=true"
        }
    ],
    "collection": [
        {
            "linksid": [182,
            "uuid": "743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
     {       "name": "ABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
            "titlelabel": "VMXyVM_0401",
            "fqdn": "box",
            "reldescription": "A virtual machine",
            "cpu": 1,
            "typeram": 48,
        "application/vnd.abiquo.machine+json"    "vdrpEnabled": true,
            "vdrpPort": 5914,
      "href      "vdrpIP": "https://mjsabq.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1"192.168.2.54",
            "idState": 6,
  },          "state": "OFF",
     {       "idType": 0,
            "titletype": "BCDCMANAGED",
            "highDisponibility": 0,
            "relpassword": "locationxXs0fVBf",
            "metadata": null,
      "type": "application/vnd.abiquo.datacenter+json",       "monitored": false,
             "hrefmonitoringLevel": "https://mjsabq.bcn.abiquo.com:443/api/cloud/locations/1"DEFAULT",
            "protected": false,
  },          "variables": {},
     {       "creationTimestamp": 1514900489000,
            "titlebackuppolicies": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7",[],
            "lastSynchronize": 1514904162000,
            "relgenerateGuestInitialPassword": "edit"false,
            "links": [
      "type": "application/vnd.abiquo.virtualmachine+json",         {
           "href": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6"
                },
                {
                    "title": "send mailVMX_04",
                    "rel": "sendmailmachine",
                    "type": "application/vnd.abiquo.mailmachine+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/14/racks/14/machines/1/virtualmachines/6/action/sendmail2"
                },
                {
                    "title": "AbiquoBCDC",
                    "rel": "enterpriselocation",
                    "type": "application/vnd.abiquo.enterprisedatacenter+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admincloud/enterpriseslocations/14"
                },
                {
                    "title": "Cloud AdministratorABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
                    "rel": "useredit",
                    "type": "application/vnd.abiquo.uservirtualmachine+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182"
                },
                {
                    "title": "ESXBCsend mail",
                    "rel": "virtualdatacentersendmail",
                    "type": "application/vnd.abiquo.virtualdatacentermail+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/admin/datacenters/4/racks/4/machines/2/virtualmachines/182/action/sendmail"
                },
                {
                    "title": "vapp_ESXBCTioco",
                    "rel": "virtualapplianceenterprise",
                    "type": "application/vnd.abiquo.virtualapplianceenterprise+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudadmin/virtualdatacenters/3/virtualappliances/1enterprises/2"
                },
                {
                    "title": "metadataCloud Administrator",
                    "rel": "metadatauser",
                    "type": "application/vnd.abiquo.metadatauser+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudadmin/virtualdatacentersenterprises/32/virtualappliancesusers/1/virtualmachines/6/metadata"
                },
                {
                    "title": "vlan network configurationsbcdc_tioco_03",
                    "rel": "configurationsvirtualdatacenter",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurationsvirtualdatacenter+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/network/configurations"
                },
                {
                    "title": "192.168.0.0/22bcdc_tioco_03_02",
                    "rel": "network_configurationvirtualappliance",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurationvirtualappliance+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/network/configurations/14"
                },
                {
                    "title": "nicsmetadata",
                    "rel": "nicsmetadata",
                    "type": "application/vnd.abiquo.nicsmetadata+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/network/nicsmetadata"
                },
                {
                    "title": "disksvlan network configurations",
                    "rel": "harddisksconfigurations",
                    "type": "application/vnd.abiquo.harddisksvirtualmachinenetworkconfigurations+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/storagenetwork/disksconfigurations"
                },
                {
                    "title": "OFF192.168.0.0/24",
                    "rel": "statenetwork_configuration",
                    "type": "application/vnd.abiquo.virtualmachinestatevirtualmachinenetworkconfiguration+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6/state182/network/configurations/3"
                },
                {
                    "title": "virtual machine undeploynics",
                    "rel": "undeploynics",
                    "type": "application/vnd.abiquo.acceptedrequestnics+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/actionnetwork/undeploynics"
                },
                {
                    "title": "virtual machine deploydisks",
                    "rel": "deployharddisks",
                    "type": "application/vnd.abiquo.acceptedrequestharddisks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/actionstorage/deploydisks"
                },
                {
                    "title": "virtual machine resetOFF",
                    "rel": "resetstate",
                    "type": "application/vnd.abiquo.acceptedrequestvirtualmachinestate+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/resetstate"
                },
                {
                    "title": "virtual machine snapshotundeploy",
                    "rel": "instanceundeploy",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/instanceundeploy"
                },
                {
                    "title": "virtual machine restore backupdeploy",
                    "rel": "restorebackupdeploy",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/restorebackupdeploy"
                },
                {
                    "title": "remotevirtual machine accessreset",
                    "rel": "rdpaccessreset",
                    "type": "text/plainapplication/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/configaction/rdpaccessreset"
                },
                {
                    "title": "tasksvirtual machine snapshot",
                    "rel": "tasksinstance",
                    "type": "application/vnd.abiquo.tasksacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6action/tasksinstance"
                },
                {
                    "title": "firewallsremote access",
                    "rel": "firewallsrdpaccess",
                    "type": "application/vnd.abiquo.linksvirtualmachineconsole+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6config/firewallsrdpaccess"
                },
                {
                    "title": "load balancerstasks",
                    "rel": "loadbalancerstasks",
                    "type": "application/vnd.abiquo.loadbalancerstasks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/loadbalancerstasks"
                },
                {
                    "title": "volumesfirewalls",
                    "rel": "volumesfirewalls",
                    "type": "application/vnd.abiquo.volumeslinks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/storage/volumesfirewalls"
                },
                {
                    "title": "Devol1load balancers",
                    "rel": "disk1loadbalancers",
                    "type": "application/vnd.abiquo.volumeloadbalancers+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/2virtualappliances/4/virtualmachines/182/loadbalancers"
                },
                {
                    "diskControllertitle": "lsilogicrequest on demand backup",
                    "diskControllerTyperel": "SCSIrequestbackup",
                    "diskLabeltype": "scsi0:0application/vnd.abiquo.ondemandbackup+json",
                    "lengthhref": "26",
       https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/backup/action/request"
                },
                {
                    "title": "8f62ef08-8f6a-4f08-9cd1-999b7b9c98dcrequest a restore of a backup",
                    "rel": "disk0requestrestore",
                    "type": "application/vnd.abiquo.harddiskrestore+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/disksvirtualappliances/4/virtualmachines/182/backup/action/restore"
                },
                {
                    "title": "192.168.0.2relocate candidates",
                    "rel": "nic0relocatecandidates",
                    "type": "application/vnd.abiquo.privateiplinks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/privatenetworks/1/ips/5virtualappliances/4/virtualmachines/182/action/relocatecandidates"
                },
                {
                    "title": "metricsrelocate",
                    "rel": "metricsrelocate",
                    "type": "application/vnd.abiquo.metricsacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/metricsrelocate"
                },
                {
                    "title": "metricsmetadatavolumes",
                    "rel": "metricsmetadatavolumes",
                    "type": "application/vnd.abiquo.metricsmetadatavolumes+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/storage/metricsvolumes"
                },
                {
                    "titlediskController": "createcustommetricparavirtual",
                    "reldiskControllerType": "createcustommetricSCSI",
                    "typelength": "application/vnd.abiquo.custommetric+json51",
                    "hreftitle": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/metrics"
                },
bcdc_tioco_03_vol_01",
               {                     "title": "enablemonitoring",
                    "rel": "enablemonitoringdisk1",
                    "type": "application/vnd.abiquo.volume+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/enablemonitoringvolumes/9"
                },
                {
                    "titlediskAllocation": "collectdTHIN",
                    "reldiskControllerType": "collectdIDE",
                    "typediskLabel": "application/jsonHard disk 1",
                    "hreflength": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/collectd"64",
                },      "title": "bbda1534-5e6c-4d47-8482-c282f383fabd",
          {                     "title"rel": "protectdisk0",
                    "reltype": "protect",
                    "type": "text/plain"application/vnd.abiquo.harddisk+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliancesdisks/1/virtualmachines/6/action/protect"
                },
                {
                    "title": "unprotectDefault Tier",
                    "rel": "unprotectdatastoretier0",
                    "type": "text/plainapplication/vnd.abiquo.datastoretier+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenterslocations/34/virtualappliances/1/virtualmachines/6/action/unprotectdatastoretiers/4"
                },
                {
                    "title": "ESXi192.168.0.2",
                    "rel": "hypervisortypenic0",
                    "type": "application/vnd.abiquo.hypervisortypeprivateip+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04/cloud/virtualdatacenters/3/privatenetworks/3/ips/7"
                },
                {
                    "title": "m0n0wallprotect",
                    "rel": "virtualmachinetemplateprotect",
                    "type": "application/vnd.abiquo.virtualmachinetemplate+jsontext/plain",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/adminvirtualdatacenters/3/enterprisesvirtualappliances/14/datacenterrepositoriesvirtualmachines/1182/virtualmachinetemplatesaction/39protect"
                },
                {
                    "title": "Firewallunprotect",
                    "rel": "categoryunprotect",
                    "type": "application/vnd.abiquo.category+jsontext/plain",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/config/categories/7/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/unprotect"
                },
             ],   {
                    "idtitle": 6"metricsmetadata",
            "name": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7",        "rel": "metricsmetadata",
      "ram": 128,             "cputype": 1"application/vnd.abiquo.metricsmetadata+json",
            "vdrpPort": 5004,             "vdrpIP"href": "192.168.2.61",https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/metrics"
            "vdrpEnabled": true,   },
         "idState": 6,      {
      "state": "OFF",             "highDisponibilitytitle": 0"enablemonitoring",
            "idType": 0,        "rel": "enablemonitoring",
      "type": "MANAGED",             "passwordtype": "3oEpBnaZ",
            "uuid": "ac655de3-a90a-4c68-9ade-d1e4265948b7",
            "labelhref": "m0n0wall",https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/enablemonitoring"
            "monitored": false,    },
                {
              "monitoringLevel      "title": "DEFAULTcollectd",
                    "variablesrel": {}"collectd",
             "protected": false       "type": "application/json",
          }     ],     "totalSizehref": "https: 1
}

The following links will provide information about the disks attached to the virtual machine:

Code Block
Code Block
//mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/metrics/collectd"
                },
                {
                    "title": "
Devol1
alarms",
                    "rel": "
disk1
alarms",
                    "type": "application/vnd.abiquo.
volume
alarms+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/
volumes/2
virtualappliances/4/virtualmachines/182/alarms"
                },
                {
                    "
diskController
title": "
lsilogic
actionplans",
                    "
diskControllerType
rel": "
SCSI
actionplans",
                    "
diskLabel
type": "
scsi0:0
application/vnd.abiquo.virtualmachineactionplans+json",
                    "
length
href": "
26",
https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/actionplans"
                },
                {
                    "title": "
8f62ef08-8f6a-4f08-9cd1-999b7b9c98dc
actionplansflat",
                    "rel": "
disk0
actionplansflat",
                    "type": "application/vnd.abiquo.
harddisk
virtualmachineactionplansflat+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/
disks
virtualappliances/4/virtualmachines/182/actionplans"
                },

 

From this response we can see that the disks attached are:

  • a hard disk with an ID of "4".
  • a volume with an ID of "2" 

Retrieve Available Volumes in an Enterprise's Virtual Datacenter

In the virtual machine DTO above, look for the link to the virtual datacenter.


                
{
                    "title": "
ESXBC
clone",
                    "rel": "
virtualdatacenter
clone",
                    "type": "application/vnd.abiquo.
virtualdatacenter
virtualmachinecloneoptions+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/clone"
                },

Get all the available volumes in the virtual datacenter by requesting all volumes with the parameter available = true.

cURL:

Code Block
curl -X GET http://mjsabq.bcn.abiquo.com/api/cloud/virtualdatacenters/2/volumes?available=true \ -H 'Accept: application/vnd.abiquo.volumes+json;version=3.6' \

                {
            
-u
 
admin:xabiquo
 
--verbose
 

Success status code: 200

Request payload:

--none--

Response payload:

Code Block
{
     "
links
title": 
[
"VMware vCenter",
       
{
             "rel": "
first
hypervisortype",
                    "type": "application/vnd.abiquo.hypervisortype+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
cloud
config/
virtualdatacenters/3/volumes?available=true&limit=25&by=id
hypervisortypes/VMX_04"
                },
        
{
        {
      
"rel":
 
"last",
             "
href": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes?available=true&startwith=0&limit=25&by=id" } ], "collection": [ { "links": [ { "
title": "
Devol2
yVM",
                    "rel": "
edit
virtualmachinetemplate",
                    "type": "application/vnd.abiquo.
volume
virtualmachinetemplate+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/
cloud
2/
virtualdatacenters
datacenterrepositories/
3
4/
volumes
virtualmachinetemplates/
3
1"
                },
                {
                    "title": "
Default Tier 1
Others",
                    "rel": "
tier
category",
                    "type": "application/vnd.abiquo.
tier
category+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
cloud
config/
virtualdatacenters
categories/
3/tiers/
1"
                }
,

            ]
   
{
     }
    
],
    
"
title
totalSize": 
"initiator mappings"
1
}



The following links will provide information about the hard disks and volumes attached to the VM. 

Code Block
                {
                    "title": "volumes",
                    "rel": "initiatormappingsvolumes",
                    "type": "application/vnd.abiquo.initiatormappingsvolumes+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/3/action/initiatormappingsvirtualappliances/4/virtualmachines/182/storage/volumes"
                },
                {
                    "diskController": "paravirtual",
                    "diskControllerType": "SCSI",
                    "length": "51",
                    "title": "ESXBCbcdc_tioco_03_vol_01",
                    "rel": "virtualdatacenterdisk1",
                    "type": "application/vnd.abiquo.virtualdatacentervolume+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/9"
                }
 ,
          ],      {
      "id": 3,             "namediskAllocation": "Devol2THIN",
            "description": "Dev volume 2",             "statediskControllerType": "DETACHEDIDE",
            "sizeInMB": 102,             "sequence"diskLabel": 0,"Hard disk 1",
          "allowResize": true,
            "diskControllerTypelength": "IDE64",
  
         "bootable": false         }     ],
    "totalSize": 1
}

From the above response, we can see that there are two volumes, one of which is already attached to a virtual machine. We will work with the other volume "Devol2", which has an ID of "3".

Edit the Virtual Machine

Copy the volume edit link from the volume you wish to attach to the virtual machine from the above response object.

Code Block
"title": "bbda1534-5e6c-4d47-8482-c282f383fabd",
         {           "titlerel": "Devol2disk0",
          "rel": "edit",           "type": "application/vnd.abiquo.volumeharddisk+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumesdisks/36"
        },

Check how many disks are on the virtual machine already. The example machine has two disks:

  • disk0 - the system hard disk on the hypervisor datastore
  • disk1 - another volume

Change the "rel" link to the disk's new sequence number. In this case it will be disk2

Code Block
        },
                {
                    "title": "Devol2Default Tier",
                    "rel": "disk2datastoretier0",
                    "type": "application/vnd.abiquo.volumedatastoretier+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenterslocations/34/volumesdatastoretiers/3"4"
                },

 

Add this new link to the virtual machine from above.

Remember that the virtual machine is part of a collection and you need to work with only the virtual machine 

Be careful not to remove any existing volume or NIC links, or you will remove the volume or NIC from the virtual machine!

Your new virtual machine DTO should look similar to the following example.

...

classwidecode tinycode

...

titleClick here to show or hide the API response example

...

languagehtml/xml
titleThe Virtual Machine

...

From this response we can see that the there is a volume with an ID of 9.

Retrieve Available Volumes in an Enterprise's Virtual Datacenter

In the VM DTO above, look for the link to the virtual datacenter.

Code Block
     
{
           
"links": [
{
                    "title": "
VMX
bcdc_tioco_
04
03",
                    "rel": "
machine
virtualdatacenter",
                    "type": "application/vnd.abiquo.
machine
virtualdatacenter+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
admin
cloud/
datacenters/1/racks/1/machines/1
virtualdatacenters/3"
                },

Get all the available volumes in the virtual datacenter by requesting all volumes with the parameter available = true.

cURL:

Code Block
curl -X GET http://mjsabq.bcn.abiquo.com/api/cloud/virtualdatacenters/3/volumes?available=true \
     -H 'Accept: application/vnd.abiquo.volumes+json;version=4.2' \ 
     -u admin:xabiquo --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

Code Block
{
    "links": [
        {
      
"title
      "rel": "
BCDC
first",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes?available=true&limit=25&by=id&asc=true"
       
"rel": "location"
 },
        {
            "
type
rel": "
application/vnd.abiquo.datacenter+json",
last",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/
locations/1
virtualdatacenters/3/volumes?available=true&startwith=0&limit=25&by=id&asc=true"
        }
    ],
  
},
  "collection": [
        {
     
{
       "id": 11,
            "
title
name": "
ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7
bcdc_tioco_03_vol_02",
            "description": "test volume 02",
     
"rel
       "state": "
edit
DETACHED",
            "sizeInMB": 51,
            "
type
sequence": 0,
           
"application/vnd.abiquo.virtualmachine+json"
 "allowResize": true,
            "diskControllerType": "SCSI",
            "
href
diskController": "
https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6"
paravirtual",
            "bootable": false,
            
},
"links": [
                {
                    "title": "
send mail
bcdc_tioco_03_vol_02",
                    "rel": "
sendmail
edit",
                    "type": "application/vnd.abiquo.
mail
volume+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
admin
cloud/
datacenters
virtualdatacenters/
1
3/
racks/1/machines/1/virtualmachines/6/action/sendmail
volumes/11"
                },
                {
                    "title": "
Abiquo
Default Tier 1",
                    "rel": "
enterprise
tier",
                    "type": "application/vnd.abiquo.
enterprise
tier+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
admin/enterprises/1
cloud/virtualdatacenters/3/tiers/13"
                },
                {
                    "title": "
Cloud
initiator 
Administrator
mappings",
                    "rel": "
user
initiatormappings",
                    "type": "application/vnd.abiquo.
user
initiatormappings+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
admin
cloud/
enterprises
virtualdatacenters/
1/users/1
3/volumes/11/action/initiatormappings"
                },
                {
                    "title": "
ESXBC
bcdc_tioco_03",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3"
                }
            ]
        }
    ],
    "totalSize": 1
}

From the above response, we will work with the volume "bcdc_tioco_03_vol_02", which has an ID of 11.

Edit the VM

Copy the volume edit link from the volume you wish to attach to the VM from the above response object.

Code Block
                {
                    "title": "
vapp_ESXBC
bcdc_tioco_03_vol_02",
                    "rel": "
virtualappliance
edit",
                    "type": "application/vnd.abiquo.
virtualappliance
volume+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/
virtualappliances
volumes/
1
11"
                },

Check how many disks are on the VM already. The example machine has two disks:

  • disk0 - the system hard disk on the hypervisor datastore
  • disk1 - another volume

Change the "rel" link to the disk's new sequence number. In this case it will be disk2

Code Block
                {
                    "title": "
metadata",
bcdc_tioco_03_vol_02",
                    "rel": "
metadata
disk2",
                    "type": "application/vnd.abiquo.
metadata
volume+json",
                    "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/
virtualappliances/1/virtualmachines/6/metadata
volumes/11"
                }, 

Add this new link to the VM from above.

Remember that the VM is part of a collection and you need to work with only the VM, not the whole collection entity.

Be careful not to remove any existing volume or NIC links, or you will remove the volume or NIC from the VM!

Your new VM DTO should look similar to the following example.

Div
classwidecode tinycode


Expand
titleClick here to show or hide the API response example


Code Block
languagehtml/xml
titleThe Virtual Machine
        {
       {       "id": 182,
             "titleuuid": "vlan network configurations",
       743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
            "relname": "configurationsABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
                    "type"label": "application/vnd.abiquo.virtualmachinenetworkconfigurations+jsonyVM_01",
                    "href"fqdn": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/network/configurations"box",
            "description": "A virtual machine",
},            "cpu": 1,
     {       "ram": 48,
            "titlevdrpEnabled": "192.168.0.0/22",
  true,
                 "relvdrpPort": "network_configuration",
   5914,
                "typevdrpIP": "application/vnd.abiquo.virtualmachinenetworkconfiguration+json",192.168.2.54",
            "idState": 6,
            "hrefstate": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/network/configurations/1"OFF",
            "idType": 0,
  },          "type": "MANAGED",
     {       "highDisponibility": 0,
            "titlepassword": "nicsxXs0fVBf",
            "metadata": null,
            "monitored": false,
            "relmonitoringLevel": "nicsDEFAULT",
            "protected": false,
            "typevariables": "application/vnd.abiquo.nics+json"{},
            "creationTimestamp": 1514900489000,
            "backuppolicies": [],
      "href": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/network/nics"
      "lastSynchronize": 1514904162000,
            "generateGuestInitialPassword": false,
            "links": [
 },                 {
                    "title": "disksVMX_04",
                    "rel": "harddisksmachine",
                    "type": "application/vnd.abiquo.harddisksmachine+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudadmin/virtualdatacentersdatacenters/34/virtualappliancesracks/14/virtualmachines/6/storage/disksmachines/2"
                },
                {
                    "title": "OFFBCDC",
                    "rel": "statelocation",
                    "type": "application/vnd.abiquo.virtualmachinestatedatacenter+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/statelocations/4"
                },
                {
                    "title": "virtual machine undeployABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
                    "rel": "undeployedit",
                    "type": "application/vnd.abiquo.acceptedrequestvirtualmachine+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6/action/undeploy182"
                },
                {
                    "title": "virtualsend machine deploymail",
                    "rel": "deploysendmail",
                    "type": "application/vnd.abiquo.acceptedrequestmail+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/cloud4/virtualdatacentersracks/34/virtualappliancesmachines/12/virtualmachines/6182/action/deploysendmail"
                },
                {
                    "title": "virtual machine resetTioco",
                    "rel": "resetenterprise",
                    "type": "application/vnd.abiquo.acceptedrequestenterprise+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudadmin/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/action/resetenterprises/2"
                },
                {
                    "title": "virtualCloud machine snapshotAdministrator",
                    "rel": "instanceuser",
                    "type": "application/vnd.abiquo.acceptedrequestuser+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudadmin/virtualdatacentersenterprises/32/virtualappliancesusers/1/virtualmachines/6/action/instance"
                },
                {
                    "title": "virtual machine restore backupbcdc_tioco_03",
                    "rel": "restorebackupvirtualdatacenter",
                    "type": "application/vnd.abiquo.acceptedrequestvirtualdatacenter+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/action/restorebackup"
                },
                {
                    "title": "remote accessbcdc_tioco_03_02",
                    "rel": "rdpaccessvirtualappliance",
                    "type": "text/plainapplication/vnd.abiquo.virtualappliance+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/config/rdpaccess4"
                },
                {
                    "title": "tasksmetadata",
                    "rel": "tasksmetadata",
                    "type": "application/vnd.abiquo.tasksmetadata+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/tasksmetadata"
                },
                {
                    "title": "firewallsvlan network configurations",
                    "rel": "firewallsconfigurations",
                    "type": "application/vnd.abiquo.linksvirtualmachinenetworkconfigurations+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/network/firewallsconfigurations"
                },
                {
                    "title": "load balancers192.168.0.0/24",
                    "rel": "loadbalancersnetwork_configuration",
                    "type": "application/vnd.abiquo.loadbalancersvirtualmachinenetworkconfiguration+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6network/configurations/loadbalancers3"
                },
                {
                    "title": "volumesnics",
                    "rel": "volumesnics",
                    "type": "application/vnd.abiquo.volumesnics+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/storagenetwork/volumesnics"
                },
                {
                    "title": "Devol1disks",
                    "rel": "disk1harddisks",
                    "type": "application/vnd.abiquo.volumeharddisks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/2/virtualappliances/4/virtualmachines/182/storage/disks"
                },
                {
                    "diskControllertitle": "lsilogicOFF",
                    "diskControllerTyperel": "SCSIstate",
                    "diskLabeltype": "scsi0:0application/vnd.abiquo.virtualmachinestate+json",
                    "lengthhref": "26"https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/state"
                },
                {
                    "title": "8f62ef08-8f6a-4f08-9cd1-999b7b9c98dcvirtual machine undeploy",
                    "rel": "disk0undeploy",
                    "type": "application/vnd.abiquo.harddiskacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/disksvirtualappliances/4/virtualmachines/182/action/undeploy"
                },
		          {     			 {
  "title": "Devol2",                  "title": "virtual machine deploy",
           			         "rel": "disk2deploy",
          			          "type": "application/vnd.abiquo.volumeacceptedrequest+json",
                    			"href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/3/virtualappliances/4/virtualmachines/182/action/deploy"
        		        },
                {
                    "title": "192.168.0.2virtual machine reset",
                    "rel": "nic0reset",
                    "type": "application/vnd.abiquo.privateipacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/privatenetworksvirtualmachines/1182/ipsaction/5reset"
                },
                {
                    "title": "metricsvirtual machine snapshot",
                    "rel": "metricsinstance",
                    "type": "application/vnd.abiquo.metricsacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6action/metricsinstance"
                },
                {
                    "title": "metricsmetadataremote access",
                    "rel": "metricsmetadatardpaccess",
                    "type": "application/vnd.abiquo.metricsmetadatavirtualmachineconsole+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6config/metricsrdpaccess"
                },
                {
                    "title": "createcustommetrictasks",
                    "rel": "createcustommetrictasks",
                    "type": "application/vnd.abiquo.custommetrictasks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/metricstasks"
                },
                {
                    "title": "enablemonitoringfirewalls",
                    "rel": "enablemonitoringfirewalls",
                    "type": "application/vnd.abiquo.links+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/enablemonitoringfirewalls"
                },
                {
                    "title": "collectdload balancers",
                    "rel": "collectdloadbalancers",
                    "type": "application/jsonvnd.abiquo.loadbalancers+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/collectdloadbalancers"
                },
                {
                    "title": "protectrequest on demand backup",
                    "rel": "protectrequestbackup",
                    "type": "text/plainapplication/vnd.abiquo.ondemandbackup+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6backup/action/protectrequest"
                },
                {
                    "title": "unprotectrequest a restore of a backup",
                    "rel": "unprotectrequestrestore",
                    "type": "text/plainapplication/vnd.abiquo.restore+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/backup/action/unprotectrestore"
                },
                {
                    "title": "ESXirelocate candidates",
                    "rel": "hypervisortyperelocatecandidates",
                    "type": "application/vnd.abiquo.hypervisortypelinks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/relocatecandidates"
                },
                {
                    "title": "m0n0wallrelocate",
                    "rel": "virtualmachinetemplaterelocate",
                    "type": "application/vnd.abiquo.virtualmachinetemplateacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/admin3/enterprisesvirtualappliances/14/datacenterrepositoriesvirtualmachines/1182/virtualmachinetemplatesaction/39relocate"
                },
                {
                    "title": "Firewallvolumes",
                    "rel": "categoryvolumes",
                    "type": "application/vnd.abiquo.categoryvolumes+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/config/categories/7/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/storage/volumes"
                },
            ],      {
      "id": 6,             "nametitle": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7bcdc_tioco_03_vol_02",
            "ram        "rel": 128"disk2",
            "cpu": 1,        "type": "application/vnd.abiquo.volume+json",
      "vdrpPort": 5004,             "vdrpIPhref": "192.168.2.61",https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/11"
             "vdrpEnabled": true,  }, 
         "idState": 6,      {
      "state": "OFF",             "highDisponibilitydiskController": 0"paravirtual",
            "idType": 0,        "diskControllerType": "SCSI",
      "type": "MANAGED",             "passwordlength": "3oEpBnaZ51",
 
          "uuid": "ac655de3-a90a-4c68-9ade-d1e4265948b7",             "labeltitle": "m0n0wallbcdc_tioco_03_vol_01",
              "monitored": false,     "rel": "disk1",
      "monitoringLevel": "DEFAULT",             "variablestype": {}"application/vnd.abiquo.volume+json",
            "protected": false         }

 

Reconfigure the Virtual Machine

Perform a put request on the virtual machine with the virtual machine that you edited to include the new link

 

Div
classwidecode tinycode
Code Block
titlePUT the Virtual Machine
curl -X PUT https://mjsabq
"href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/
virtualappliances/1/virtualmachines/6 \
volumes/9"
      
-H
 
'Accept:
 
application/vnd.abiquo.acceptedrequest+json;version=3.6'
 
\
      
-H 'Content-type: application/vnd.abiquo.virtualmachine+json;version=3.2' \
 },
      
-d
 
@virtualmachine_plus_volume.json
 
-u
 
admin:xabiquo
 
--verbose
 
Expand
titleClick here to show or hide the XML example
Code Block
languagehtml/xml
titleThe Virtual Machine entity in virtualMachineNewNIC.xml
{     "links": [
 {
       {             "titlediskAllocation": "VMX_04THIN",
            "rel        "diskControllerType": "machineIDE",
                "type": "application/vnd.abiquo.machine+json    "diskLabel": "Hard disk 1",
            "href": "https://mjsabq.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/1"         },
"length": "64",
       {             "title": "BCDCbbda1534-5e6c-4d47-8482-c282f383fabd",
                    "rel": "locationdisk0",
                    "type": "application/vnd.abiquo.datacenterharddisk+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1"virtualdatacenters/3/disks/6"
                },
                {
                    "title": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7Default Tier",
                    "rel": "editdatastoretier0",
                    "type": "application/vnd.abiquo.virtualmachinedatastoretier+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenterslocations/34/virtualappliances/1/virtualmachines/6datastoretiers/4"
        },        },
{             "title": "send mail",   {
                    "title": "192.168.0.2",
                    "rel": "sendmailnic0",
                    "type": "application/vnd.abiquo.mailprivateip+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admincloud/datacentersvirtualdatacenters/13/racksprivatenetworks/13/machines/1/virtualmachines/6/action/sendmailips/7"
                },
                {
                    "title": "Abiquoprotect",
                    "rel": "enterpriseprotect",
                    "type": "application/vnd.abiquo.enterprise+jsontext/plain",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/protect"
                },
        {        {
    "title": "Cloud Administrator",                "reltitle": "userunprotect",
                    "typerel": "application/vnd.abiquo.user+json",unprotect",
                    "type": "text/plain",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1"/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/unprotect"
                },
                {
                    "title": "ESXBCmetricsmetadata",
                    "rel": "virtualdatacentermetricsmetadata",
                    "type": "application/vnd.abiquo.virtualdatacentermetricsmetadata+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/metrics"
                },
                {
                    "title": "vapp_ESXBCenablemonitoring",
                    "rel": "virtualapplianceenablemonitoring",
                    "type": "application/vnd.abiquo.virtualappliance+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/4/virtualmachines/182/enablemonitoring"
                },
                {
                    "title": "metadatacollectd",
                    "rel": "metadatacollectd",
                    "type": "application/vnd.abiquo.metadata+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6metrics/metadatacollectd"
                },
                {
                    "title": "vlan network configurations","alarms",
                    "rel": "configurationsalarms",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurationsalarms+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/network/configurations"alarms"
                },
                {
                    "title": "192.168.0.0/22actionplans",
                    "rel": "network_configurationactionplans",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurationvirtualmachineactionplans+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6/network/configurations/1"182/actionplans"
                },
                {
                    "title": "nicsactionplansflat",
                    "rel": "nicsactionplansflat",
                    "type": "application/vnd.abiquo.nicsvirtualmachineactionplansflat+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/network/nicsactionplans"
                },
                {
                    "title": "disksclone",
                    "rel": "harddisksclone",
                    "type": "application/vnd.abiquo.harddisksvirtualmachinecloneoptions+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/storageaction/disks"clone"
                },
                {
                    "title": "OFFVMware vCenter",
                    "rel": "statehypervisortype",
                    "type": "application/vnd.abiquo.virtualmachinestatehypervisortype+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudconfig/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/state"hypervisortypes/VMX_04"
                },
                {
                    "title": "virtual machine undeploy",yVM",
                    "rel": "undeployvirtualmachinetemplate",
                    "type": "application/vnd.abiquo.acceptedrequestvirtualmachinetemplate+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudadmin/virtualdatacentersenterprises/32/virtualappliancesdatacenterrepositories/14/virtualmachines/6/action/undeployvirtualmachinetemplates/1"
                },
                {
                    "title": "virtual machine deploy",Others",
                    "rel": "deploycategory",
                    "type": "application/vnd.abiquo.acceptedrequestcategory+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudconfig/virtualdatacenterscategories/3/virtualappliances/1/virtualmachines/6/action/deploy"
        },        }
{            ]
"title": "virtual machine reset",             "rel": "reset",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "}

 



Reconfigure the VM

Perform a put request on the VM with the VM entity that you edited to include the new link.

Here the request data is the modified VM shown above. 

Code Block
titlePUT the Virtual Machine
curl -X PUT https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/
1
4/virtualmachines/
6/action/reset"
182 \
     -H 'Accept: application/vnd.abiquo.acceptedrequest+json;version=4.2' \
  
},
   -H 'Content-type: application/vnd.abiquo.virtualmachine+json;version=4.2' \
  
{
   -d @virtualmachine_plus_volume.json -u admin:xabiquo --verbose 


The request will return a link that can be used to check the progress of the task.

Code Block
titleTHE Task just created
{
    "
title
message": "
virtual
You 
machine
can 
snapshot",
keep track of the progress in the link",
    
"
rel
links":
"instance",
 [
        {
            "
type
rel": "
application/vnd.abiquo.acceptedrequest+json
status",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/
1
4/virtualmachines/
6
182/
action/instance
tasks/11ffdcb8-82c7-47f3-9c54-02c702e02a0d"
        }
,

    ]
}


Check Progress

We can check the progress of the task using:

Div
classwidecode tinycode


Code Block
titleThe Task
curl -X GET 
{
https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/186/tasks/b6f195f4-7337-4f8e-acd7-73f60fa43c41 \
     -u admin:xabiquo --verbose



Expand


Code Block
{
    "
title
taskId": "
virtual machine restore backup
11ffdcb8-82c7-47f3-9c54-02c702e02a0d",
    "userId": "1",
    
"
rel
type": "
restorebackup
RECONFIGURE",
    "ownerId": "182",
    
"
type
state": "
application/vnd.abiquo.acceptedrequest+json
FINISHED_SUCCESSFULLY",
    "creationTimestamp": 1514906797,
    "timestamp": 1514906804,
    "
href
jobs": 
"https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/action/restorebackup"
{
        
}
"links": [],
        "collection": [
 
{
           {
 
"title":
 
"remote
 
access",
             "
rel
id": "
rdpaccess",
11ffdcb8-82c7-47f3-9c54-02c702e02a0d.8b40afd0-9483-4c96-b173-9ab746c3913d",
                "
type
parentTaskId": "
text/plain
11ffdcb8-82c7-47f3-9c54-02c702e02a0d",
                "
href
type": "
https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/config/rdpaccess"
UPDATE_RESOURCES",
        
},
        "description": "UPD-OK - Update resources OK",
 
{
               "
title
state": "
tasks
DONE",
                "
rel
rollbackState": "
tasks
UNKNOWN",
                "
type
creationTimestamp": 
"application/vnd.abiquo.tasks+json",
1514906797,
                "
href
timestamp": 
"https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/tasks"
1514906797,
          
},
      "links": []
 
{
           },
 
"title":
 
"firewalls",
          {
  
"rel":
 
"firewalls",
             "
type
id": "
application/vnd.abiquo.links+json
11ffdcb8-82c7-47f3-9c54-02c702e02a0d.4ab35b47-f65a-41f8-b8fc-3d6388555eb8",
                "
href
parentTaskId": "
https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/firewalls"
11ffdcb8-82c7-47f3-9c54-02c702e02a0d",
          
},
      "type": "RECONFIGURE",
   
{
             "
title
description": "
load balancers
Reconfigure task's reconfigure on virtual machine with id 182",
                "
rel
state": "
loadbalancers
DONE",
                "
type
rollbackState": "
application/vnd.abiquo.loadbalancers+json
UNKNOWN",
                "
href
creationTimestamp": 
"https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/loadbalancers"
1514906797,
            
},
    "timestamp": 1514906804,
   
{
             "
title
links": 
"volumes",
[]
            }
        ]
    },
    "
rel
links":
"volumes",
 [
        {
            "
type
rel": "
application/vnd.abiquo.volumes+json
self",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/
1
4/virtualmachines/
6
182/
storage/volumes
tasks/11ffdcb8-82c7-47f3-9c54-02c702e02a0d"
        },
        {
            "
title
rel": "
Devol1
parent",
            "
rel
href": "
disk1",
https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/tasks"
        },
       
"type": "application/vnd.abiquo.volume+json",
 {
            "
href
rel": "
https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/2" },
result",
   
{
         
"
diskController
type": "
lsilogic
application/vnd.abiquo.virtualmachine+json",
            "
diskControllerType
href": "
SCSI",
https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182"
        
"diskLabel": "scsi0:0"
},
        
"length": "26",
{
            
"title": "
8f62ef08-8f6a-4f08-9cd1-999b7b9c98dc
admin",
            "rel": "
disk0
user",
            "type": "application/vnd.abiquo.
harddisk
user+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
cloud
admin/
virtualdatacenters
enterprises/
3
2/
disks
users/
4
1"
        },
        {
            "title": "
192.168.0.2
ABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
            "rel": "
nic0
virtualmachine",
            "type": "application/vnd.abiquo.
privateip
virtualmachine+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/
privatenetworks
virtualappliances/
1
4/
ips
virtualmachines/
5
182"
        }
,

    
{
]
}


Check the Volume is Attached

Get the VM and check that the disk2 link is present.

Expand


Code Block
Div
classwidecode tinycode
Code Block
titleTHE Task just created
{
    "
title
id": 
"metrics"
182,
    
"uuid": "743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
    "
rel
name": "
metrics
ABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
    
"label": "yVM_01",
    "
type
fqdn": "
application/vnd.abiquo.metrics+json
box",
    "description": "A virtual machine",
    "
href
cpu": 
"https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/metrics"
1,
    "ram": 48,
    "vdrpEnabled": 
}
true,
    "vdrpPort": 5914,
  
{
  "vdrpIP": "192.168.2.54",
    "idState": 6,
    "
title
state": "
metricsmetadata
OFF",
    "idType": 0,
    
"
rel
type": "
metricsmetadata
MANAGED",
    "highDisponibility": 0,
    
"
type
password": "
application/vnd.abiquo.metricsmetadata+json
xXs0fVBf",
    "metadata": null,
    "monitored": false,
    "monitoringLevel": "DEFAULT",
    "
href
protected": false,
    "
https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/metrics"
variables": {},
    "creationTimestamp": 1514900489000,
    "backuppolicies": [],
    "lastSynchronize": 1514906807000,
    "generateGuestInitialPassword": 
},
false,
    "links": [
        {
            "title": "
createcustommetric
VMX_04",
            "rel": "
createcustommetric
machine",
            "type": "application/vnd.abiquo.
custommetric
machine+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
cloud
admin/
virtualdatacenters
datacenters/
3
4/
virtualappliances
racks/
1
4/
virtualmachines
machines/
6/metrics
2"
        },
        {
            "title": "
enablemonitoring
BCDC",
            "rel": "
enablemonitoring
location",
            "type": "application/vnd.abiquo.datacenter+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/
virtualdatacenters/3/virtualappliances/1/virtualmachines/6/enablemonitoring
locations/4"
        },
        {
            "title": "
collectd
ABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
            "rel": "
collectd
edit",
            "type": "application/vnd.abiquo.virtualmachine+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/
1
4/virtualmachines/
6/collectd
182"
        },
        {
            "title": "
protect
send mail",
            "rel": "
protect
sendmail",
            "type": "
text/plain
application/vnd.abiquo.mail+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/
cloud
4/
virtualdatacenters
racks/
3
4/
virtualappliances
machines/
1
2/virtualmachines/
6
182/action/
protect
sendmail"
        },
        {
            "title": "
unprotect
Tioco",
            "rel": "
unprotect
enterprise",
            "type": "
text/plain
application/vnd.abiquo.enterprise+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
cloud
admin/
virtualdatacenters/3/virtualappliances/1/virtualmachines/6/action/unprotect
enterprises/2"
        },
        {
            "title": "
ESXi
Cloud Administrator",
            "rel": "
hypervisortype
user",
            "type": "application/vnd.abiquo.
hypervisortype
user+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/
config
2/
hypervisortypes
users/
VMX_04
1"
        },
        {
            "title": "
m0n0wall
bcdc_tioco_03",
            "rel": "
virtualmachinetemplate
virtualdatacenter",
            "type": "application/vnd.abiquo.
virtualmachinetemplate
virtualdatacenter+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/
admin
cloud/
enterprises/1/datacenterrepositories/1/virtualmachinetemplates/39
virtualdatacenters/3"
        },
        {
            "title": "
Firewall
bcdc_tioco_03_02",
            "rel": "
category
virtualappliance",
            "type": "application/vnd.abiquo.
category
virtualappliance+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/
config
3/
categories
virtualappliances/
7
4"
        },
        {
            "title": "
Devol2
metadata",
            "rel": "
disk2
metadata",
            "type": "application/vnd.abiquo.
volume
metadata+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3
/volumes/3
/virtualappliances/4/virtualmachines/182/metadata"
        },
    
],
    {
"id":
 
6,
     
"name":
 
"ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7",
     "
ram
title": 
128,
"vlan network configurations",
     
"cpu": 1,
       "
vdrpPort
rel": 
5004
"configurations",
    
"vdrpIP
        "type": "
192
application/vnd.
168.2.61
abiquo.virtualmachinenetworkconfigurations+json",
      
"vdrpEnabled":
 
true,
     "
idState
href": 
6,
"https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/network/configurations"
       
"state": "OFF"
 },
    
"highDisponibility":
 
0,
   {
 
"idType":
 
0,
    
"type":
 
"MANAGED",
     "
password
title": "
3oEpBnaZ
192.168.0.0/24",
     
"uuid": "ac655de3-a90a-4c68-9ade-d1e4265948b7",
       "
label
rel": "
m0n0wall
network_configuration",
      
"monitored":
 
false,
     "
monitoringLevel
type": "
DEFAULT
application/vnd.abiquo.virtualmachinenetworkconfiguration+json",
     
"variables": {},
       "
protected
href": 
false }

The request will return a link that can be used to check the progress of the task.

{
  "links": ["https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/network/configurations/3"
        },
        {
            "reltitle": "statusnics",
            "hrefrel": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/tasks/b6f195f4-7337-4f8e-acd7-73f60fa43c41"nics",
      }   ],   "entitytype": "You can keep track of the progress in the link"
}

Check Progress

We can check the progress of the task using:

Div
classwidecode tinycode
Code Block
titleThe Task
curl -X GET https://mjsabq"application/vnd.abiquo.nics+json",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/tasks/b6f195f4-7337-4f8e-acd7-73f60fa43c41 \network/nics"
      -u admin:xabiquo --verbose
Expand
Code Block
{  },
        {
            "linkstitle": [ "disks",
            {"rel": "harddisks",
            "reltype": "selfapplication/vnd.abiquo.harddisks+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/tasks/b6f195f4-7337-4f8e-acd7-73f60fa43c41storage/disks"
        },
        {
            "title": "OFF",
            "rel": "state",
            "type": "parentapplication/vnd.abiquo.virtualmachinestate+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/tasksstate"
        },
        {
            "title": "adminvirtual machine undeploy",
            "rel": "userundeploy",
            "type": "application/vnd.abiquo.useracceptedrequest+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/undeploy"
        },
        {
            "title": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7virtual machine deploy",
            "rel": "virtualmachinedeploy",
            "type": "application/vnd.abiquo.virtualmachineacceptedrequest+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/action/6deploy"
        },
    ],    {
"taskId": "b6f195f4-7337-4f8e-acd7-73f60fa43c41",     "userId": "1",     "typetitle": "RECONFIGUREvirtual machine reset",
    "ownerId": "6",        "staterel": "STARTEDreset",
    "creationTimestamp": 1443796512,        "timestamptype": 1443796513"application/vnd.abiquo.acceptedrequest+json",
    "jobs": {
        "linkshref": [],
        "collection": ["https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/reset"
        },
    {    {
            "linkstitle": [],"virtual machine   snapshot",
            "idrel": "b6f195f4-7337-4f8e-acd7-73f60fa43c41.2549a555-5c57-4312-89a2-18719df02583",
   instance",
            "parentTaskIdtype": "b6f195f4-7337-4f8e-acd7-73f60fa43c41application/vnd.abiquo.acceptedrequest+json",
                "typehref": "UPDATE_RESOURCES",
https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/instance"
        },
      "description": "UPD-OK -{
Update resources OK",                 "state"title": "DONEremote access",
                "rollbackStaterel": "UNKNOWNrdpaccess",
 
              "creationTimestamptype": 1443796512"application/vnd.abiquo.virtualmachineconsole+json",
                "timestamphref": 1443796513
   "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/config/rdpaccess"
        },
 
          {
                "linkstitle": []"tasks",
                "idrel": "b6f195f4-7337-4f8e-acd7-73f60fa43c41.7be16012-49ca-400f-996c-e4f7e699d2f6tasks",
                "parentTaskIdtype": "b6f195f4-7337-4f8e-acd7-73f60fa43c41",
  application/vnd.abiquo.tasks+json",
             "typehref": "RECONFIGURE",https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/tasks"
        },
       "description": "Reconfigure task's reconfigure on virtual machine with id 6", {
                       "state"title": "STARTEDfirewalls",

               "rollbackStaterel": "UNKNOWNfirewalls",

               "creationTimestamptype": 1443796512,
   "application/vnd.abiquo.links+json",
            "timestamphref": 1443796513"https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/firewalls"
            }
     },
  ]     } }

Check the Volume is Attached

Get the virtual machine and check that the disk2 link is present.

Expand
Code Block
{
    "links": [
        {
            "title": "VMX_04load balancers",
            "rel": "machineloadbalancers",
            "type": "application/vnd.abiquo.machineloadbalancers+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admincloud/virtualdatacenters/datacenters3/1virtualappliances/racks4/1virtualmachines/machines182/1loadbalancers"
        },
        {
            "title": "BCDCrequest on demand backup",
            "rel": "locationrequestbackup",
            "type": "application/vnd.abiquo.datacenterondemandbackup+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/backup/action/request"
        },
        {
            "title": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7request a restore of a backup",
            "rel": "editrequestrestore",
            "type": "application/vnd.abiquo.virtualmachinerestore+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/backup/action/restore"
        },
        {
            "title": "sendrelocate mailcandidates",
            "rel": "sendmailrelocatecandidates",
            "type": "application/vnd.abiquo.maillinks+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admincloud/datacentersvirtualdatacenters/13/racksvirtualappliances/1/machines4/1/virtualmachines/6182/action/sendmailrelocatecandidates"
        },
        {
            "title": "Abiquorelocate",
            "rel": "enterpriserelocate",
            "type": "application/vnd.abiquo.enterpriseacceptedrequest+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/action/relocate"
        },
        {
            "title": "Cloud Administratorvolumes",
            "rel": "uservolumes",
            "type": "application/vnd.abiquo.uservolumes+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/storage/volumes"
        },
        {
            "titlediskController": "ESXBCparavirtual",
            "reldiskControllerType": "virtualdatacenterSCSI",
            "typelength": "application/vnd.abiquo.virtualdatacenter+json51",
            "hreftitle": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3"
        },
        {bcdc_tioco_03_vol_01",
               "title": "vapp_ESXBC",
            "rel": "virtualappliancedisk1",
            "type": "application/vnd.abiquo.virtualappliancevolume+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliancesvolumes/19"
        },
        {
            "titlediskController": "metadataparavirtual",
            "reldiskControllerType": "metadataSCSI",
            "typelength": "application/vnd.abiquo.metadata+json",
            "href": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/metadata"
        }51",
        {
            "title": "vlan network configurationsbcdc_tioco_03_vol_02",
            "rel": "configurationsdisk2",
            "type": "application/vnd.abiquo.virtualmachinenetworkconfigurationsvolume+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/network/configurationsvolumes/11"
        },
        {
            "titlediskAllocation": "192.168.0.0/22THIN",
            "reldiskControllerType": "network_configurationIDE",
            "typediskLabel": "application/vnd.abiquo.virtualmachinenetworkconfiguration+jsonHard disk 1",
            "hreflength": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/network/configurations/1"
        },
64",
       {             "title": "nicsbbda1534-5e6c-4d47-8482-c282f383fabd",
            "rel": "nicsdisk0",
            "type": "application/vnd.abiquo.nicsharddisk+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachinesdisks/6/network/nics"
        },
        {
            "title": "disksDefault Tier",
            "rel": "harddisksdatastoretier0",
            "type": "application/vnd.abiquo.harddisksdatastoretier+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenterslocations/34/virtualappliances/1/virtualmachines/6/storage/disksdatastoretiers/4"
        },
        {
            "title": "OFF192.168.0.2",
            "rel": "statenic0",
            "type": "application/vnd.abiquo.virtualmachinestateprivateip+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliancesprivatenetworks/13/virtualmachinesips/6/state7"
        },
        {
            "title": "virtual machine undeployprotect",
            "rel": "undeployprotect",
            "type": "application/vnd.abiquo.acceptedrequest+jsontext/plain",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/undeployprotect"
        },
        {
            "title": "virtual machine deployunprotect",
            "rel": "deployunprotect",
            "type": "application/vnd.abiquo.acceptedrequest+jsontext/plain",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/deployunprotect"
        },
        {
            "title": "virtual machine resetmetricsmetadata",
            "rel": "resetmetricsmetadata",
            "type": "application/vnd.abiquo.acceptedrequestmetricsmetadata+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/resetmetrics"
        },
        {
            "title": "virtual machine snapshotenablemonitoring",
            "rel": "instanceenablemonitoring",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/instanceenablemonitoring"
        },
        {
            "title": "virtual machine restore backupcollectd",
            "rel": "restorebackupcollectd",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/actionmetrics/restorebackupcollectd"
        },
        {
            "title": "remote accessalarms",
            "rel": "rdpaccessalarms",
            "type": "text/plainapplication/vnd.abiquo.alarms+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/config/rdpaccessalarms"
        },
        {
            "title": "tasksactionplans",
            "rel": "tasksactionplans",
            "type": "application/vnd.abiquo.tasksvirtualmachineactionplans+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/tasksactionplans"
        },
        {
            "title": "firewallsactionplansflat",
            "rel": "firewallsactionplansflat",
            "type": "application/vnd.abiquo.linksvirtualmachineactionplansflat+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/firewallsactionplans"
        },
        {
            "title": "load balancersclone",
            "rel": "loadbalancersclone",
            "type": "application/vnd.abiquo.loadbalancersvirtualmachinecloneoptions+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6action/loadbalancersclone"
        },
        {
            "title": "volumesVMware vCenter",
            "rel": "volumeshypervisortype",
            "type": "application/vnd.abiquo.volumeshypervisortype+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudconfig/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/storage/volumeshypervisortypes/VMX_04"
        },
        {
            "title": "Devol1yVM",
            "rel": "disk1virtualmachinetemplate",
            "type": "application/vnd.abiquo.volumevirtualmachinetemplate+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/cloudenterprises/2/virtualdatacentersdatacenterrepositories/34/volumesvirtualmachinetemplates/21"
        },
        {
            "title": "Devol2Others",
            "rel": "disk2category",
            "type": "application/vnd.abiquo.volumecategory+json",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloudconfig/virtualdatacenters/3/volumes/3categories/1"
        },
    ]
} 


 

In the above VM you can see the volume link, which is shown here.

Code Block
  
{
      
"diskController": "lsilogic",
{
            "
diskControllerType
diskController": "
SCSI
paravirtual",
            "
diskLabel
diskControllerType": "
scsi0:0
SCSI",
            "length": "
26
51",
            "title": "
8f62ef08-8f6a-4f08-9cd1-999b7b9c98dc
bcdc_tioco_03_vol_02",
            "rel": "
disk0
disk2",
            "type": "application/vnd.abiquo.
harddisk
volume+json",
            "href": "https://
mjsabq
mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/
disks
volumes/
4
11"
        }, 

 

Detach the Volume

To detach a volume, remove the volume link from the DTO and perform a put request for the VM.

cURL:

Code Block
curl -X PUT https://mjspac.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182 \
   
{
  
"title": "192.168.0.2",
-H 'Accept: application/vnd.abiquo.acceptedrequest+json;version=4.2' \
     
"rel": "nic0", "type": "
-H 'Content-type: application/vnd.abiquo.
privateip
virtualmachine+json
",
;version=4.2' \
     -d @virtualmachine_minus_volume.json 
     
"href": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/privatenetworks/1/ips/5" },
-u admin:xabiquo --verbose 

In a test system, you could use the original VM before you added the volume.

Expand

Request payload:

Code Block
        {
            "titleid": "metrics"182,
            "reluuid": "metrics743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
            "typename": "application/vnd.abiquo.metrics+jsonABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
            "hreflabel": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/metrics"
        },
    yVM_01",
   {             "titlefqdn": "metricsmetadatabox",
            "reldescription": "metricsmetadataA virtual machine",
            "typecpu": "application/vnd.abiquo.metricsmetadata+json"1,
            "hrefram": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/metrics"
        },
48,
       {             "title"vdrpEnabled": "createcustommetric"true,
            "rel": "createcustommetric"vdrpPort": 5914,
            "typevdrpIP": "application/vnd.abiquo.custommetric+json192.168.2.54",
            "hrefidState": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/metrics"6,
        },         {"state": "OFF",
            "titleidType": "enablemonitoring"0,
            "reltype": "enablemonitoringMANAGED",
            "typehighDisponibility": ""0,
            "hrefpassword": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/enablemonitoring"xXs0fVBf",
        },         {"metadata": null,
            "titlemonitored": "collectd"false,
            "relmonitoringLevel": "collectdDEFAULT",
            "typeprotected": "application/json"false,
            "hrefvariables": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/collectd"{},
        },    "creationTimestamp": 1514900489000,
   {
            "titlebackuppolicies": "protect"[],
            "rellastSynchronize": "protect"1514904162000,
            "typegenerateGuestInitialPassword": "text/plain"false,
            "hreflinks": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/action/protect"[
        },
        {
            "title": "unprotect",             "reltitle": "unprotectVMX_04",
            "type": "text/plain",             "href"rel": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/action/unprotect"
        }machine",
        {             "titletype": "ESXiapplication/vnd.abiquo.machine+json",
            "rel": "hypervisortype",             "type"href": "application/vnd.abiquo.hypervisortype+json",https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/4/racks/4/machines/2"
                },
   "href": "https://mjsabq.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04"            }, {
       {             "title": "m0n0wallBCDC",
                    "rel": "virtualmachinetemplatelocation",
                    "type": "application/vnd.abiquo.virtualmachinetemplatedatacenter+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admincloud/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/39locations/4"
                },
                {
                    "title": "Firewall",ABQ_743bfe9e-1e6a-47ee-8146-27bbddc2f3cb",
                    "rel": "categoryedit",
                    "type": "application/vnd.abiquo.categoryvirtualmachine+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/config/categories/7"
     /cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182"
  }     ],
    "id": 6,
    "name": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7",         "ram": 128},
     "cpu": 1,        "vdrpPort": 5004,  {
  "vdrpIP": "192.168.2.61",     "vdrpEnabled": true,     "idState": 6,     "statetitle": "OFFsend mail",
        "highDisponibility": 0,     "idType": 0,     "typerel": "MANAGEDsendmail",
    "password": "3oEpBnaZ",          "uuid": "ac655de3-a90a-4c68-9ade-d1e4265948b7",     "labeltype": "m0n0wallapplication/vnd.abiquo.mail+json",
    "monitored": false,     "monitoringLevel": "DEFAULT",     "variables": {},     "protectedhref": false
}

 

In the above virtual machine you can see the volume link, which is shown here.

Code Block
"https://mjsabiquo.bcn.abiquo.com:443/api/admin/datacenters/4/racks/4/machines/2/virtualmachines/182/action/sendmail"
             
{
   },
         
"title":
 
"Devol2",
      {
      
"rel":
 
"disk2",
             "
type
title": "
application/vnd.abiquo.volume+json
Tioco",
            
"href":
 
"https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/3"
       "rel": 
},

 

Detach the Volume

To detach a volume, remove the volume link from the DTO and perform a put request for the virtual machine.

cURL:

:

Code Block
curl -X PUT https://mjspac.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/6/virtualmachines/116 \
"enterprise",
          
-H
 
'Accept:
 
application/vnd.abiquo.acceptedrequest+json;version=3.2'
 
\
      
-H
 
'Content-
"type": "application/vnd.abiquo.
virtualmachine
enterprise+json
;version=3.2' \ -d @virtualmachine_minus_volume.json \ 
",
          
-u
 
admin:xabiquo
 
--verbose
  
Expand

Request payload:

This is the original virtual machine that we retrieved before we added a disk.

Code Block
      "href":  {"https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2"
               "links": [ },
                {
                    "title": "VMX_04Cloud Administrator",
                    "rel": "machineuser",
                    "type": "application/vnd.abiquo.machineuser+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/datacentersenterprises/1/racks/1/machines2/users/1"
                },
                {
                    "title": "BCDCbcdc_tioco_03",
                    "rel": "locationvirtualdatacenter",
                    "type": "application/vnd.abiquo.datacentervirtualdatacenter+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/locationsvirtualdatacenters/13"
                },
                {
                    "title": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7bcdc_tioco_03_02",
                    "rel": "editvirtualappliance",
                    "type": "application/vnd.abiquo.virtualmachinevirtualappliance+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/64"
                },
                {
                    "title": "send mailmetadata",
                    "rel": "sendmailmetadata",
                    "type": "application/vnd.abiquo.mailmetadata+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admincloud/datacentersvirtualdatacenters/13/racksvirtualappliances/14/machines/1/virtualmachines/6182/action/sendmailmetadata"
                },
                {
                    "title": "Abiquovlan network configurations",
                    "rel": "enterpriseconfigurations",
                    "type": "application/vnd.abiquo.enterprisevirtualmachinenetworkconfigurations+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/network/configurations"
                },
                {
                    "title": "Cloud Administrator" "192.168.0.0/24",
                    "rel": "usernetwork_configuration",
                    "type": "application/vnd.abiquo.uservirtualmachinenetworkconfiguration+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/1/users/1/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/network/configurations/3"
                },
                {
                    "title": "ESXBCnics",
                    "rel": "virtualdatacenternics",
                    "type": "application/vnd.abiquo.virtualdatacenternics+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/network/nics"
                },
                {
                    "title": "vapp_ESXBCdisks",
                    "rel": "virtualapplianceharddisks",
                    "type": "application/vnd.abiquo.virtualapplianceharddisks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/storage/disks"
                },
                {
                    "title": "metadataOFF",
                    "rel": "metadatastate",
                    "type": "application/vnd.abiquo.metadatavirtualmachinestate+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/metadatastate"
                },
                {
                    "title": "vlanvirtual networkmachine configurationsundeploy",
                    "rel": "configurationsundeploy",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurationsacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/networkaction/configurationsundeploy"
                },
                {
                    "title": "192.168.0.0/22virtual machine deploy",
                    "rel": "network_configurationdeploy",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurationacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/networkaction/configurations/1deploy"
                },
                {
                    "title": "nicsvirtual machine reset",
                    "rel": "nicsreset",
                    "type": "application/vnd.abiquo.nicsacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/networkaction/nicsreset"
                },
                {
                    "title": "disksvirtual machine snapshot",
                    "rel": "harddisksinstance",
                    "type": "application/vnd.abiquo.harddisksacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/storageaction/disksinstance"
                },
                {
                    "title": "OFFremote access",
                    "rel": "staterdpaccess",
                    "type": "application/vnd.abiquo.virtualmachinestatevirtualmachineconsole+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6config/staterdpaccess"
                },
                {
                    "title": "virtual machine undeploytasks",
                    "rel": "undeploytasks",
                    "type": "application/vnd.abiquo.acceptedrequesttasks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/undeploytasks"
                },
                {
                    "title": "virtual machine deployfirewalls",
                    "rel": "deployfirewalls",
                    "type": "application/vnd.abiquo.acceptedrequestlinks+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/deployfirewalls"
                },
                {
                    "title": "virtualload machine resetbalancers",
                    "rel": "resetloadbalancers",
                    "type": "application/vnd.abiquo.acceptedrequestloadbalancers+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/resetloadbalancers"
                },
                {
                    "title": "virtualrequest on machinedemand snapshotbackup",
                    "rel": "instancerequestbackup",
                    "type": "application/vnd.abiquo.acceptedrequestondemandbackup+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/backup/action/instancerequest"
                },
                {
                    "title": "virtualrequest machinea restore of a backup",
                    "rel": "restorebackuprequestrestore",
                    "type": "application/vnd.abiquo.acceptedrequestrestore+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6backup/action/restorebackuprestore"
                },
                {
                    "title": "remoterelocate accesscandidates",
                    "rel": "rdpaccessrelocatecandidates",
                    "type": "text/plainapplication/vnd.abiquo.links+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/configaction/rdpaccessrelocatecandidates"
                },
                {
                    "title": "tasksrelocate",
                    "rel": "tasksrelocate",
                    "type": "application/vnd.abiquo.tasksacceptedrequest+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/tasksrelocate"
                },
                {
                    "title": "firewallsvolumes",
                    "rel": "firewallsvolumes",
                    "type": "application/vnd.abiquo.linksvolumes+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6/firewalls"
                },
                {
         storage/volumes"
          "title": "load balancers",    },
                "rel": "loadbalancers",{
                     "typediskController": "application/vnd.abiquo.loadbalancers+jsonparavirtual",
                    "hrefdiskControllerType": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/loadbalancers"SCSI",
                },       "length": "51",
         {                     "title": "volumesbcdc_tioco_03_vol_01",
                    "rel": "volumesdisk1",
                    "type": "application/vnd.abiquo.volumesvolume+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/1/virtualmachines/6/storage/volumesvolumes/9"
                },
                {
                    "titlediskAllocation": "Devol1THIN",
                    "reldiskControllerType": "disk1IDE",
   
                "type": "application/vnd.abiquo.volume+json",                     "href": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/2"         "diskLabel": "Hard disk 1",
    },                 {"length": "64",
                    "diskControllertitle": "lsilogicbbda1534-5e6c-4d47-8482-c282f383fabd",
                    "diskControllerTyperel": "SCSIdisk0",
                    "diskLabeltype": "scsi0:0application/vnd.abiquo.harddisk+json",
                    "lengthhref": "26",https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/disks/6"
                },
                {
                    "title": "8f62ef08-8f6a-4f08-9cd1-999b7b9c98dcDefault Tier",
                    "rel": "disk0datastoretier0",
                    "type": "application/vnd.abiquo.harddiskdatastoretier+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenterslocations/34/disksdatastoretiers/4"
                },
                {
                    "title": "192.168.0.2",
                    "rel": "nic0",
                    "type": "application/vnd.abiquo.privateip+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/privatenetworks/13/ips/57"
                },
                {
                    "title": "metricsprotect",
                    "rel": "metricsprotect",
                    "type": "application/vnd.abiquo.metrics+jsontext/plain",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6action/metricsprotect"
                },
                {
                    "title": "metricsmetadataunprotect",
                    "rel": "metricsmetadataunprotect",
                    "type": "application/vnd.abiquo.metricsmetadata+jsontext/plain",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/metricsunprotect"
                },
                {
                    "title": "createcustommetricmetricsmetadata",
                    "rel": "createcustommetricmetricsmetadata",
                    "type": "application/vnd.abiquo.custommetricmetricsmetadata+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/metrics"
                },
                {
                    "title": "enablemonitoring",
                    "rel": "enablemonitoring",
                    "type": "",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/enablemonitoring"
                },
                {
                    "title": "collectd",
                    "rel": "collectd",
                    "type": "application/json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/182/6metrics/collectd"
                },
                {
                    "title": "protectalarms",
                    "rel": "protectalarms",
                    "type": "text/plainapplication/vnd.abiquo.alarms+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/protectalarms"
                },
                {
                    "title": "unprotectactionplans",
                    "rel": "unprotectactionplans",
                    "type": "text/plainapplication/vnd.abiquo.virtualmachineactionplans+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/action/unprotectactionplans"
                },
                {
                    "title": "ESXiactionplansflat",
                    "rel": "hypervisortypeactionplansflat",
                    "type": "application/vnd.abiquo.hypervisortypevirtualmachineactionplansflat+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/actionplans"
                },
                {
                    "title": "m0n0wallclone",
                    "rel": "virtualmachinetemplateclone",
                    "type": "application/vnd.abiquo.virtualmachinetemplatevirtualmachinecloneoptions+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/admin3/enterprisesvirtualappliances/14/datacenterrepositoriesvirtualmachines/1182/virtualmachinetemplatesaction/39clone"
                },
                {
                    "title": "FirewallVMware vCenter",
                    "rel": "categoryhypervisortype",
                    "type": "application/vnd.abiquo.categoryhypervisortype+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/config/categorieshypervisortypes/7VMX_04"
                },
            ],    {
        "id": 6,             "nametitle": "ABQ_ac655de3-a90a-4c68-9ade-d1e4265948b7yVM",
 
          "ram": 128,             "cpurel": 1"virtualmachinetemplate",
            "vdrpPort": 5004,             "vdrpIP"type": "192application/vnd.168.2.61",
   abiquo.virtualmachinetemplate+json",
        "vdrpEnabled": true,
            "idStatehref": 6,"https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/4/virtualmachinetemplates/1"
            "state": "OFF",   },
         "highDisponibility": 0,      {
      "idType": 0,             "typetitle": "MANAGEDOthers",
            "password        "rel": "3oEpBnaZcategory",
            "uuid": "ac655de3-a90a-4c68-9ade-d1e4265948b7",             "labeltype": "m0n0wallapplication/vnd.abiquo.category+json",

           "monitored": false,             "monitoringLevelhref": "DEFAULT",https://mjsabiquo.bcn.abiquo.com:443/api/config/categories/1"
               "variables": {},
            ]
"protected": false       }

}

 

Success status code: 200

{

Response payload:

Code Block
Code Block
{
    "message": "You can keep track of the progress in the link",
    "links": [
        {
            "rel": "status",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/14/virtualmachines/6182/tasks/db43acb99c50f4ef-ac2b5c23-47cd4e7e-9b42a576-d9c5607f98f780a2be891efc"
        }
    ],
    "entity": "You can keep
track of the progress in the link"
}


To check the volume has been detached get the available volumes, virtual machine VM or the volume. For example, the volume is now available again, so it will be listed in available volumes again.

Expand

cURL:

Code Block
curl -X GET http://mjspac.bcn.abiquo.com/api/cloud/virtualdatacenters/3/volumes?available=true \
     -H 'Accept: application/vnd.abiquo.volumes+json;version=34.62' \ 
     -u admin:xabiquo --verbose 

Success status code: 200

Request payload:

-- none --

Response payload:

Code Block
{
    "links": [
        {
            "rel": "first",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes?available=true&limit=25&by=id&asc=true"
        },
        {
            "rel": "last",
            "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes?available=true&startwith=0&limit=25&by=id&asc=true"
        }
    ],
    "collection": [
        {
            "linksid": [11,
            "name": "bcdc_tioco_03_vol_02",
       {     "description": "test volume 02",
            "titlestate": "Devol2DETACHED",
            "sizeInMB": 51,
            "relsequence": "edit"0,
            "allowResize": true,
      "type      "diskControllerType": "application/vnd.abiquo.volume+jsonSCSI",
                    "href"diskController": "https://mjsabq.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/3"
   paravirtual",
            "bootable": false,
            },"links": [
                {
                    "title": "Default Tier 1bcdc_tioco_03_vol_02",
                    "rel": "tieredit",
                    "type": "application/vnd.abiquo.tiervolume+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/tiersvolumes/111"
                },
                {
                    "title": "initiatorDefault Tier mappings1",
                    "rel": "initiatormappingstier",
                    "type": "application/vnd.abiquo.initiatormappingstier+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/3/action/initiatormappingstiers/13"
                },
                {
                    "title": "ESXBCinitiator mappings",
                    "rel": "virtualdatacenterinitiatormappings",
                    "type": "application/vnd.abiquo.virtualdatacenterinitiatormappings+json",
                    "href": "https://mjsabqmjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/volumes/11/action/initiatormappings"
                },
            ],      {
      "id": 3,             "nametitle": "Devol2bcdc_tioco_03",
            "description": "Dev volume 2",     "rel": "virtualdatacenter",
      "state": "DETACHED",             "sizeInMBtype": 102"application/vnd.abiquo.virtualdatacenter+json",
            "sequence": 0,             "allowResize": true,"href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3"
              "diskControllerType": "IDE", }
           "bootable": false]
        }
    ],
    "totalSize": 1
}