Table of Contents |
---|
Introduction
This page describes how to create a virtual datacenter and deploy a VM.
...
- Get the link to the enterprise
- Get smaller result entity with the enterprises-id-name media type
- Specify the enterprise name with the "has" parameter to filter by name text
- Reference
cURL
Code Block curl -X GET https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises?has=video \ -H 'Accept:application/vnd.abiquo.enterprises-id-name+json; version=4.7' \ -u user:password --verbose
Sample response. Success response code: 200
Note: this request returns a collection of enterprisesExpand Code Block { "totalSize": 1, "links": [ { "rel": "first", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises?limit=25&has=video" }, { "rel": "last", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises?startwith=0&limit=25&has=video" } ], "collection": [ { "id": 15, "name": "Video_enterprise", "vmsSoft": 0, "vmsHard": 0, "vlansSoft": 0, "vlansHard": 0, "publicIpsSoft": 0, "publicIpsHard": 0, "links": [ { "title": "Video_enterprise", "rel": "edit", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/15" } ], "ramSoft": 0, "ramHard": 0, "cpuSoft": 0, "cpuHard": 0 } ] }
You will need the edit link of the enterprise
Code Block { "title": "Video_enterprise", "rel": "edit", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/15" }
- Get allowed locations for the current enterprise
- Specify datacenters or publiccloudregions using the media type in the Accept header
- Cloud admin can use the "enterprise" parameter to get locations for another enterprise by ID
- References:
cURL
Code Block curl -X GET https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations?has=Abiquo \ -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&has=Abiquo&by=name&asc=true" }, { "rel": "last", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations?startwith=0&limit=25&has=Abiquo&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": "REMOTEACCESSNARS", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/614" }, { "title": "BPMSERVICEREMOTEACCESS", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/661" }, { "title": "VIRTUALFACTORYVIRTUALSYSTEMMONITOR", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/12" }, { "title": "APPLIANCEMANAGERBPMSERVICE", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/36" }, { "title": "VIRTUALSYSTEMMONITORAPPLIANCEMANAGER", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/23" }, { "title": "NARSVIRTUALFACTORY", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/remoteservices/41" }, { "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/28115/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 for the hypervisor you would like to use in the virtual datacenter
Code Block . The code of the hypervisor type is at the end of the link, for example, for VMware vCenter, the name is "VMX_04".
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" }
- Create the a virtualdatacenter entity
- Reference:
...
number-format | custom |
---|---|
h1 | [h1.decimal] |
h2 | [h2.decimal] |
h3 | [h3.decimal]. |
h4 | [h3.decimal].[h4.decimal] |
start-numbering-at | h3 |
Create a Virtual Datacenter
...
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:
...
- https://wiki.abiquo.com/api/latest/virtualdatacenter.html
- Add the links to the enterprise and the location and the hypervisorType attribute.
- Create a virtualdatacenter
- Reference: https://wiki.abiquo.com/api/latest/VirtualDatacentersResource.html#create-a-virtual-datacenter
cURL
Code Block curl -X POST https://abiquoapi.bcn.abiquo.com/api/cloud/virtualdatacenters \ -H 'Accept:application/vnd.abiquo.asynctask+json; version=4.7' \ -H 'Content-Type:application/vnd.abiquo.virtualdatacenter+json; version=4.7' \ -d @virtualdatacentercreate.json \ -u user:password --verbose
Virtual datacenter entity
Expand Code Block { "hypervisorType" : "VMX_04", "name" : "vdc_test_create", "network" : { "name" : "Default Network", "address" : "192.168.0.0", "mask" : 24, "gateway" : "192.168.0.1", "primaryDNS" : "10.0.0.1", "secondaryDNS" : "10.0.0.1", "defaultNetwork" : false, "type" : "INTERNAL", "ipv6" : false, "strict" : false, "restricted" : false, "internetGatewayRole" : false, "ipRanges" : [ ], "excludedFromFirewall" : false, "notUsableLoadBalancers" : false, "notUsableVirtualMachines" : false, "links" : [ ] }, "usersRole" : [ ], "vmsSoft" : 0, "vmsHard" : 0, "vlansSoft" : 0, "vlansHard" : 0, "publicIpsSoft" : 0, "publicIpsHard" : 0, "links" : [ { "rel" : "location", "href" : "https://.bcn.abiquo.com/api/cloud/locations/1" }, { "rel" : "enterprise", "href" : "https://.bcn.abiquo.com/api/admin/enterprises/15" } ], "ramSoft" : 0, "ramHard" : 0, "cpuSoft" : 0, "cpuHard" : 0 }
Sample response
Expand Code Block { "creationTime": 1576592419286, "finished": true, "jobs": { "links": [], "collection": [] }, "links": [ { "rel": "self", "type": "application/vnd.abiquo.asynctask+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/asynctasks/1625" }, { "title": "vdc_test_create", "rel": "owner", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075" }, { "title": "Abiquo-DC", "rel": "datacenter", "type": "application/vnd.abiquo.datacenter+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1" }, { "title": "Video_enterprise", "rel": "enterprise", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/15" } ] }
The "owner" link references the virtualdatacenter, so you can use it obtain the virtualdatacenter entity and you will also need it to create a virtual appliance.
Code Block { "title": "vdc_test_create", "rel": "owner", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075" },
- Create a virtual appliance
- Reference: https://wiki.abiquo.com/api/latest/VirtualAppliancesResource.html#create-a-virtual-appliance
cURL
Code Block curl -X POST https://abiquoapi.bcn.abiquo.com/api/cloud/virtualdatacenters/2075/virtualappliances \ -H 'Accept:application/vnd.abiquo.virtualappliance+json; version=4.7' \ -H 'Content-Type:application/vnd.abiquo.virtualappliance+json; version=4.7' \ -d @virtualappliancecreate.json \ -u user:password --verbose
Virtual appliance entity
Code Block { "name":"vapp_test_create" }
Sample response. Success status code: 201
Expand Code Block { "id": 2596, "error": 0, "highDisponibility": 0, "name": "vapp_test_create", "publicApp": 0, "state": "NOT_DEPLOYED", "restricted": false, "notAllocatedVirtualMachines": 0, "onVirtualMachines": 0, "offVirtualMachines": 0, "pausedVirtualMachines": 0, "allocatedVirtualMachines": 0, "configuredVirtualMachines": 0, "unknownVirtualMachines": 0, "lockedVirtualMachines": 0, "links": [ { "title": "vapp_test_create", "rel": "edit", "type": "application/vnd.abiquo.virtualappliance+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596" }, { "title": "vdc_test_create", "rel": "virtualdatacenter", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075" }, { "title": "Video_enterprise", "rel": "enterprise", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/15" }, { "title": "virtual machines", "rel": "virtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines" }, { "title": "virtual appliances state", "rel": "state", "type": "application/vnd.abiquo.virtualappliancestate+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/state" }, { "title": "undeploy", "rel": "undeploy", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/undeploy" }, { "title": "deploy", "rel": "deploy", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/deploy" }, { "title": "price", "rel": "price", "type": "text/plain", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/price" }, { "title": "layers", "rel": "layers", "type": "application/vnd.abiquo.layers+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/layers" }, { "title": "spec", "rel": "spec", "type": "application/vnd.abiquo.virtualappliancespec+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/spec" }, { "title": "tasks", "rel": "tasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/tasks" }, { "title": "scalinggroups", "rel": "scalinggroups", "type": "application/vnd.abiquo.scalinggroups+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/scalinggroups" }, { "title": "metricsmetadata", "rel": "metricsmetadata", "type": "application/vnd.abiquo.metricsmetadata+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/metrics" }, { "title": "collectd", "rel": "collectd", "type": "application/json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/metrics/collectd" }, { "title": "alarmssearch", "rel": "alarmssearch", "type": "application/vnd.abiquo.alarms+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/alarms" } ] }
Numberedheadings | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
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!
|
...