Versions Compared

Key

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

Quick Tutorial

Div
classversions
Version 3.8 20160923
Div
classcopyrighted

Copyright Notice
Copyright ©2016, Abiquo Holdings S.L. All rights are reserved. This documentation may not be reproduced in whole or in part in any manner or form (including photocopying or storing it in any medium by electronic means and whether or not transiently or incidentally to some other use of this documentation) other than in accordance with any applicable license agreement or with the prior written consent of Abiquo Holdings S.L. Any copies of this documentation must incorporate this notice.
Abiquo and the Abiquo logo are trademarks of Abiquo, Inc. Other trademarks used may be owned by third parties.

...

classtocpgno

Table of Contents

Introduction
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 enterprise and some users, as well as how to download some templates from a remote template repository. In this tutorial you will perform the tasks of the cloud administrator and enterprise administrator.Please see for further general introductory information.

Prerequisites

This tutorial assumes that the Abiquo platform and the cloud node hypervisor have been set up. For detailed information, see the installation instructions in the .It also assumes that the Abiquo platform is licensed and that a datacenter and hypervisor have been added to the Abiquo platform. You can do this with the UI or the API. For instructions on using the API, see .

Authorization

This tutorial is designed to be performed in a test environment. We will use the Cloud Administrator default account with the following data:

  • Username: admin
  • Password: xabiquo

Add a License in the UI

Click on the UNLICENSED link in the top right corner of the screen. This should open the License tab in . Click on the add button, then cut and paste the key from the license file into the box. Click Save.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 an Enterprise and Users

When using the Abiquo API to create a tenant (Abiquo enterprise), it is important to first create the enterprise and then allow the enterprise to use datacenters or public cloud regions by creating an enterprise-datacenter limit.

Create the enterprise

The following request creates an enterprise with enterprise resource allocation limits.

cURL:

Success status code: 201

Request payload:

Response payload:



Create an enterprise-datacenter limit for the new enterprise

An enterprise-datacenter limit allows an enterprise to use a datacenter or public cloud region. You can also use it to limit the allocation of resources in the datacenter. In this case, because all the limit values are set to 0, the enterprise's resource usage is not limited at this level. However, it is already limited at the enterprise level, and can also be limited at the virtual datacenters level.

cURL:

Success status code: 201

Request payload:

Response payload:



You can now get the main cloud admin (whose user ID is 1) from whichever enterprise they are in by using a query over all enterprises represented by the underscore character "_".

And you can switch enterprise to the new tenant by editing the user entity, adding a link to the correct enterprise and performing a put request to the user in any enterprise.

So for example, to switch to the new enterprise.


 

Create Users

The request to create a user is always the same but the user entity will vary depending on the user's role. To create a user you will need to know the ID of the role that you will assign to the user.

Create an Enterprise Admin

The enterprise admin user will administer the tenant. This user is allowed to create users within the tenant. The ID of the ENTERPRISE_ADMIN role is 3. The username is given as the "nick" element. Modify and submit the following request to create an enterprise admin user.

cURL:

Success status code: 201

Request payload:

Response payload:


 

Create a Cloud User

Modify and submit the following request to create a cloud user with the USER role.

cURL:

Success status code: 201

Request payload:

Response payload:


Switch enterprises

Add Virtual Machine Templates to the Appliance Library

The Appliance Library stores virtual machine templates so that users can easily deploy virtual machines from these templates. Templates can be downloaded from a remote repository or uploaded from a local machine. The appliance library templates are available to the virtual datacenters. From there an enterprise administrator or user can add the virtual machine template to a virtual appliance for deployment in the cloud.

Refresh the Apps library

An Apps library belongs to your enterprise and there is one for each of the datacenters you are allowed to access.

Get the Enterprise ID

To refresh the Apps library using the API, you need to know the enterprise ID and the datacenter repository ID.

If you are working with the default Abiquo enterprise, the ID is "1". Otherwise you can retrieve the enterprise ID using

Get the Enterprise Repositories

Using the enterprise ID, retrieve all the repositories for your enterprise.

cURL:

Success status code: 200

Request payload:

-- none --

Response payload:



 

Perform the Refresh

To refresh the enterprise datacenter repository, perform a put request to the refresh link in the datacenter repository entity shown above.

cURL:

Success status: 202

Request payload:

-- none --

Response payload:

The acceptedrequest media type is a reference to the action in progress. You can use this link to track the progress of the asynchronous refresh task.

Remember that the refresh is an asynchronous task, so you should wait until it has completed to go on to the next step.

Retrieve a compatible template

If you have already downloaded some templates to the Apps library, you can just retrieve a template that is compatible with your hypervisor type by performing a query similar to the following one. If there are a lot of templates, you may wish to filter them using query parameters or select a specific template ID to retrieve. In this example, we filter by compatible hypervisorTypeName (VMX_04) and text in the template name (Core) and limit the number of templates returned to 1.

Remember that in Abiquo, you create a virtual machine using only a link to a template, you do not need the full template entity.

The result of this query is a collection of templates, so if you needed a fully template entity for just one template, you could remove the collection information or perform another request to retrieve just the desired template.  

cURL:

Response payload:


 

Add a new template from a remote repository

If there are no templates in your Apps library and you would like to add some using the API, follow the steps in this section. The most convenient template to download is the m0n0wall template in the default remote repository. However, the following query uses the a remote repository available in the local Abiquo installation.

Registering a remote repository is outside the scope of this tutorial. To register a custom remote repository, either please see the TemplateDefinitionList documentation () or register it in Abiquo using the UI.

Template definition lists are available at the enterprise level, so to retrieve them, you just need your enterprise ID.

Retrieve all template definitions and select one

If you wish to retrieve all the template definitions found in the remote repositories registered in your Abiquo environment and available to your enterprise, you can use the following query. Obviously this query may return a large number of results, so one strategy may be to search the result for the ID of the template you wish to use.

Note that the following link contains an uppercase letter "D" in definitions.

cURL:

Success status code: 200

Request payload:

-- none --

Response payload:

This is only one template definition taken from the list of hundreds of template definitions returned by this query. I searched for the template name and cut and paste the required template.




 

Create a template from a template definition

You can create a template in the Apps library from a link to the template definition retrieved above. This is equivalent to downloading a template from the remote repository to the Apps library. To create the virtual machine template request entity, you will need the information in the "edit" link section of the template definition above. You can then use this template in a later step to create a virtual machine. The template ID is given in the task link

cURL:

Success status code: 202

Request payload:

Response payload:


 

See also for information on how to upload templates from the local filesystem using the Appliance Manager API.

...