Versions Compared

Key

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

...

Numberedheadings
number-formatcustom
h1[h1.decimal]
h2[h2.decimal]
h3[h3.decimal].
h4[h3.decimal].[h4.decimal]
start-numbering-ath3

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 
  • The platform should have a license added, on the License tab in 
  • You should have basic general knowledge of the Abiquo platform, see the  section
  • You should have worked with the Abiquo user interface, for example, by working through the 
  • You should have API credentials and a chosen authentication method, see 
    • This tutorial uses the Cloud Administrator default account and does not show proper authentication

Create the Infrastructure

The cloud administrator creates the cloud infrastructure for the enterprise administrators and users.

Create a Datacenter

When In this step you create a datacenter in the UI, you can optionally check the remote services at creation time, before they are added to the datacenter. Creating a datacenter in the API is slightly different to creating one in the UI.

As in the UI, if you've previously created and deleted a datacenter, some remote services may remain in the platform. Instead of creating these remote services again, you should add them to the new location. Note that you may wish to retrieve the remote services to determine which ones are already added or check these remote services before you create the new datacenter.

To create a will create a new datacenter in a fresh install, send sending a list of links to remote services. Effectively these links consist of the remote service type and the URL

You will need the URL of the server where the remote services are running. For this tutorial, if If you are using a monolithic (single server) install of Abiquo, you may just need to enter your own server URL in the request and in the data object. If you have any doubts, check with your system administratorworking with a monolithic test system, then this will probably be the URL of your monolithic server.

Note that if you have previously created a datacenter, and you have already created some remote services, you can either delete them or add them to a new datacenter.

cURL:


Success status code: 201

Example request payload:

Example response payload:

In the response payload, you will see a link to the datacenter itself, which has the "rel" or "relation" set of links, which you can use to obtain more information about the datacenter elements.

One of the links identifies the datacenter in the platform. This link has a key "rel" (meaning "relation") and a value of "edit". You can use the links to obtain more information about the datacenter elements. And you If you need to pass a link to the datacenter to another request, then you should change the value of the "rel" link to "datacenter".

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

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 give it a change the value of the "rel" of link from "edit" to "datacenter".


Click here to show/hide the example



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 BCDC datacenter created above and a rack entity file. The rack entity is documented on the page, but you can should also read the page in the User Manual, which provides information about creating a rack in the UI and more details more information about Abiquo racks. The In particular, you should pay attention to the network parameters are to , 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.

cURL:


Success status code: 201

Request payload:

Response payload:

Click here to show/hide the response



 

Add a Cloud Node

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

Retrieve the Machine Detailsmachine list from a master hypervisor

Here we use a GET request to the "discover" link of the datacenter, but we need to supply the IP address of the manager host, and its credentials as parameters. Note that if you are using ESXi with vCenter server(s), your administrator should enter a single set of credentials in Abiquo properties as described in the Abiquo Infrastructure Guide. Abiquo has support for master hypervisors, so this query retrieves all the machines (hypervisors) at a given IP address, and the response entity is a list of machines. However, in most cases, the list will only have a single machine

This example shows a master hypervisor (vCenter, XenServer or OracleVM), so the first step is to retrieve the list of hosts managed by the master hypervisor.

cURL:


Success status code: 200

Request payload:

-- none --

Response payload:

Click here to show/hide the response




Retrieve a machine from a hypervisor address

Here we also use a GET request to the "discover" link of the datacenter, but we need to supply the IP address of the hypervisor host, and its credentials as parameters.

This example shows a host managed by a master hypervisor.


cURL:


Success status code: 200

Request payload:

-- none --

Response payload:

Click here to show/hide the response



 

 

Modify the Machine Details

To create a machine in Abiquo, you will need to modify the response object from the previous discovery request.

Generally, you will need to obtain a single machine object, enable datastores and add a network service type.

Retrieve Network Service Type

A network service type is a tag for your networks to associate them with hypervisor NICs. By default, as you would notice when adding a host in the UI, there is a Service Network type.

  But if you have created network service types in Abiquo, retrieve the network service types for your datacenter. Here you can use a GET request to the link with a "rel" value of "networkservicetypes" for your datacenter.

Typically, the default Service Network type is created for each datacenter, and if you haven't created any extra network service types in your environment, the ID number of the network service type will be the same as the datacenter, so in the above example, the ID would be "4" and the link "api/admin/datacenters/4/networkservicetypes/4". However, it is always worth checking with a GET request to the datacenter "networkservicetypes" link. You will need the link with the "rel" value of "edit" to create the network service type link for the host NIC.

Modify the Machines DTO

Here we will walk through some basic changes to the response object from the previous machine discovery step

  1. Remove the colleciton list information to create only a single machine. To do this, remove the following lines from the top and bottom of the Machines list returned previously.


  2. To enable datastores, change "enabled" to true (without any quotation marks) for all datastores you wish to enable. For example:


  3. Add a link with a rel of "networkservicetype" to the links section of at least one of the virtual switches that is attached to the service network, for example:


  4. Add the "managerUser" and "managerPassword" attributes.

The final machine entity is shown in the following step where it is used to create the physical machine.

Create the Physical Machine

To add a physical machine, use the machine object you retrieved earlier and modified in the previous step. Perform a post request to the link with a "rel" value of "machines" from the rack object you created earlier. This will add the physical machine to the platform and its state should be "managed". If you need to check its state, you could perform a get request to the "checkstate" link.

In the user interface, the cloud node will be added to the rack and displayed in the tree view of the Infrastructure tab. Creating the host was the main purpose of this tutorial, but if you're interested in retrieving any existing virtual machines, see the section below.

cURL:


Success status code: 201

Request payload:

Use the modified machine entity from the above step.


Response payload:

Click here to show/hide the response example



Retrieve guests running on the host

In the user interface, you can check a box to Retrieve existing virtual machines when you create a physical machine. This means that the platform will take the guests you retrieve into consideration (for example, for scheduling and statistics), even though they are not managed by Abiquo unless you explicitly capture them. Here's how to retrieve the virtual machines in the API. First, you need to add the host, as described above. Then perform a get GET request to the link with a "rel" value of "virtualmachines" and supply the parameter "sync=true".

To remove unmanaged machines, just retrieve the guests again, but without the sync parameter. Now Abiquo will only display the guests that it manages.

...