Versions Compared

Key

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

Table of Contents

Introduction

This page describes how to create a virtual datacenter and deploy a VM.

This tutorial is suitable for a test environment only and it does not use proper authentication.

You will need the following resources.

  • An enterprise with one or more allowed datacenters or public cloud regions
  • Credentials for public cloud regions

Your user role must include the following privileges.

  • VDC_MANAGE
  • VDC_MANAGE_VAPP
  • VAPP_DEPLOY_UNDEPLOY

The following pages contain background information for this tutorial:

Summary diagram


Detailed steps

  1. Get allowed locations for the current enterprise
    1. Specify datacenters or publiccloudregions using the media type
    2. References: 
      1. https://wiki.abiquo.com/api/latest/AllowedLocationsResource.html#list-location-of-allowed-datacenters
      2. https://wiki.abiquo.com/api/latest/AllowedLocationsResource.html#list-location-of-allowed-public-cloud-regions
    3. cURL

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


    4. Sample response. Success status code: 200
      Note: This request returns a collection of allowed locations

      Expand


      Code Block
      {
          "totalSize": 1,
          "links": [
              {
                  "rel": "first",
                  "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations?limit=25&by=name&asc=true"
              },
              {
                  "rel": "last",
                  "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations?startwith=0&limit=25&by=name&asc=true"
              }
          ],
          "collection": [
              {
                  "id": 1,
                  "name": "Abiquo-DC",
                  "location": "Teide",
                  "links": [
                      {
                          "title": "Abiquo-DC",
                          "rel": "edit",
                          "type": "application/vnd.abiquo.datacenter+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1"
                      },
                      {
                          "title": "racks",
                          "rel": "racks",
                          "type": "application/vnd.abiquo.racks+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/racks"
                      },
                      {
                          "title": "remote services",
                          "rel": "remoteservices",
                          "type": "application/vnd.abiquo.remoteservices+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/remoteservices"
                      },
                      {
                          "title": "update resources",
                          "rel": "updateusedresources",
                          "type": "",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/action/updateusedresources"
                      },
                      {
                          "title": "datastores",
                          "rel": "datastores",
                          "type": "application/vnd.abiquo.datastores+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/datastores"
                      },
                      {
                          "title": "hypervisors",
                          "rel": "hypervisors",
                          "type": "application/vnd.abiquo.hypervisortypes+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/hypervisors"
                      },
                      {
                          "title": "enterprises",
                          "rel": "enterprises",
                          "type": "application/vnd.abiquo.enterprises+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/action/enterprises"
                      },
                      {
                          "title": "discover",
                          "rel": "discover",
                          "type": "application/vnd.abiquo.machines+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/action/discover"
                      },
                      {
                          "title": "machines state",
                          "rel": "checkmachinestate",
                          "type": "application/vnd.abiquo.machinestate+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/action/checkmachinestate"
                      },
                      {
                          "title": "machines ipmi",
                          "rel": "checkmachineipmistate",
                          "type": "application/vnd.abiquo.machineipmistate+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/action/checkmachineipmistate"
                      },
                      {
                          "title": "tiers",
                          "rel": "tiers",
                          "type": "application/vnd.abiquo.tiers+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/storage/tiers"
                      },
                      {
                          "title": "storage devices",
                          "rel": "devices",
                          "type": "application/vnd.abiquo.storagedevices+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/storage/devices"
                      },
                      {
                          "title": "devices",
                          "rel": "devices",
                          "type": "application/vnd.abiquo.devices+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/devices"
                      },
                      {
                          "title": "network service types",
                          "rel": "networkservicetypes",
                          "type": "application/vnd.abiquo.networkservicetypes+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/networkservicetypes"
                      },
                      {
                          "title": "public networks",
                          "rel": "network",
                          "type": "application/vnd.abiquo.vlans+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/network"
                      },
                      {
                          "title": "external ips",
                          "rel": "externalips",
                          "type": "application/vnd.abiquo.externalips+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/network/action/externalips"
                      },
                      {
                          "title": "limits",
                          "rel": "getLimits",
                          "type": "application/vnd.abiquo.limits+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/action/getlimits"
                      },
                      {
                          "title": "excluded networks",
                          "rel": "excludednetworks",
                          "type": "application/vnd.abiquo.excludednetworks+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/excludednetworks"
                      },
                      {
                          "title": "REMOTEACCESS",
                          "rel": "remoteservice",
                          "type": "application/vnd.abiquo.remoteservice+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/61"
                      },
                      {
                          "title": "BPMSERVICE",
                          "rel": "remoteservice",
                          "type": "application/vnd.abiquo.remoteservice+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/6"
                      },
                      {
                          "title": "VIRTUALFACTORY",
                          "rel": "remoteservice",
                          "type": "application/vnd.abiquo.remoteservice+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/1"
                      },
                      {
                          "title": "APPLIANCEMANAGER",
                          "rel": "remoteservice",
                          "type": "application/vnd.abiquo.remoteservice+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/3"
                      },
                      {
                          "title": "VIRTUALSYSTEMMONITOR",
                          "rel": "remoteservice",
                          "type": "application/vnd.abiquo.remoteservice+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/2"
                      },
                      {
                          "title": "NARS",
                          "rel": "remoteservice",
                          "type": "application/vnd.abiquo.remoteservice+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/4"
                      },
                      {
                          "title": "metricsmetadata",
                          "rel": "metricsmetadata",
                          "type": "application/vnd.abiquo.metricsmetadata+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/metrics"
                      },
                      {
                          "title": "collectd",
                          "rel": "collectd",
                          "type": "application/json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/metrics/collectd"
                      },
                      {
                          "title": "alarmssearch",
                          "rel": "alarmssearch",
                          "type": "application/vnd.abiquo.alarms+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/alarms"
                      },
                      {
                          "title": "natnetworks",
                          "rel": "natnetworks",
                          "type": "application/vnd.abiquo.natnetworks+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/natnetworks"
                      },
                      {
                          "title": "Get nat ips",
                          "rel": "natips",
                          "type": "application/vnd.abiquo.natips+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/natnetworks/action/allips"
                      },
                      {
                          "title": "Get nat rules",
                          "rel": "natrules",
                          "type": "application/vnd.abiquo.natrules+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1/natnetworks/action/allrules"
                      },
                      {
                          "title": "repository",
                          "rel": "datacenterrepository",
                          "type": "application/vnd.abiquo.datacenterrepository+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/281/datacenterrepositories/1"
                      },
                      {
                          "title": "floating ips",
                          "rel": "ips",
                          "type": "application/vnd.abiquo.publicips+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/ips"
                      },
                      {
                          "title": "devices",
                          "rel": "devices",
                          "type": "application/vnd.abiquo.devices+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/devices"
                      },
                      {
                          "title": "available templates",
                          "rel": "templates",
                          "type": "application/vnd.abiquo.virtualmachinetemplates+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/templates"
                      },
                      {
                          "title": "remote vdcs",
                          "rel": "remotevirtualdatacenters",
                          "type": "application/vnd.abiquo.virtualdatacenters+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/action/remotevirtualdatacenters"
                      },
                      {
                          "title": "remote vms",
                          "rel": "remotevirtualmachines",
                          "type": "application/vnd.abiquo.virtualmachines+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/action/remotevirtualmachines"
                      },
                      {
                          "title": "available volumes",
                          "rel": "volumes",
                          "type": "application/vnd.abiquo.volumes+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/volumes"
                      },
                      {
                          "title": "available tiers",
                          "rel": "tiers",
                          "type": "application/vnd.abiquo.tiers+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/tiers"
                      },
                      {
                          "title": "Abiquo-DC",
                          "rel": "location",
                          "type": "application/vnd.abiquo.datacenter+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1"
                      },
                      {
                          "title": "backup policies",
                          "rel": "backuppolicies",
                          "type": "application/vnd.abiquo.backuppolicies+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/backuppolicies"
                      },
                      {
                          "title": "backup location properties",
                          "rel": "backupproperties",
                          "type": "application/vnd.abiquo.backupdatacenterproperties+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/backupproperties"
                      },
                      {
                          "title": "compatible datastore tiers",
                          "rel": "compatibles",
                          "type": "application/vnd.abiquo.links+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/action/compatibles"
                      },
                      {
                          "title": "datastore tiers",
                          "rel": "datastoretiers",
                          "type": "application/vnd.abiquo.datastoretiers+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers"
                      },
                      {
                          "title": "metricsmetadata",
                          "rel": "metricsmetadata",
                          "type": "application/vnd.abiquo.metricsmetadata+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/metrics"
                      },
                      {
                          "title": "collectd",
                          "rel": "collectd",
                          "type": "application/json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/metrics/collectd"
                      },
                      {
                          "title": "VMware vCenter",
                          "rel": "hypervisortype",
                          "type": "application/vnd.abiquo.hypervisortype+json",
                          "href": "https://abiquoapi.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04"
                      }
                  ]
              }
          ]
      }



    5. You will need the edit and hypervisortype links of the location.

      1. edit link

        Code Block
                        {
                            "title": "Abiquo-DC",
                            "rel": "edit",
                            "type": "application/vnd.abiquo.datacenter+json",
                            "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/datacenters/1"
                        },


      2. hypervisortype link

        Code Block
                        {
                            "title": "VMware vCenter",
                            "rel": "hypervisortype",
                            "type": "application/vnd.abiquo.hypervisortype+json",
                            "href": "https://abiquoapi.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04"
                        }


      3. enterprise
  2. Create the virtualdatacenter entity
    1. Reference: 


This tutorial describes how to create a cloud and deploy a VM. In this tutorial you will perform the tasks of the cloud administrator, enterprise administrator and enterprise user. This tutorial uses the Cloud Administrator default account and does not show proper authentication.

To perform this tutorial to create a virtual datacenter, you will need a datacenter or public cloud region, and an enterprise with permission to use it. To allow an enterprise to use a datacenter or public cloud region, edit the enterprise and add it to allowed locations or create an enterprise limit in the API. If you are working with public cloud, you should also add credentials for your enterprise.
Numberedheadings
number-formatcustom
h1[h1.decimal]
h2[h2.decimal]
h3[h3.decimal].
h4[h3.decimal].[h4.decimal]
start-numbering-ath3



Create a Virtual Datacenter

: Administrators create virtual datacenters to organize the infrastructure for providing the cloud service. From here they can create virtual appliances in the virtual datacenter and the Abiquo platform will deploy them to the physical infrastructure based on the .

Get the Location

You will create the virtual datacenter in an "allowed location", which is a datacenter or public cloud region that the enterprise is allowed to work with. Choose whether you want to retrieve public cloud regions or datacenters and use the appropriate media type.

By default, Abiquo will add the ID of the enterprise you are working with as a query parameter. If you are the cloud administrator or another user with appropriate privileges, you can retrieve the locations of another enterprise by entering another ID.

cURL:

Success status code: 200

Request payload:

--none--

Response payload:


The important parts of this location entity are the ID and the self link (shown here). Use this location link when you edit the virtual datacenter entity to create the virtual datacenter.

 

Create the Virtual Datacenter

Modify the virtual datacenter entity shown here to add the location ID to the locations link, the enterprise ID and the hypervisor type (for example, ESXi with vCenter is "VMX_04")

cURL:

Success status code: 201

Request payload:

Response payload:


 

For more information about changing the default network configuration, see the VLAN customization section in the page.

In the UI, by default, Abiquo will create a default virtual appliance, named with the default prefix "vapp_" and the virtual datacenter name, but when you are working with the API, no default virtual appliance is created.

Create and Deploy a Virtual Appliance

Now you can . A virtual appliance contains one or more VMs that you can use together to provide a service, such as a web stack or a classroom environment.

Create a Virtual Appliance

It's easy to create a virtual appliance. You can create one just by providing a virtual appliance with a name and some basic details, and the link to the virtual datacenter where you will create it.

cURL:

Success status code: 201

Request payload:

Response payload:



 

Use a VM template to create a VM

You will need the link to a virtual appliance, a template in the Apps library, and an enterprise. See the previous Tenants tutorial for how to retrieve compatible templates from the Apps library.

cURL:

Success status code: 201

Request payload:

The link to specify the template is the only required value. In this case, we are also setting the friendly name of the VM and enabling remote access.

 

Response payload:




Deploy the VM

We are going to deploy the virtual machine on its own. It is also possible to deploy a whole virtual appliance at the same time.

cURL:

Success status code: 202

Request payload:

--none--

Response payload:

 

The VM will be powered on. Congratulations, you've completed the tutorial!

 

...