Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

This tutorial describes how to create an Abiquo datacenter and incorporate a hypervisor, which are tasks of the cloud administrator.

Before you begin working with the API tutorials, you should complete the following prerequisites:

  • The platform should be installed in a test environment, see Installation

  • The platform should have a license added, on the License tab in Configuration view#Licenses

  • You should have basic general knowledge of the Abiquo platform, see the Get started section

  • You should have worked with the Abiquo user interface, for example, by working through the Abiquo quick tutorial

  • You should have API credentials and a chosen authentication method, see Authentication

    • This tutorial uses the Cloud Administrator default account and does not show proper authentication

This tutorial corresponds to the UI information on the Compute in datacenters page.

...

You will need the racks link in the next step, which is to create a rack.

Tip
title

Allow tenants to work with the datacenter

 If you will be working with an enterprise other than the one of the user that created the datacenter, you will need to create a datacenter limit for your tenant that will allow the tenant to use the datacenter. This is the same as editing the enterprise in the UI and adding the datacenter to the enterprise's list of allowed datacenters. To do this, you will need the link to the datacenter, but you will need to change the value of the "rel" link from "edit" to "datacenter".

Expand
titleClick here to show/hide the example
Code Block
{
   "id":3,
   "name":"BCDC",
   "location":"Barcelona",
   "remoteServices":{
      "links":[

      ],
      "collection":[
         {
            "id":10,
            "type":"VIRTUAL_FACTORY",
            "uri":"http://example.com:8009/virtualfactory",
            "uuid":"Abiquo",
            "status":1,
            "links":[
               {
                  "title":"VIRTUALFACTORY",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/10"
               },
               {
                  "title":"check",
                  "rel":"check",
                  "type":"",
                  "href":"https://example.com:443/api/admin/remoteservices/10/action/check"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         },
         {
            "id":11,
            "type":"VIRTUAL_SYSTEM_MONITOR",
            "uri":"http://example.com:8009/vsm",
            "uuid":"Abiquo",
            "status":1,
            "links":[
               {
                  "title":"VIRTUALSYSTEMMONITOR",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/11"
               },
               {
                  "title":"check",
                  "rel":"check",
                  "type":"",
                  "href":"https://example.com:443/api/admin/remoteservices/11/action/check"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         },
         {
            "id":12,
            "type":"APPLIANCE_MANAGER",
            "uri":"http://example.com:8009/am",
            "uuid":"Abiquo",
            "status":1,
            "links":[
               {
                  "title":"APPLIANCEMANAGER",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/12"
               },
               {
                  "title":"check",
                  "rel":"check",
                  "type":"",
                  "href":"https://example.com:443/api/admin/remoteservices/12/action/check"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         },
         {
            "id":13,
            "type":"NARS",
            "uri":"http://example.com:8009/nars",
            "uuid":"Abiquo",
            "status":1,
            "links":[
               {
                  "title":"NARS",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/13"
               },
               {
                  "title":"check",
                  "rel":"check",
                  "type":"",
                  "href":"https://example.com:443/api/admin/remoteservices/13/action/check"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         },
         {
            "id":14,
            "type":"STORAGE_SYSTEM_MONITOR",
            "uri":"http://example.com:8009/ssm",
            "uuid":"Abiquo",
            "status":1,
            "links":[
               {
                  "title":"STORAGESYSTEMMONITOR",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/14"
               },
               {
                  "title":"check",
                  "rel":"check",
                  "type":"",
                  "href":"https://example.com:443/api/admin/remoteservices/14/action/check"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         },
         {
            "id":15,
            "type":"BPM_SERVICE",
            "uri":"http://example.com:8009/bpm-async",
            "uuid":"Abiquo",
            "status":1,
            "links":[
               {
                  "title":"BPMSERVICE",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/15"
               },
               {
                  "title":"check",
                  "rel":"check",
                  "type":"",
                  "href":"https://example.com:443/api/admin/remoteservices/15/action/check"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         },
         {
            "id":16,
            "type":"DHCP_SERVICE",
            "uri":"omapi://example.com:7911/",
            "status":1,
            "links":[
               {
                  "title":"DHCPSERVICE",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/16"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         },
         {
            "id":17,
            "type":"DHCPv6",
            "uri":"omapi://example.com:7911/",
            "status":1,
            "links":[
               {
                  "title":"DHCPv6",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/17"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         },
         {
            "id":18,
            "type":"REMOTE_ACCESS",
            "uri":"guacd://example.com:4822/",
            "status":1,
            "links":[
               {
                  "title":"REMOTEACCESS",
                  "rel":"edit",
                  "type":"application/vnd.abiquo.remoteservice+json",
                  "href":"https://example.com:443/api/admin/remoteservices/18"
               },
               {
                  "title":"BCDC",
                  "rel":"datacenter",
                  "type":"application/vnd.abiquo.datacenter+json",
                  "href":"https://example.com:443/api/admin/datacenters/3"
               }
            ]
         }
      ]
   },
   "links":[
      {
         "title":"BCDC",
         "rel":"edit",
         "type":"application/vnd.abiquo.datacenter+json",
         "href":"https://example.com:443/api/admin/datacenters/3"
      },
      {
         "title":"racks",
         "rel":"racks",
         "type":"application/vnd.abiquo.racks+json",
         "href":"https://example.com:443/api/admin/datacenters/3/racks"
      },
      {
         "title":"remote services",
         "rel":"remoteservices",
         "type":"application/vnd.abiquo.remoteservices+json",
         "href":"https://example.com:443/api/admin/datacenters/3/remoteservices"
      },
      {
         "title":"update resources",
         "rel":"updateusedresources",
         "type":"",
         "href":"https://example.com:443/api/admin/datacenters/3/action/updateusedresources"
      },
      {
         "title":"datastores",
         "rel":"datastores",
         "type":"application/vnd.abiquo.datastores+json",
         "href":"https://example.com:443/api/admin/datacenters/3/datastores"
      },
      {
         "title":"hypervisors",
         "rel":"hypervisors",
         "type":"application/vnd.abiquo.hypervisortypes+json",
         "href":"https://example.com:443/api/admin/datacenters/3/hypervisors"
      },
      {
         "title":"enterprises",
         "rel":"enterprises",
         "type":"application/vnd.abiquo.enterprises+json",
         "href":"https://example.com:443/api/admin/datacenters/3/action/enterprises"
      },
      {
         "title":"discover",
         "rel":"discover",
         "type":"application/vnd.abiquo.machines+json",
         "href":"https://example.com:443/api/admin/datacenters/3/action/discover"
      },
      {
         "title":"machines state",
         "rel":"checkmachinestate",
         "type":"application/vnd.abiquo.machinestate+json",
         "href":"https://example.com:443/api/admin/datacenters/3/action/checkmachinestate"
      },
      {
         "title":"machines ipmi",
         "rel":"checkmachineipmistate",
         "type":"application/vnd.abiquo.machineipmistate+json",
         "href":"https://example.com:443/api/admin/datacenters/3/action/checkmachineipmistate"
      },
      {
         "title":"tiers",
         "rel":"tiers",
         "type":"application/vnd.abiquo.tiers+json",
         "href":"https://example.com:443/api/admin/datacenters/3/storage/tiers"
      },
      {
         "title":"storage devices",
         "rel":"devices",
         "type":"application/vnd.abiquo.storagedevices+json",
         "href":"https://example.com:443/api/admin/datacenters/3/storage/devices"
      },
      {
         "title":"devices",
         "rel":"devices",
         "type":"application/vnd.abiquo.devices+json",
         "href":"https://example.com:443/api/admin/datacenters/3/devices"
      },
      {
         "title":"network service types",
         "rel":"networkservicetypes",
         "type":"application/vnd.abiquo.networkservicetypes+json",
         "href":"https://example.com:443/api/admin/datacenters/3/networkservicetypes"
      },
      {
         "title":"public networks",
         "rel":"network",
         "type":"application/vnd.abiquo.vlans+json",
         "href":"https://example.com:443/api/admin/datacenters/3/network"
      },
      {
         "title":"external ips",
         "rel":"externalips",
         "type":"application/vnd.abiquo.externalips+json",
         "href":"https://example.com:443/api/admin/datacenters/3/network/action/externalips"
      },
      {
         "title":"limits",
         "rel":"getLimits",
         "type":"application/vnd.abiquo.limits+json",
         "href":"https://example.com:443/api/admin/datacenters/3/action/getlimits"
      },
      {
         "title":"datastore tiers",
         "rel":"datastoretiers",
         "type":"application/vnd.abiquo.datastoretiers+json",
         "href":"https://example.com:443/api/admin/datacenters/3/datastoretiers"
      },
      {
         "title":"backup policies",
         "rel":"backuppolicies",
         "type":"application/vnd.abiquo.backuppolicies+json",
         "href":"https://example.com:443/api/admin/datacenters/3/backuppolicies"
      },
      {
         "title":"backup datacenter properties",
         "rel":"backupproperties",
         "type":"application/vnd.abiquo.backupdatacenterproperties+json",
         "href":"https://example.com:443/api/admin/datacenters/3/backupproperties"
      },
      {
         "title":"datacenter hardware profiles",
         "rel":"hardwareprofiles",
         "type":"application/vnd.abiquo.hardwareprofiles+json",
         "href":"https://example.com:443/api/admin/datacenters/3/hardwareprofiles"
      },
      {
         "title":"excluded networks",
         "rel":"excludednetworks",
         "type":"application/vnd.abiquo.excludednetworks+json",
         "href":"https://example.com:443/api/admin/datacenters/3/excludednetworks"
      },
      {
         "title":"Default Tier",
         "rel":"defaultdatastoretier",
         "type":"application/vnd.abiquo.datastoretier+json",
         "href":"https://example.com:443/api/admin/datacenters/3/datastoretiers/2"
      },
      {
         "title":"metricsmetadata",
         "rel":"metricsmetadata",
         "type":"application/vnd.abiquo.metricsmetadata+json",
         "href":"https://example.com:443/api/admin/datacenters/3/metrics"
      },
      {
         "title":"collectd",
         "rel":"collectd",
         "type":"application/json",
         "href":"https://example.com:443/api/admin/datacenters/3/metrics/collectd"
      },
      {
         "title":"alarmssearch",
         "rel":"alarmssearch",
         "type":"application/vnd.abiquo.alarms+json",
         "href":"https://example.com:443/api/admin/datacenters/3/alarms"
      },
      {
         "title":"natnetworks",
         "rel":"natnetworks",
         "type":"application/vnd.abiquo.natnetworks+json",
         "href":"https://example.com:443/api/admin/datacenters/3/natnetworks"
      },
      {
         "title":"Get nat ips",
         "rel":"natips",
         "type":"application/vnd.abiquo.natips+json",
         "href":"https://example.com:443/api/admin/datacenters/3/natnetworks/action/allips"
      },
      {
         "title":"Get nat rules",
         "rel":"natrules",
         "type":"application/vnd.abiquo.natrules+json",
         "href":"https://example.com:443/api/admin/datacenters/3/natnetworks/action/allrules"
      }
   ]
}

Add a rack

In Abiquo, hypervisors and container servers are organized in racks, in order to share the same network infrastructure and for high availability, for example.

To create a rack, you will need to make a POST request to the datacenter's racks link, which you can find in the response to the create datacenter request or from a GET to the datacenter link. In this example, we will use the racks link from the datacenter created above and a rack entity file. The rack entity is documented on the Abiquo data media types pageAPI Reference page, but you should also read the Compute in datacenters page in the User Manual, which provides more information about Abiquo racks. In particular, you should pay attention to the network parameters, which establish the VLAN tags that are available for Abiquo to use in the switch for Abiquo private networks. Even if you are using an SDN system, you will still need to define the tag range for Abiquo.

...

Expand
titleClick here to show/hide the response
Code Block
{
   "id":2,
   "haEnabled":false,
   "name":"bcdc_rack_01",
   "nrsq":10,
   "shortDescription":"KVM rack",
   "vlanIdMax":4094,
   "vlanIdMin":2,
   "vlanPerVdcReserved":1,
   "vlansIdAvoided":"1-20",
   "links":[
      {
         "title":"BCDC",
         "rel":"datacenter",
         "type":"application/vnd.abiquo.datacenter+json",
         "href":"https://example.com:443/api/admin/datacenters/3"
      },
      {
         "title":"machines",
         "rel":"machines",
         "type":"application/vnd.abiquo.machines+json",
         "href":"https://example.com:443/api/admin/datacenters/3/racks/2/machines"
      },
      {
         "title":"bcdc_rack_01",
         "rel":"edit",
         "type":"application/vnd.abiquo.rack+json",
         "href":"https://example.com:443/api/admin/datacenters/3/racks/2"
      },
      {
         "title":"collectd",
         "rel":"collectd",
         "type":"application/json",
         "href":"https://example.com:443/api/admin/datacenters/3/racks/2/metrics/collectd"
      },
      {
         "title":"metricsmetadata",
         "rel":"metricsmetadata",
         "type":"application/vnd.abiquo.metricsmetadata+json",
         "href":"https://example.com:443/api/admin/datacenters/3/racks/2/metrics"
      },
      {
         "title":"clusters",
         "rel":"clusters",
         "type":"application/vnd.abiquo.clusters+json",
         "href":"https://example.com:443/api/admin/datacenters/3/racks/2/clusters"
      },
      {
         "title":"alarmssearch",
         "rel":"alarmssearch",
         "type":"application/vnd.abiquo.alarms+json",
         "href":"https://example.com:443/api/admin/datacenters/3/racks/2/alarms"
      }
   ]
} 

...

Add a cloud node

A cloud node is the physical machine and hypervisor host or container server, for example.

...

Expand
titleClick here to show/hide the response
Code Block
{
   "links":[

   ],
   "collection":[
      {
         "name":"bc2blade7.bcn.abiquo.com",
         "description":"bc2blade7.bcn.abiquo.com",
         "state":"MANAGED",
         "type":"VMX_04",
         "ip":"10.60.2.27",
         "hostname":"bc2blade7.bcn.abiquo.com",
         "ipService":"10.60.2.27",
         "ram":8191,
         "ramUsed":0,
         "cpu":8,
         "cpuUsed":0,
         "initiatorIQN":"iqn.1998-01.com.vmware:bc2blade7-0e8d430e",
         "datastores":{
            "links":[

            ],
            "collection":[
               {
                  "name":"ds-bc2blade7",
                  "rootPath":"/vmfs/volumes/5c738e99-54b3843a-49e1-0015c5ff2370",
                  "directory":"",
                  "size":137975824384,
                  "usedSize":3940548608,
                  "enabled":false,
                  "datastoreUUID":"5cae7c27-37e7-40f1-ab92-9018f360e4b8",
                  "links":[

                  ]
               },
               {
                  "name":"ABQ_44d65019-ae99-48ed-b8a6-73d7eb21f14c",
                  "rootPath":"/vmfs/volumes/ea339ed5-23f4eaec",
                  "directory":"",
                  "size":5939188432896,
                  "usedSize":5019909509120,
                  "enabled":false,
                  "datastoreUUID":"50dd038e-939b-4bec-a8c2-d32cffe92fdd",
                  "links":[

                  ]
               }
            ]
         },
         "networkInterfaces":{
            "links":[

            ],
            "collection":[
               {
                  "name":"vSwitch0",
                  "mac":"00:15:c5:ff:23:6e",
                  "links":[

                  ]
               },
               {
                  "name":"Functionals DVS",
                  "mac":"00:15:c5:ff:23:70",
                  "links":[

                  ]
               }
            ]
         },
         "managerIp":"10.60.11.242",
         "links":[

         ]
      }
   ]
} 

 

Retrieve a KVM machine

And if you're doing a test, maybe you're just using a KVM, in which case you should use the following cURL, modifying the appropriate parameters.

Code Block
GET https://example.com/api/admin/datacenters/3/action/discover?hypervisor=KVM&ip=mjskvm.bcn.abiquo.com
	-H 'Accept:application/vnd.abiquo.machines+json;version=4.6' \ 
	-d @requestpayload.json \ 
	-u user:password --verbose

...

Modify the machine details

...