Versions Compared

Key

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

...

The steps in this diagram link to the pages of the API reference guide for resources and data entities.



Detailed steps

...

To add a hard disk to a VM via API

  1. Send a GET request to the API login resource to obtain the token from the X-Abiquo-Token header for authentication

    Code Block
    curl --verbose -X GET "https://
    abiquoapi
    nardo40.bcn.abiquo.com:443/api/
    cloud/virtualmachines?vmlabel=yVM_hd" \ -H "Accept: application/vnd.abiquo.virtualmachines+json;version=4.7" \ -u user:password
    login" -u adminuser:password -k | jq .


  2. Sample response. Success status code: 200
    Note that this

    Get VMs from the cloud and separate the VM entity. Filter the VMs by vmlabel, for example, as shown in the following cURL. If the request is successful, the status code is 200. This request returns a collection of VMs, so you will need to get the VM from within the collection

    . You can also

    or use the edit link to obtain the VM by itself

    expand

    Code Block
    {
    curl --verbose -k -X GET "
    totalSize": 1, "links": [
    https://nardo40.bcn.abiquo.com:443/api/cloud/virtualmachines?vmlabel=yVM_addDisk" \
            
    {
    -H "Accept: application/vnd.abiquo.virtualmachines+json;version=5.0" \
            -H "
    rel"
    Authorization:
    "first", "href": "
     Token a2e1981..." | jq .


    Reference: https://

    abiquoapi

    wiki.

    bcn.

    abiquo.com

    :443

    /api/

    cloud/virtualmachines?vmlabel=yVM_hd&limit=25&by=name&asc=true"

    latest/AllVirtualMachinesResource.html#list-virtual-machines-of-the-user

    Keep the VM entity to create the VM object for the update. As well as the VM edit link, you will also need the harddisks, datastore tiers, diskX, and virtualdatacenter links.

    1. VM edit link

      Code Block
              {
      
      },
               
      {
       "title": "ABQ_f5067776-9b43-4105-bb5a-4478ecf9b96c",
                "rel": "
      last
      edit",
      
                "
      href
      type": "application/vnd.abiquo.virtualmachine+json",
                "href": "https://
      abiquoapi
      nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/virtualappliances/
      virtualmachines?vmlabel=yVM_hd&startwith=0&limit=25&by=name&asc=true
      2990/virtualmachines/19477"
              }
      ], "collection": [
      ,


    2. harddisks link

      Code Block
              {
      
                
      "
      id
      title": 
      16493
      "disks",
                
      "
      uuid
      rel": "
      9fde7006-8420-4c82-96b8-cf61157eb66e
      harddisks",
                
      "
      description
      type": "
      A virtual machine
      application/vnd.abiquo.harddisks+json",
      
                "
      coresPerSocket
      href": 
      1,
      "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19477/storage/disks"
              },


    3. diskX links for all hard disks and volumes that are already attached to the VM. In this case, there is one HD in position 0 of the boot order and one volume in position 1. Add the new disk in the next position.

      Code Block
          
      "idState": 1,
          {
                "
      idType
      diskControllerType": 
      0
      "IDE",
      
                
      "
      type
      length": "
      MANAGED
      10",
                
      "
      highDisponibility
      title": 
      0
      "testvol1",
      
                "
      metadata
      rel": 
      {
      "disk1",
                "
      monitoring-metrics
      type": 
      [
      "application/vnd.abiquo.volume+json",
                "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/locations/1/volumes/18087"
              
      {
      },
              
      {
                "
      name
      diskControllerType": "
      CPU-Mz
      IDE",
                "diskLabel": "Hard disk 1",
            
      },
          "length": "64",
                "title": "2129870d-8f49-4486-90e9-c5f14f661d35",
         
      {
             "rel": "disk0",
                
      "name
      "type": "
      Memory-host"
      application/vnd.abiquo.harddisk+json",
                
      "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks/18086"
           
      },
         },


    4. datastoretierX for hard disks

      Code Block
              {
               
      {
       "title": "datastoretierESXI6.0_2.29",
                "rel": "datastoretier0",
                "
      name
      type": "
      CPU"
      application/vnd.abiquo.datastoretier+json",
                "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/58"
              },


    5. virtualdatacenter

      Code Block
              {
                "title": 
      {
      "vdc_api_tutorial",
                
      "rel": "virtualdatacenter",
                "
      name
      type": "
      Memory"
      application/vnd.abiquo.virtualdatacenter+json",
                "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486"
              },


  3. Use the VDC link from the VM to get the VDC, for example, using cURL. If the request is successful, the status code is 200. 

    Code Block
    curl --verbose -k -X GET "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486" \
        -H 'Accept: application/vnd.abiquo.virtualdatacenter+json;version=5.0' \
        -H 'Authorization: 
    {
    Token XXXX' | jq . 


    1. From the virtual datacenter save the link with a rel value of "disks"

      Code Block
          {
            
      "title": "disks",
            "
      name
      rel": "
      Memory-vmmemctl
      disks",
            "type": "application/vnd.abiquo.harddisks+json",
            "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks"
          }, 


  4. Create a data object for the hard disk, for example.

    Code Block
    {
       "links":[],
       "sizeInMb":20,
       "sequence":2,
       "allocation":"THIN",
       
    {
    "diskControllerType":"SCSI",
       
    "name
    "label":
    "
    Memory-swap2"
    test 
    }
    disk 04",
       
    { "name": "abq-ram_usage" }, { "name": "Disk-latency"
    "diskController":"lsilogic"
    }


  5. Create the hard disk in the VDC. Send a POST request to the virtual datacenter disks link with the disk data object.

    Code Block
    curl --verbose -k -X POST "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks" \
    	-H "Accept: application/vnd.abiquo.harddisk+json;version=5.0" \
    	-H "Content-Type: application/vnd.abiquo.harddisk+json;version=5.0" \
    	-H "Authorization: Token XXXX" \
    	-d '{
       "links":[ ],
       "sizeInMb":20,
       "sequence":2,
       "allocation":"THIN",
       "diskControllerType":"SCSI",
       "label":"testDisk02",
       "diskController":"lsilogic"
    }' | jq .


    1. If the request is successful, the status code will be 201. 

    2. Keep the edit link to use to assign the hard disk to the VM

      Code Block
          {
            
      }
      "diskAllocation": "THIN",
            "diskController": "lsilogic",
            "diskControllerType": "SCSI",
           
      {
       "diskLabel": "testDisk02",
            "rel": "edit",
            "type": "application/vnd.abiquo.harddisk+json",
            "
      name
      href": "
      Memory-swap
      https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks/18092"
          }


  6. Create disk link and to add to the VM entity

    1. Change the edit link to diskX with the next number in the disk sequence. In this case, for the third disk, we will use "disk2"

      Code Block
          {
            "diskAllocation": "THIN",
         
      },
         "diskController": "lsilogic",
            "diskControllerType": "SCSI",
            "diskLabel": "testDisk02",
      
      {
            "rel": "disk2",
            
      "type": "application/vnd.abiquo.harddisk+json",
            
      "
      name
      href": "
      abq-cpu_usage
      https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks/18092"
          
      }, { "name": "Uptime" }, { "name": "CPU-time" }, { "name": "Memory-physical" } ] }, "monitored": true, "protected": false, "variables": {}, "backuppolicies": [], "generateGuestInitialPassword": false, "natrules": [], "vdrpEnabled": true, "vdrpPort": 0, "password": "KnZSQW07", "name": "ABQ_9fde7006-8420-4c82-96b8-cf61157eb66e", "label": "yVM_hd", "ram": 64, "cpu": 1, "state": "NOT_ALLOCATED", "creationTimestamp": 1576236231000, "links": [ { "title": "4.7.0_Snapshot Enterprise testing", "rel": "enterprise", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/261" }, { "title": "ABQ_9fde7006-8420-4c82-96b8-cf61157eb66e", "rel": "edit", "type": "application/vnd.abiquo.virtualmachine+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493" }, { "title": "send mail", "rel": "sendmail", "type": "application/vnd.abiquo.mail+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/publiccloudregions/1/enterprises/261/virtualmachines/16493/action/sendmail" }, { "title": "cloudadmin cloudadmin", "rel": "user", "type": "application/vnd.abiquo.user+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/261/users/10" }, { "title": "vdc_ESXI_vCenter", "rel": "virtualdatacenter", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896" }, { "title": "vappESXI470", "rel": "virtualappliance", "type": "application/vnd.abiquo.virtualappliance+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377" }, { "title": "metadata", "rel": "metadata", "type": "application/vnd.abiquo.metadata+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/metadata" }, { "title": "vlan network configurations", "rel": "configurations", "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/network/configurations" }, { "title": "nics", "rel": "nics", "type": "application/vnd.abiquo.nics+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/network/nics" }, { "title": "disks", "rel": "harddisks", "type": "application/vnd.abiquo.harddisks+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/storage/disks" }, { "title": "NOT_ALLOCATED", "rel": "state", "type": "application/vnd.abiquo.virtualmachinestate+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/state" }, { "title": "virtual machine undeploy", "rel": "undeploy", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/undeploy" }, { "title": "virtual machine deploy", "rel": "deploy", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/deploy" }, { "title": "virtual machine reset", "rel": "reset", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/reset" }, { "title": "virtual machine snapshot", "rel": "instance", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/instance" }, { "title": "remote access", "rel": "rdpaccess", "type": "application/vnd.abiquo.virtualmachineconsole+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/config/rdpaccess" }, { "title": "tasks", "rel": "tasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/tasks" }, { "title": "firewalls", "rel": "firewalls", "type": "application/vnd.abiquo.links+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/firewalls" }, { "title": "load balancers", "rel": "loadbalancers", "type": "application/vnd.abiquo.loadbalancers+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/loadbalancers" }, { "title": "request on demand backup", "rel": "requestbackup", "type": "application/vnd.abiquo.ondemandbackup+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/backup/action/request" }, { "title": "request a restore of a backup", "rel": "requestrestore", "type": "application/vnd.abiquo.restore+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/backup/action/restore" }, { "title": "move VM to a virtual appliance", "rel": "vappmove", "type": "application/vnd.abiquo.links+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/vappmove" }, { "title": "move VM to another virtual datacenter", "rel": "move", "type": "application/vnd.abiquo.movevm+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/move" }, { "title": "volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/storage/volumes" }, { "title": "ABQ_HP_1_64_08c1daf8", "rel": "hardwareprofile", "type": "application/vnd.abiquo.hardwareprofile+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/hardwareprofiles/41457" }, { "diskControllerType": "SCSI", "length": "10", "title": "01volume470", "rel": "disk1", "type": "application/vnd.abiquo.volume+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/volumes/14993" }, { "diskControllerType": "IDE", "diskLabel": "Hard disk 1", "length": "64", "title": "91feae48-4134-484a-9487-473f577856e1", "rel": "disk0", "type": "application/vnd.abiquo.harddisk+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/disks/15000" }, { "title": "datastoretierESXI6.0_2.29", "rel": "datastoretier0", "type": "application/vnd.abiquo.datastoretier+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/58" }, { "title": "protect", "rel": "protect", "type": "text/plain", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/protect" }, { "title": "unprotect", "rel": "unprotect", "type": "text/plain", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/unprotect" }, { "title": "metricsmetadata", "rel": "metricsmetadata", "type": "application/vnd.abiquo.metricsmetadata+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/metrics" }, { "title": "disablemonitoring", "rel": "disablemonitoring", "type": "", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/disablemonitoring" }, { "title": "collectd", "rel": "collectd", "type": "application/json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/metrics/collectd" }, { "title": "alarmssearch", "rel": "alarmssearch", "type": "application/vnd.abiquo.alarms+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/alarms" }, { "title": "clone", "rel": "clone", "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/action/clone" }, { "title": "VMware vCenter", "rel": "hypervisortype", "type": "application/vnd.abiquo.hypervisortype+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04" }, { "title": "yVM_Abiquo_enterprise", "rel": "virtualmachinetemplate", "type": "application/vnd.abiquo.virtualmachinetemplate+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/261/datacenterrepositories/1/virtualmachinetemplates/2" }, { "title": "Others", "rel": "category", "type": "application/vnd.abiquo.category+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/config/categories/1" } ], "usageStatistics": [] } ], "duplicatedvms": [] }

       Keep the VM entity to update it. You will need the harddisks, datastore tiers, diskX, and virtualdatacenter links

      Expand

      harddisks

      Code Block
                      {
                          "title": "disks",
                          "rel": "harddisks",
                          "type": "application/vnd.abiquo.harddisks+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493/storage/disks"
                      },

      diskX links for all hard disks and volumes that are already attached to the VM. In this case, there is one HD in position 0 of the boot order and one volume in position 1. Add the new disk in the next position.

      Code Block
                      {
                          "diskControllerType": "IDE",
                          "diskLabel": "Hard disk 1",
                          "length": "64",
                          "title": "91feae48-4134-484a-9487-473f577856e1",
                          "rel": "disk0",
                          "type": "application/vnd.abiquo.harddisk+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/disks/15000"
                      },
                      {
                          "diskControllerType": "SCSI",
                          "length": "10",
                          "title": "01volume470",
                          "rel": "disk1",
                          "type": "application/vnd.abiquo.volume+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/volumes/14993"
                      },

      datastoretierX

      Code Block
                      {
                          "title": "datastoretierESXI6.0_2.29",
                          "rel": "datastoretier0",
                          "type": "application/vnd.abiquo.datastoretier+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/58"
                      },

      virtualdatacenter

      Code Block
                      {
                          "title": "vdc_ESXI_vCenter",
                          "rel": "virtualdatacenter",
                          "type": "application/vnd.abiquo.virtualdatacenter+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896"
                      },

    Use the VDC link from the VM to get the VDC

  7. Reference: https://wiki.abiquo.com/api/latest/VirtualDatacentersResource.html#get-a-virtual-datacenter

  8. cURL

    Code Block
    curl -X GET "https://abiquoapi.bcn.abiquo.com/api/cloud/virtualdatacenters/1896" \
        -H 'Accept: application/vnd.abiquo.virtualdatacenter+json;version=4.7' \
        -u user:password --verbose

    Sample response. Success status code: 200

    Expand
    Code Block
    {
        "id": 1896,
        "hypervisorType": "VMX_04",
        "name": "vdc_ESXI_vCenter",
        "network": {
            "id": 2496,
            "name": "default_private_network",
            "address": "192.168.0.0",
            "mask": 24,
            "gateway": "192.168.0.1",
            "primaryDNS": "10.60.1.4",
            "secondaryDNS": "8.8.8.8",
            "sufixDNS": "",
            "tag": 9,
            "defaultNetwork": false,
            "type": "INTERNAL",
            "dhcpOptions": {
                "links": [],
                "collection": []
            },
            "ipv6": false,
            "strict": false,
            "restricted": false,
            "internetGatewayRole": false,
            "ipRanges": [],
            "excludedFromFirewall": false,
            "notUsableLoadBalancers": false,
            "notUsableVirtualMachines": false,
            "links": [
                {
                    "title": "vdc_ESXI_vCenter",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896"
                },
                {
                    "title": "default_private_network",
                    "rel": "edit",
                    "type": "application/vnd.abiquo.vlan+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks/2496"
                },
                {
                    "title": "ips",
                    "rel": "ips",
                    "type": "application/vnd.abiquo.privateips+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks/2496/ips"
                },
                {
                    "title": "Service Network dvSwitch",
                    "rel": "networkservicetype",
                    "type": "application/vnd.abiquo.networkservicetype+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/networkservicetypes/1"
                },
                {
                    "title": "load balancers",
                    "rel": "loadbalancers",
                    "type": "application/vnd.abiquo.loadbalancers+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks/2496/loadbalancers"
                },
                {
                    "title": "configuration",
                    "rel": "configuration",
                    "type": "application/vnd.abiquo.networkconfiguration+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks/2496/configuration"
                },
                {
                    "title": "192.168.0.0/24",
                    "rel": "network_configuration",
                    "type": "application/vnd.abiquo.networkconfiguration+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks/2496/configuration/2496"
                },
                {
                    "title": "reserve a set of ips",
                    "rel": "reserveips",
                    "type": "application/vnd.abiquo.ipliterals+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks/2496/ips/action/reserve"
                },
                {
                    "title": "release a set of ips",
                    "rel": "releaseips",
                    "type": "application/vnd.abiquo.ipliterals+json",
                    "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks/2496/ips/action/release"
                }
            ]
        },
        "syncState": "NONE",
        "usersRole": [],
        "diskSoftLimitInMb": 0,
        "diskHardLimitInMb": 0,
        "storageSoftInMb": 0,
        "storageHardInMb": 0,
        "vmsSoft": 0,
        "vmsHard": 0,
        "vlansSoft": 0,
        "vlansHard": 0,
        "publicIpsSoft": 0,
        "publicIpsHard": 0,
        "links": [
            {
                "title": "vdc_ESXI_vCenter",
                "rel": "edit",
                "type": "application/vnd.abiquo.virtualdatacenter+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896"
            },
            {
                "title": "private networks",
                "rel": "privatenetworks",
                "type": "application/vnd.abiquo.vlans+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks"
            },
            {
                "title": "public networks",
                "rel": "network",
                "type": "application/vnd.abiquo.vlans+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/network"
            },
            {
                "rel": "asynctasks",
                "type": "application/vnd.abiquo.asynctasks+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/asynctasks"
            },
            {
                "title": "default_private_network",
                "rel": "defaultvlan",
                "type": "application/vnd.abiquo.vlan+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/privatenetworks/2496"
            },
            {
                "title": "4.7.0_Snapshot Enterprise testing",
                "rel": "enterprise",
                "type": "application/vnd.abiquo.enterprise+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/261"
            },
            {
                "title": "virtual appliances",
                "rel": "virtualappliances",
                "type": "application/vnd.abiquo.virtualappliances+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances"
            },
            {
                "title": "private ips",
                "rel": "privateips",
                "type": "application/vnd.abiquo.privateips+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/action/privateips"
            },
            {
                "title": "external ips",
                "rel": "externalips",
                "type": "application/vnd.abiquo.externalips+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/action/externalips"
            },
            {
                "title": "unmanaged ips",
                "rel": "unmanagedips",
                "type": "application/vnd.abiquo.unmanagedips+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/action/unmanagedips"
            },
            {
                "title": "default vlan",
                "rel": "defaultvlan",
                "type": "application/vnd.abiquo.vlan+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/action/defaultvlan"
            },
            {
                "title": "disks",
                "rel": "disks",
                "type": "application/vnd.abiquo.harddisks+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/disks"
            },
            {
                "title": "ips to purchase",
                "rel": "topurchase",
                "type": "application/vnd.abiquo.publicips+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/publicips/topurchase"
            },
            {
                "title": "ips purchased",
                "rel": "purchased",
                "type": "application/vnd.abiquo.publicips+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/publicips/purchased"
            },
            {
                "title": "volumes",
                "rel": "volumes",
                "type": "application/vnd.abiquo.volumes+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/volumes"
            },
            {
                "title": "tiers",
                "rel": "tiers",
                "type": "application/vnd.abiquo.tiers+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/tiers"
            },
            {
                "title": "stateful volumes",
                "rel": "statefulcandidates",
                "type": "application/vnd.abiquo.volumes+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/volumes/action/statefulcandidates"
            },
            {
                "title": "available templates",
                "rel": "templates",
                "type": "application/vnd.abiquo.virtualmachinetemplates+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/action/templates"
            },
            {
                "title": "all virtual machines",
                "rel": "virtualmachines",
                "type": "application/vnd.abiquo.virtualmachines+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/action/virtualmachines"
            },
            {
                "title": "datastoretierESXI6.0_2.29",
                "rel": "defaultdatastoretier",
                "type": "application/vnd.abiquo.datastoretier+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/58"
            },
            {
                "title": "Abiquo-DC",
                "rel": "location",
                "type": "application/vnd.abiquo.datacenter+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1"
            },
            {
                "title": "tasks",
                "rel": "tasks",
                "type": "application/vnd.abiquo.tasks+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/tasks"
            },
            {
                "title": "location limit",
                "rel": "limit",
                "type": "application/vnd.abiquo.limit+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/261/limits/991"
            },
            {
                "title": "externalnetworks",
                "rel": "externalnetworks",
                "type": "application/vnd.abiquo.vlans+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/261/limits/991/externalnetworks"
            },
            {
                "title": "virtual appliances specs",
                "rel": "vappspecs",
                "type": "application/vnd.abiquo.virtualappliancespecs+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/vappspecs"
            },
            {
                "title": "Euro - €",
                "rel": "currency",
                "type": "application/vnd.abiquo.currency+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/config/currencies/2"
            },
            {
                "title": "alarmssearch",
                "rel": "alarmssearch",
                "type": "application/vnd.abiquo.alarms+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/alarms"
            }
        ],
        "ramSoft": 0,
        "ramHard": 0,
        "cpuSoft": 0,
        "cpuHard": 0
    }

    From the virtual datacenter save the link with a rel value of "disks"

    Code Block
            {
                "title": "disks",
                "rel": "disks",
                "type": "application/vnd.abiquo.harddisks+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/disks"
            },

    Create a data object for the hard disk

  9. Reference: https://wiki.abiquo.com/api/latest/harddisk.html
  10. Sample hard disk entity

    Code Block
    {
       "links":[],
       "sizeInMb":20,
       "sequence":2,
       "allocation":"THIN",
       "diskControllerType":"SCSI",
       "label":"test disk 04",
       "diskController":"lsilogic"
    }
    Optionally specify a datastore tier with a link

    Create the hard disk in the VDC

    Send a POST request to the virtual datacenter disks link with the disk data object.

    Code Block
    curl --verbose -X POST "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/disks" \
    	-H "Accept: application/vnd.abiquo.harddisk+json;version=4.7" \
    	-H "Content-Type: application/vnd.abiquo.harddisk+json;version=4.7" \
    	-u user:password -k \
    	-d '{
       "links":[ ],
       "sizeInMb":20,
       "sequence":2,
       "allocation":"THIN",
       "diskControllerType":"SCSI",
       "label":"test disk 04",
       "diskController":"lsilogic"
    }' | jq .

    Sample response. Success status code: 201

    Expand
    Code Block
    {
        "id": 15010,
        "label": "test disk 04",
        "sequence": 0,
        "sizeInMb": 20,
        "diskFormatType": "RAW",
        "diskFileSize": 0,
        "diskControllerType": "SCSI",
        "diskController": "lsilogic",
        "bootable": false,
        "uuid": "8b2ea7af-1a71-48fe-aa51-79102a8873e2",
        "allocation": "THIN",
        "links": [
            {
                "title": "vdc_ESXI_vCenter",
                "rel": "virtualdatacenter",
                "type": "application/vnd.abiquo.virtualdatacenter+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896"
            },
            {
                "diskAllocation": "THIN",
                "diskController": "lsilogic",
                "diskControllerType": "SCSI",
                "diskLabel": "test disk 04",
                "rel": "edit",
                "type": "application/vnd.abiquo.harddisk+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/disks/15010"
            }
        ]
    }

    Keep the edit link to use to assign the hard disk to the VM

    Code Block
            {
                "diskAllocation": "THIN",
                "diskController": "lsilogic",
                "diskControllerType": "SCSI",
                "diskLabel": "test disk 04",
                "rel": "edit",
                "type": "application/vnd.abiquo.harddisk+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/disks/15010"
            }

    Create disk link and to add to the VM entity

    Change the edit link to diskX with the next number in the disk sequence. In this case, for the third disk, we will use "disk2"

    Code Block
            {
                "diskAllocation": "THIN",
                "diskController": "lsilogic",
                "diskControllerType": "SCSI",
                "diskLabel": "test disk 04",
                "rel": "disk2",
                "type": "application/vnd.abiquo.harddisk+json",
                "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/disks/15010"
            }

    Power off the VM if it is deployed without hot reconfigure

  11. Send a PUT request to the VM state link. 
  12. To power off, set the state attribute to "OFF". To shut down the VM, add the "gracefulShutdown" attribute and set it to "true". Note that the graceful shutdown may require VM tools.
  13. cURL

    Code Block
    curl --verbose -X PUT "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/3/virtualappliances/4/virtualmachines/182/state" \
    	-H "Content-Type: application/vnd.abiquo.virtualmachinestate+json;version=4.2" \
    	-d '{"state": "OFF", "gracefulShutdown": true}' \
    	-u user:password -k 
    If the request returns a status code of 202, that means it was accepted. However, you should always check that the VM is really powered off.

    Get the VM again using the VM edit link. 

    Code Block
    curl -X GET "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493" \
    	-H "Accept: application/vnd.abiquo.virtualmachine+json;version=4.7" \
    	-u user:password | jq .

    This step is included in the walkthrough to ensure that your VM object is up to date!

    Update the VM with a VM entity containing the new disk link

    1. Reference: https://wiki.abiquo.com/api/latest/VirtualMachinesResource.html#update-a-virtual-machine
    2. cURL

      Code Block
      curl --verbose -X PUT -u user:password \
      'https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/1896/virtualappliances/2377/virtualmachines/16493'
      -H 'Accept:application/vnd.abiquo.acceptedrequest+json;version=4.7' \
      -H 'Content-type:application/vnd.abiquo.virtualmachine+json;version=4.7' \
      -d @virtualMachineHD.json | jsonindent -f -nbe

      Request data for this request will be in the local file named "virtualMachineHD.json".

      { "id": 16493, "uuid": "9fde7006-8420-4c82-96b8-cf61157eb66e", "description": "A virtual machine", "coresPerSocket": 1, "idState": 1, "idType": 0, "type": "MANAGED", "highDisponibility": 0, "metadata": { "monitoring-metrics": [ { "name": "CPU-Mz" }, { "name": "Memory-host" }, { "name": "CPU" }, { "name": "Memory" }, { "name": "Memory-vmmemctl" }, { "name": "Memory-swap2" }, { "name": "abq-ram_usage" }, { "name": "Disk-latency"
      }
      Expand
      Code Block


  14. Power off the VM if it is deployed without hot reconfigure

    1. Send a PUT request to the VM state link from the VM object. To power off, set the state attribute to "OFF". To shut down the VM, add the "gracefulShutdown" attribute and set it to "true". Note that the graceful shutdown may require VM tools.

      Code Block
      curl --verbose -X PUT "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19477/state" \
      	-H "Content-Type: application/vnd.abiquo.virtualmachinestate+json;version=5.0" \
      	-d '{"state": "OFF", "gracefulShutdown": true}' \
      	-H "Authorization: Token XXXX" -k


    2. If the request returns a status code of 202, that means it was accepted. However, you should always check that the VM is really powered off (you can check in the VM data object from the next GET request)
  15. Get the VM again using the VM edit link. 

    Code Block
    curl -X GET "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19477" \
    	-H "Accept: application/vnd.abiquo.virtualmachine+json;version=5.0" \
    	-u user:password | jq .

    This step is included in the walkthrough to ensure that your VM object is up to date and that the VM is in the OFF state!

  16. Update the VM with a VM entity containing the new disk link

    1. For example, using cURL, and with the VM object in a file named "virtualMachineHD.json".

      Code Block
      curl --verbose -X PUT \
      'https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19477' \
      -H 'Accept:application/vnd.abiquo.acceptedrequest+json;version=5.0' \
      -H 'Content-type:application/vnd.abiquo.virtualmachine+json;version=5.0' \
      -H 'Authorization: Token XXXX' \
      -d @virtualMachineHD.json | jq .


    2. Reference: https://wiki.abiquo.com/api/latest/VirtualMachinesResource.html#update-a-virtual-machine

    3. A successful request will return a 204 no content link if the VM is not deployed. And if the VM is deployed, it will return a 202 - accepted request with a link to follow the progress of the operation.

When you check your VM, it should contain the new hard disk. See #Check that the hard disk is attached

Sample hard disk data object

This is an example of a harddisk data object after you create a hard disk in the 

Expand


Code Block
{
  "id": 18092,
  "label": "testDisk02",
  "sequence": 0,
  "sizeInMb": 20,
  "diskFormatType": "RAW",
  "diskFileSize": 0,
  "diskControllerType": "SCSI",
  "diskController": "lsilogic",
  "bootable": false,
  "uuid": "adc530d6-b05a-4d0e-b223-bc5b3d1d7463",
  "allocation": "THIN",
  "links": [
    {
      "title": "vdc_api_tutorial",
      "rel": "virtualdatacenter",
      "type": "application/vnd.abiquo.virtualdatacenter+json",
      "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486"
    },
    

...

{
      

...

"diskAllocation": "THIN",
      "

...

diskController":

...

 "lsilogic",
      "diskControllerType": "SCSI",
 

...

     "diskLabel": "testDisk02",
      

...

"rel": "edit",
      

...

"type": "application/vnd.abiquo.harddisk+json",
      "

...

href": "

...

https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks/18092"
    }
  ]
} 



Sample VM data object to update the VM

This is an example of a VM data object that includes the new hard disk link and it is the kind of data object that you need to send to add a hard disk.

Expand


Code Block
 {
  

...

"id": 19477,
  "uuid": "f5067776-9b43-4105-bb5a-4478ecf9b96c",
  "fqdn": "box.localdomain",
  "description": "A 

...

virtual machine",
  "coresPerSocket": 1,
  "idState": 6,
  

...

"idType": 0,
  "

...

type": "

...

MANAGED",
  "highDisponibility": 0,
  "monitored": false,
  

...

"monitoringLevel": "DEFAULT",
  "protected": false,
  

...

"variables": {},
  

...

"backuppolicies": [],
  

...

"lastSynchronize": 

...

1596468882000,
  "generateGuestInitialPassword": false,
  "natrules": [],
  

...

"internalProviderId": "vm-59342-at-10.60.11.242",
  "vdrpEnabled": true,
  "vdrpPort": 443,
  "vdrpIP": 

...

"10.60.2.29",
  "password": "U0mzxmhp",
  "deallocated": false,
  

...

"name": "ABQ_f5067776-9b43-4105-bb5a-4478ecf9b96c",
  

...

"

...

label": "

...

yVM_addDisk",
  "ram": 48,
  "cpu": 1,
  "state": "OFF",

...

  "creationTimestamp": 1596463039000,
  "links": [
 

...

   {
 

...

     "

...

title": 

...

"VCENTER_CLUSTER",
      "

...

rel": 

...

"machine",
      "

...

type": 

...

"application/vnd.abiquo.machine+json",
      "

...

href": 

...

"https://nardo40.bcn.abiquo.com:443/api/admin/datacenters/1/racks/25/machines/440"
    

...

},
    {

...

 

...

     "

...

title": 

...

"Abiquo-DC",
    

...

 

...

 

...

"

...

rel": "

...

location",
      "

...

type": "

...

application/vnd.abiquo.datacenter+json",
      "

...

href": "

...

https://nardo40.bcn.abiquo.com:443/api/cloud/locations/1"
    },
    

...

{
      "

...

title": "5.1.0_Snapshot Enterprise testing",
      "

...

rel": "

...

enterprise",
      "

...

type": 

...

"application/vnd.abiquo.enterprise+json",
      "

...

href": 

...

"https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/336"
    },
    {

...


      

...

"title": "

...

ABQ_f5067776-9b43-4105-bb5a-4478ecf9b96c",
      

...

"rel": "

...

edit",

...


      

...

"type": "application/vnd.abiquo.

...

virtualmachine+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api

...

/cloud/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19477"
    

...

},

...


    {

...


      

...

"

...

rel": "

...

asynctasks",

...


      

...

"type": "application/vnd.abiquo.

...

asynctasks+json",

...


      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/asynctasks"
    

...

},
    

...

{

...


      "title": "send mail"

...

,
      

...

"rel": "sendmail",
      

...

"type": "application/vnd.abiquo.mail+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/admin/

...

datacenters/1/

...

racks/25/machines/440/virtualmachines/

...

19477/action/sendmail"

...


    },

...


    

...

{
      

...

"title": "cloudadmin cloudadmin",
      

...

"rel": "user",

...


      

...

"type": "application/vnd.abiquo.user+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/admin/enterprises/

...

336/users/10"

...


    

...

},
    

...

{
      

...

"title": "vdc_

...

api_

...

tutorial",

...


      

...

"rel": "virtualdatacenter",
      

...

"type": "application/vnd.abiquo.virtualdatacenter+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486"
    

...

},

...


    

...

{

...


      "title": "

...

vap_api_tutorial",

...


      "rel": "virtualappliance",

...


      "type": "application/vnd.abiquo.virtualappliance+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990"

...


    },

...


    

...

{
      

...

"title": "metadata",

...


      "rel": "metadata",

...


      

...

"type": "application/vnd.abiquo.metadata+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/metadata"
    

...

},

...


    

...

{

...


      "title": "vlan network configurations",
      

...

"rel": "configurations",
      

...

"type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",

...


      "href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/network/configurations"
    

...

},

...


    {
      

...

"title": "

...

192.168.0.0/24",

...


      

...

"rel": "

...

network_configuration",

...


      "type": "application/vnd.abiquo.

...

virtualmachinenetworkconfiguration+json",

...


      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/network/configurations/

...

3490"
    

...

},
    

...

{
      

...

"title": "

...

nics",

...


      

...

"rel": "

...

nics",
      

...

"type": "application/vnd.abiquo.

...

nics+json",

...


      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/

...

network/

...

nics"
    

...

},
    

...

{
      

...

"title": "

...

disks",
      

...

"rel": "

...

harddisks",
      

...

"type": "application/vnd.abiquo.

...

harddisks+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/19477/

...

storage/disks"
    },

...

    {
      

...

"title": "

...

OFF",

...


      

...

"rel": "

...

state",
      

...

"type": "application/vnd.abiquo.

...

virtualmachinestate+json",

...


      "href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/

...

state"
    },

...


    

...

{
      

...

"title": "virtual machine 

...

undeploy",

...


      

...

"rel": "

...

undeploy",
      

...

"type": "application/vnd.abiquo.acceptedrequest+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/action/

...

undeploy"
    

...

},

...


    {
      

...

"title": "virtual machine 

...

deploy",

...


      

...

"rel": "

...

deploy",

...


      

...

"type": "application/vnd.abiquo.acceptedrequest+json",

...


      "href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/action/

...

deploy"
    

...

},
    

...

{

...


      "title": "virtual machine 

...

reset",
      

...

"rel": "

...

reset",

...


      "type": "application/vnd.abiquo.acceptedrequest+json",

...


      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/action/

...

reset"

...


    

...

},
    

...

{

...


      

...

"title": "

...

virtual machine 

...

snapshot",
      

...

"rel": "

...

instance",

...


      "type": "application/vnd.abiquo.

...

acceptedrequest+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/

...

action/

...

instance"
    

...

},

...


    

...

{

...


      "title": "

...

remote access",

...


      "rel": "

...

rdpaccess",
      

...

"type": "application/vnd.abiquo.

...

virtualmachineconsole+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/19477/

...

config/

...

rdpaccess"

...


    

...

},

...


    {

...


      

...

"title": "

...

tasks",
      

...

"rel": "

...

tasks",

...


      

...

"type": "application/vnd.abiquo.

...

tasks+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/

...

tasks"
    

...

},

...


    

...

{

...


      "title": "

...

firewalls",
      

...

"rel": "

...

firewalls",

...


      

...

"type": "application/vnd.abiquo.

...

links+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/firewalls"
    },
 

...

   {
      

...

"title": "

...

load balancers",

...


      

...

"rel": "

...

loadbalancers",

...


      

...

"type": "application/vnd.abiquo.

...

loadbalancers+json",

...


      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/loadbalancers"
    

...

},
    

...

{
      

...

"title": "request 

...

on 

...

demand 

...

backup",

...


      

...

"rel": "

...

requestbackup",

...


      

...

"type": "application/vnd.abiquo.

...

ondemandbackup+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/backup/action/

...

request"
    

...

},
    

...

{

...


    

...

 

...

 

...

"title"

...

: "request a restore of a backup",
      "rel": "

...

requestrestore",

...


      

...

"type": "application/vnd.abiquo.

...

restore+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/backup/action/

...

restore"
    

...

},

...


    {

...


      

...

"title": "move VM to 

...

a virtual 

...

appliance",

...


      "rel": "

...

vappmove",
      

...

"type": "application/vnd.abiquo.

...

links+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/action/

...

vappmove"
    

...

},

...


    {
      

...

"title": "

...

move VM to another virtual datacenter",
      

...

"rel": "

...

move",

...


      "type": "application/vnd.abiquo.

...

movevm+json

...

",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/

...

action/

...

move"

...


    

...

},
    

...

{

...


      

...

"title": "

...

volumes",

...


      

...

"rel": "

...

volumes",

...


      

...

"type": "application/vnd.abiquo.

...

volumes+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud

...

/virtualdatacenters/2486/virtualappliances/2990/virtualmachines/19477/storage/volumes"
    },

...


    

...

{
      

...

"diskControllerType": "

...

IDE",

...


      

...

"length": "10",
      

...

"title": "

...

testvol1",
      

...

"rel": "disk1",

...


      

...

"type": "application/vnd.abiquo.volume+json",

...


      "href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/locations/1/volumes/

...

18087"
    

...

},
    {
   

...

   

...

"diskAllocation": "THIN",
      "diskControllerType": "IDE",

...


      

...

"diskLabel": "Hard disk 1",
      "length": "64",
      "

...

title": "

...

2129870d-8f49-4486-90e9-c5f14f661d35",
      "rel": "disk0",
      "

...

type": "

...

application/vnd.abiquo.harddisk+json",
      "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks/18086"
    

...

},
    {
      "title": "

...

datastoretierESXI6.0_2.29",
      "rel": "datastoretier0",
      "type": "application/vnd.abiquo.

...

datastoretier+json",

...


      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/

...

locations/

...

1/

...

datastoretiers/

...

58"
    

...

},
    

...

{

...


      

...

"title": "

...

192.168.0

...

.2

...

",

...


      "rel": "

...

nic0",
      

...

"type": "application/vnd.abiquo.

...

privateip+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/

...

virtualdatacenters/2486/privatenetworks/3490/ips/18020"
    },

...


    

...

{
      

...

"title": "protect",
      

...

"rel": "protect",

...


      

...

"type": "text/plain",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/action/

...

protect"
    },
 

...

   

...

{
      

...

"title": "unprotect",
      

...

"rel": "unprotect",

...


      

...

"type": "text/plain",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/action/unprotect"
    

...

},
    

...

{
      

...

"title": "metricsmetadata",

...


      

...

"rel": "metricsmetadata",
      

...

"type": "application/vnd.abiquo.metricsmetadata+json",

...


      "href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/metrics"

...


    

...

},

...


    {

...


      

...

"title": "

...

enablemonitoring",

...


      

...

"rel": "

...

enablemonitoring",

...


      

...

"type": "",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/

...

enablemonitoring"

...


    },

...


    {
      

...

"title": "collectd",
      

...

"rel": "collectd",
      

...

"type": "application/json",

...


      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/metrics/collectd"

...


    },

...


    

...

{
      

...

"title": "alarmssearch",
      

...

"rel": "alarmssearch",

...


      

...

"type": "application/vnd.abiquo.alarms+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/alarms"
    

...

},
    

...

{
      

...

"title": "clone",

...


      

...

"rel": "clone",
      

...

"type": "application/vnd.abiquo.virtualmachinecloneoptions+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/

...

2486/virtualappliances/

...

2990/virtualmachines/

...

19477/action/clone"

...


    

...

},

...


    {

...


      

...

"title": "VMware vCenter Cluster",

...


      "rel": "hypervisortype",

...


      "type": "application/vnd.abiquo.hypervisortype+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/config/hypervisortypes/

...

VCENTER_

...

CLUSTER"

...


    },

...


    

...

{
      

...

"title": "yVM_Abiquo_enterprise",

...


      "rel": "virtualmachinetemplate",

...


      

...

"type": "application/vnd.abiquo.virtualmachinetemplate+json",
      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/admin/enterprises/

...

336/datacenterrepositories/1/virtualmachinetemplates/2"

...


    

...

},
    

...

{

...


      

...

"title": "Others",

...


      

...

"rel": "category",
      

...

"type": "application/vnd.abiquo.category+json",

...


      

...

"href": "https://

...

nardo40.bcn.abiquo.com:443/api/config/categories/1"
    },
    

...

{
      "diskAllocation": "THIN",
      "diskController": "lsilogic",

...

      "diskControllerType": "SCSI",
      "

...

diskLabel": "

...

testDisk02",
      "rel": "disk2",
      "

...

type": "

...

application/vnd.abiquo.harddisk+json",

...


      "

...

href": "

...

https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks/18092"
    }
  

...

],
  "

...

usageStatistics": 

...

[]
}



Check that the hard disk is attached

To check that the hard disk is attached, get the VM object again and check that the disk link is correct. The disk should also have a datastore tier.

Expand
titleClick here to show/hide the sample links..


Code Block
        

...

{
            "

...

diskAllocation": "

...

THIN",
            "

...

diskController": "

...

lsilogic",
       

...

     

...

"diskControllerType": 

...

Check that the hard disk is attached.

To check that the hard disk is attached, get the VM object again and check that the disk link is correct.

Expand
Code Block
"SCSI",
             {"diskLabel": "testDisk02",
            "diskAllocationlength": "THIN20",
            "diskControllertitle": "lsilogicadc530d6-b05a-4d0e-b223-bc5b3d1d7463",
            "diskControllerTyperel": "SCSIdisk2",
            "diskLabeltype": "test disk 04application/vnd.abiquo.harddisk+json",
            "lengthhref": "20"https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2486/disks/18092"
        },
        {
            "title": "8b2ea7af-1a71-48fe-aa51-79102a8873e2datastoretierESXI6.0_2.29",
            "rel": "disk2datastoretier2",
            "type": "application/vnd.abiquo.harddiskdatastoretier+json",
            "href": "https://abiquoapinardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenterslocations/18961/disksdatastoretiers/1501058"
        },



Remove an auxiliary hard disk from a VM

To remove the hard disk from the VM, destroying the hard disk and the data on it, remove the link to the hard disk and update the VM.