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
- To allow access via API, create an enterprise limit, see Create Tenants via API
- 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:
- Manage Enterprises#Allowatenanttoaccessdatacentersandcloudproviders
- Add credentials for public cloud
- Manage Virtual Datacenters
- Manage Virtual Appliances
- Manage Virtual Machines
Summary diagram
Detailed steps
- Get allowed locations for the current enterprise
- Specify datacenters or publiccloudregions using the media type
- References:
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
Sample response. Success status code: 200
Note: This request returns a collection of allowed locationsExpand 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" } ] } ] }
You will need the edit and hypervisortype links of the location.
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" },
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" }
- enterprise
- Create the virtualdatacenter entity
- Reference:
Numberedheadings | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Create a Virtual DatacenterGet the LocationYou 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 DatacenterModify 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 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 ApplianceNow you can Create a Virtual ApplianceIt'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 VMYou 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 VMWe 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!
|
...