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://.bcn.abiquo.com:443/api/cloud/locations?limit=25&has=Abiquo&by=name&asc=true" }, { "rel": "last", "href": "https://.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://.bcn.abiquo.com:443/api/admin/datacenters/1" }, { "title": "racks", "rel": "racks", "type": "application/vnd.abiquo.racks+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/racks" }, { "title": "remote services", "rel": "remoteservices", "type": "application/vnd.abiquo.remoteservices+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/remoteservices" }, { "title": "update resources", "rel": "updateusedresources", "type": "", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/action/updateusedresources" }, { "title": "datastores", "rel": "datastores", "type": "application/vnd.abiquo.datastores+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/datastores" }, { "title": "hypervisors", "rel": "hypervisors", "type": "application/vnd.abiquo.hypervisortypes+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/hypervisors" }, { "title": "enterprises", "rel": "enterprises", "type": "application/vnd.abiquo.enterprises+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/action/enterprises" }, { "title": "discover", "rel": "discover", "type": "application/vnd.abiquo.machines+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/action/discover" }, { "title": "machines state", "rel": "checkmachinestate", "type": "application/vnd.abiquo.machinestate+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/action/checkmachinestate" }, { "title": "machines ipmi", "rel": "checkmachineipmistate", "type": "application/vnd.abiquo.machineipmistate+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/action/checkmachineipmistate" }, { "title": "tiers", "rel": "tiers", "type": "application/vnd.abiquo.tiers+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/storage/tiers" }, { "title": "storage devices", "rel": "devices", "type": "application/vnd.abiquo.storagedevices+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/storage/devices" }, { "title": "devices", "rel": "devices", "type": "application/vnd.abiquo.devices+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/devices" }, { "title": "network service types", "rel": "networkservicetypes", "type": "application/vnd.abiquo.networkservicetypes+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/networkservicetypes" }, { "title": "public networks", "rel": "network", "type": "application/vnd.abiquo.vlans+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/network" }, { "title": "external ips", "rel": "externalips", "type": "application/vnd.abiquo.externalips+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/network/action/externalips" }, { "title": "limits", "rel": "getLimits", "type": "application/vnd.abiquo.limits+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/action/getlimits" }, { "title": "excluded networks", "rel": "excludednetworks", "type": "application/vnd.abiquo.excludednetworks+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/excludednetworks" }, { "title": "NARS", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://.bcn.abiquo.com:443/api/admin/remoteservices/4" }, { "title": "REMOTEACCESS", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://.bcn.abiquo.com:443/api/admin/remoteservices/61" }, { "title": "VIRTUALSYSTEMMONITOR", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://.bcn.abiquo.com:443/api/admin/remoteservices/2" }, { "title": "BPMSERVICE", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://.bcn.abiquo.com:443/api/admin/remoteservices/6" }, { "title": "APPLIANCEMANAGER", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://.bcn.abiquo.com:443/api/admin/remoteservices/3" }, { "title": "VIRTUALFACTORY", "rel": "remoteservice", "type": "application/vnd.abiquo.remoteservice+json", "href": "https://.bcn.abiquo.com:443/api/admin/remoteservices/1" }, { "title": "metricsmetadata", "rel": "metricsmetadata", "type": "application/vnd.abiquo.metricsmetadata+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/metrics" }, { "title": "collectd", "rel": "collectd", "type": "application/json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/metrics/collectd" }, { "title": "alarmssearch", "rel": "alarmssearch", "type": "application/vnd.abiquo.alarms+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/alarms" }, { "title": "natnetworks", "rel": "natnetworks", "type": "application/vnd.abiquo.natnetworks+json", "href": "https://.bcn.abiquo.com:443/api/admin/datacenters/1/natnetworks" }, { "title": "Get nat ips", "rel": "natips", "type": "application/vnd.abiquo.natips+json", "href": "https://.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://.bcn.abiquo.com:443/api/admin/datacenters/1/natnetworks/action/allrules" }, { "title": "repository", "rel": "datacenterrepository", "type": "application/vnd.abiquo.datacenterrepository+json", "href": "https://.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1" }, { "title": "floating ips", "rel": "ips", "type": "application/vnd.abiquo.publicips+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/ips" }, { "title": "devices", "rel": "devices", "type": "application/vnd.abiquo.devices+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/devices" }, { "title": "available templates", "rel": "templates", "type": "application/vnd.abiquo.virtualmachinetemplates+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/templates" }, { "title": "remote vdcs", "rel": "remotevirtualdatacenters", "type": "application/vnd.abiquo.virtualdatacenters+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/action/remotevirtualdatacenters" }, { "title": "remote vms", "rel": "remotevirtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/action/remotevirtualmachines" }, { "title": "available volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/volumes" }, { "title": "available tiers", "rel": "tiers", "type": "application/vnd.abiquo.tiers+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/tiers" }, { "title": "Abiquo-DC", "rel": "location", "type": "application/vnd.abiquo.datacenter+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1" }, { "title": "backup policies", "rel": "backuppolicies", "type": "application/vnd.abiquo.backuppolicies+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/backuppolicies" }, { "title": "backup location properties", "rel": "backupproperties", "type": "application/vnd.abiquo.backupdatacenterproperties+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/backupproperties" }, { "title": "compatible datastore tiers", "rel": "compatibles", "type": "application/vnd.abiquo.links+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/action/compatibles" }, { "title": "datastore tiers", "rel": "datastoretiers", "type": "application/vnd.abiquo.datastoretiers+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers" }, { "title": "metricsmetadata", "rel": "metricsmetadata", "type": "application/vnd.abiquo.metricsmetadata+json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/metrics" }, { "title": "collectd", "rel": "collectd", "type": "application/json", "href": "https://.bcn.abiquo.com:443/api/cloud/locations/1/metrics/collectd" }, { "title": "VMware vCenter", "rel": "hypervisortype", "type": "application/vnd.abiquo.hypervisortype+json", "href": "https://.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04" } ] } ] }
You will need the edit, hypervisortype, and hypervisortype datacenterrepository links of the location.
- 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 { "hypervisorType" : "VMX_04", "name" : "vdc_test_create", "network" : { "name" : "Default Network",Code Block 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. 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 a virtualdatacenter entity
- Reference: https://wiki.abiquo.com/api/latest/virtualdatacenter.html
- Add the links to the enterprise and the location and the hypervisorType attribute.
datacenterrepository link to retrieve templates
Code Block { "title": "repository", "
rel"
: "
datacenterrepository",
"
type"
: "
application/vnd.
abiquo.datacenterrepository+json",
"
href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1"
},
- Create a virtualdatacenter entity
- Reference: 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" : { "relname" : "locationDefault Network", "hrefaddress" : "https://.bcn.abiquo.com/api/cloud/locations/1" }, {192.168.0.0", "relmask" : "enterprise"24, "hrefgateway" : "https://.bcn.abiquo.com/api/admin/enterprises/15" } ],192.168.0.1", "ramSoftprimaryDNS" : "10.0.0.1", "ramHardsecondaryDNS" : "10.0.0.1", "cpuSoftdefaultNetwork" : 0false, "cpuHardtype" : 0 }
Sample response
Expand Code Block { "INTERNAL", "creationTimeipv6" : 1576592419286false, "finishedstrict" : truefalse, "jobsrestricted" : false, { "internetGatewayRole" : false, "linksipRanges" : [ ], "excludedFromFirewall" : false, "collectionnotUsableLoadBalancers" : []false, "notUsableVirtualMachines" : }false, "links" : [ ] }, "usersRole" : {[ ], "vmsSoft" : 0, "vmsHard" : 0, "relvlansSoft" : 0, "selfvlansHard" : 0, "publicIpsSoft" : 0, "publicIpsHard" : 0, "typelinks" : "application/vnd.abiquo.asynctask+json", [ { "rel" : "location", "href" : "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/asynctasks/1625" }, { "rel" : "enterprise", "titlehref" : "vdc_test_create",https://.bcn.abiquo.com/api/admin/enterprises/15" } ], "ramSoft" : 0, "relramHard" : "owner"0, "cpuSoft" : 0, "typecpuHard" : "application/vnd.abiquo.virtualdatacenter+json", 0 }
Sample response
Expand Code Block { "creationTime": 1576592419286, "hreffinished": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075" true, "jobs": { }, "links": [], { "collection": [] }, "titlelinks": "Abiquo-DC", [ { "rel": "datacenterself", "type": "application/vnd.abiquo.datacenterasynctask+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/locations/1/asynctasks/1625" }, { "title": "Videovdc_test_enterprisecreate", "rel": "enterpriseowner", "type": "application/vnd.abiquo.enterprisevirtualdatacenter+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admincloud/enterprisesvirtualdatacenters/152075" }, ] }
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 - 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
{{
vdc_test_create"title": "
ownerAbiquo-DC", "rel": "
virtualdatacenterdatacenter", "type": "application/vnd.abiquo.
virtualdatacentersdatacenter+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/
2075locations/
1" },
Code Block { "id": 2596, { "title": "Video_enterprise", "errorrel": 0"enterprise", "highDisponibility": 0, "nametype": "vapp_test_createapplication/vnd.abiquo.enterprise+json", "publicApp": 0, "statehref": "NOT_DEPLOYED",https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/15" "restricted": false, } "notAllocatedVirtualMachines": 0, ] }
The "
onVirtualMachines": 0, "offVirtualMachines": 0,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 {
"pausedVirtualMachines":"
configuredVirtualMachinestitle":
0"vdc_test_create",
"unknownVirtualMachines": 0,"
lockedVirtualMachinesrel":
0"owner",
"links":"type": "application/vnd.abiquo.virtualdatacenter+json", "
titlehref": "
vapp_test_create",https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075"
"rel": "edit", "type": "application/vnd.abiquo.virtualappliance+json", "href": "},
- 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
:443/api/cloud/virtualdatacenters/2075/virtualappliances
/2596"\ -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
"title": "vdcVirtual appliance entity
Code Block { "name":"vapp_test_create"
,}
Sample response. Success status code: 201
Expand Code Block { "id": 2596, "relerror": "virtualdatacenter"0, "highDisponibility": 0, "typename": "application/vnd.abiquo.virtualdatacenter+jsonvapp_test_create", "publicApp": 0, "state": "NOT_DEPLOYED", "hrefrestricted": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075" }false, "notAllocatedVirtualMachines": 0, "onVirtualMachines": 0, "offVirtualMachines": 0, "pausedVirtualMachines": 0, "allocatedVirtualMachines": 0, "configuredVirtualMachines": 0, "unknownVirtualMachines": 0, "lockedVirtualMachines": 0, "links": [ { "title": "Videovapp_test_enterprisecreate", "rel": "enterpriseedit", "type": "application/vnd.abiquo.enterprisevirtualappliance+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/admin/enterprises/15cloud/virtualdatacenters/2075/virtualappliances/2596" }, { "title": "virtual machinesvdc_test_create", "rel": "virtualmachinesvirtualdatacenter", "type": "application/vnd.abiquo.virtualmachinesvirtualdatacenter+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines" }, { "title": "virtual appliances stateVideo_enterprise", "rel": "stateenterprise", "type": "application/vnd.abiquo.virtualappliancestateenterprise+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloudadmin/virtualdatacenters/2075/virtualappliances/2596/stateenterprises/15" }, { "title": "undeployvirtual machines", "rel": "undeployvirtualmachines", "type": "application/vnd.abiquo.acceptedrequestvirtualmachines+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/undeployvirtualmachines" }, { "title": "deployvirtual appliances state", "rel": "deploystate", "type": "application/vnd.abiquo.acceptedrequestvirtualappliancestate+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/deploystate" }, { "title": "priceundeploy", "rel": "priceundeploy", "type": "text/plainapplication/vnd.abiquo.acceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/priceundeploy" }, { "title": "layersdeploy", "rel": "layersdeploy", "type": "application/vnd.abiquo.layersacceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/layersaction/deploy" }, { "title": "specprice", "rel": "specprice", "type": "application/vnd.abiquo.virtualappliancespec+jsontext/plain", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/specprice" }, { "title": "taskslayers", "rel": "taskslayers", "type": "application/vnd.abiquo.taskslayers+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/taskslayers" }, { "title": "scalinggroupsspec", "rel": "scalinggroupsspec", "type": "application/vnd.abiquo.scalinggroupsvirtualappliancespec+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/action/scalinggroupsspec" }, { "title": "metricsmetadatatasks", "rel": "metricsmetadatatasks", "type": "application/vnd.abiquo.metricsmetadatatasks+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/metricstasks" }, { "title": "collectdscalinggroups", "rel": "collectdscalinggroups", "type": "application/vnd.abiquo.scalinggroups+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/metrics/collectdscalinggroups" }, { "title": "alarmssearchmetricsmetadata", "rel": "alarmssearchmetricsmetadata", "type": "application/vnd.abiquo.alarmsmetricsmetadata+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/alarmsmetrics" }, { "title": "collectd", "rel": "collectd", "type": "application/json", ] }
...
number-format | custom |
---|---|
h1 | [h1.decimal] |
h2 | [h2.decimal] |
h3 | [h3.decimal]. |
h4 | [h3.decimal].[h4.decimal] |
start-numbering-at | h3 |
Create and Deploy a Virtual Appliance
...
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!
...
"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" } ] }
You will need the virtualmachines link to create a VM
Code Block { "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" },
- Get a compatible template from the Apps library
- Reference: https://wiki.abiquo.com/api/latest/VirtualMachineTemplatesResource.html#list-virtual-machine-templates-in-a-datacenter-repository
Perform a GET request to the URL from the datacenterrepository link of the location. Get the virtualmachinetemplates link from the datacenterrepository.
Get the VM templates using parameters including:
hypervisorTypeName - for compatibility
- limit - for convenience
- has - filter template names by this text string
cURL
Code Block curl --verbose -X GET "https://nardo40.bcn.abiquo.com/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates?hypervisorTypeName=VMX_04&limit=1&has=Core" \ -H "Accept: application/vnd.abiquo.virtualmachinetemplates+json; version=4.7;" \ -u user:password
Sample response. Success status code: 201
Expand Code Block { "totalSize": 2, "links": [ { "rel": "first", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates?hypervisorTypeName=VMX_04&limit=1&has=Core&by=state&asc=true" }, { "rel": "next", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates?hypervisorTypeName=VMX_04&startwith=1&limit=1&has=Core&by=state&asc=true" }, { "rel": "last", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates?hypervisorTypeName=VMX_04&startwith=1&limit=1&has=Core&by=state&asc=true" } ], "collection": [ { "id": "3", "name": "Core", "description": "root : abiquo", "osType": "LINUX_64", "osVersion": "", "cpuRequired": 1, "ramRequired": 64, "shared": true, "state": "DONE", "creationDate": "2017-02-06T23:37:41.000+0000", "creationUser": "SYSTEM", "chefEnabled": false, "iconUrl": "https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png", "loginUser": "user", "loginPassword": "password", "ethernetDriverType": "E1000", "variables": {}, "enableCpuHotAdd": false, "enableRamHotAdd": false, "enableDisksHotReconfigure": false, "enableNicsHotReconfigure": false, "enableRemoteAccessHotReconfigure": false, "enableOnlyHPRecommended": false, "generateGuestInitialPassword": false, "productCodes": [], "links": [ { "title": "Video_enterprise", "rel": "enterprise", "type": "application/vnd.abiquo.enterprise+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15" }, { "title": "Others", "rel": "category", "type": "application/vnd.abiquo.category+json", "href": "https://nardo40.bcn.abiquo.com:443/api/config/categories/1" }, { "title": "Core", "rel": "edit", "type": "application/vnd.abiquo.virtualmachinetemplate+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates/3" }, { "title": "tasks", "rel": "tasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates/3/tasks" }, { "title": "repository", "rel": "datacenterrepository", "type": "application/vnd.abiquo.datacenterrepository+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1" }, { "title": "virtual machines", "rel": "virtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates/3/action/virtualmachines" }, { "title": "disks", "rel": "disks", "type": "application/vnd.abiquo.disks+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates/3/disks" }, { "rel": "disk0", "type": "application/vnd.abiquo.disk+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates/3/disks/3" }, { "title": "template definition", "rel": "templatedefinition", "href": "http://rs.bcn.abiquo.com:9000/ovf/305/desc.ovf" }, { "title": "template path", "rel": "templatePath", "href": "https://nardo40.bcn.abiquo.com:443/am/erepos/15/templates/1/rs.bcn.abiquo.com/abiport9000/ovf/305/" }, { "title": "Global scope", "rel": "scope", "type": "application/vnd.abiquo.scope+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/scopes/1" } ] } ] }
Select the virtualmachinetemplate object you want to use and get the edit link
Code Block { "title": "Core", "rel": "edit", "type": "application/vnd.abiquo.virtualmachinetemplate+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates/3" },
- Troubleshooting: if the request doesn't return any templates, you may need to refresh the datacenter repository. Reference:
- Create a VM entity
The link to specify the template is the only required attribute. In this case, we are also setting the friendly name of the VM and enabling remote access.
Code Block { "label":"Core_VM", "links":[ { "title":"Core", "rel":"virtualmachinetemplate", "type":"application/vnd.abiquo.virtualmachinetemplate+json", "href":"https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates/3" } ], "vdrpEnabled":true }
- Create a VM
- Perform a POST request to the URL of the virtualmachines link from the virtual appliance
cURL
Code Block curl -X POST https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines \ -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.7' \ -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.7' \ -d @virtualmachineentity.json \ -u user:password --verbose
- The virtualmachineentity.json file to send with this request is shown in the previous step.
Sample response. Success status code: 201
Expand Code Block { "id": 16644, "uuid": "6e28ff4d-207a-4299-9b52-a3bc6ced856a", "description": "root : abiquo", "coresPerSocket": 1, "idState": 1, "idType": 0, "type": "MANAGED", "highDisponibility": 0, "monitored": true, "protected": false, "variables": {}, "backuppolicies": [], "generateGuestInitialPassword": false, "natrules": [], "vdrpEnabled": true, "vdrpPort": 0, "password": "h6JXpuku", "name": "ABQ_6e28ff4d-207a-4299-9b52-a3bc6ced856a", "label": "Core_VM", "ram": 64, "cpu": 1, "state": "NOT_ALLOCATED", "creationTimestamp": 1576606467000, "iconUrl": "https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png", "links": [ { "title": "Video_enterprise", "rel": "enterprise", "type": "application/vnd.abiquo.enterprise+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15" }, { "title": "ABQ_6e28ff4d-207a-4299-9b52-a3bc6ced856a", "rel": "edit", "type": "application/vnd.abiquo.virtualmachine+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644" }, { "title": "send mail", "rel": "sendmail", "type": "application/vnd.abiquo.mail+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/publiccloudregions/1/enterprises/15/virtualmachines/16644/action/sendmail" }, { "title": "cloudadmin cloudadmin", "rel": "user", "type": "application/vnd.abiquo.user+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/users/10" }, { "title": "vdc_test_create", "rel": "virtualdatacenter", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075" }, { "title": "vapp_test_create", "rel": "virtualappliance", "type": "application/vnd.abiquo.virtualappliance+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596" }, { "title": "metadata", "rel": "metadata", "type": "application/vnd.abiquo.metadata+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/metadata" }, { "title": "vlan network configurations", "rel": "configurations", "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/network/configurations" }, { "title": "nics", "rel": "nics", "type": "application/vnd.abiquo.nics+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/network/nics" }, { "title": "disks", "rel": "harddisks", "type": "application/vnd.abiquo.harddisks+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/storage/disks" }, { "title": "NOT_ALLOCATED", "rel": "state", "type": "application/vnd.abiquo.virtualmachinestate+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/state" }, { "title": "virtual machine undeploy", "rel": "undeploy", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/undeploy" }, { "title": "virtual machine deploy", "rel": "deploy", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/deploy" }, { "title": "virtual machine reset", "rel": "reset", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/reset" }, { "title": "virtual machine snapshot", "rel": "instance", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/instance" }, { "title": "remote access", "rel": "rdpaccess", "type": "application/vnd.abiquo.virtualmachineconsole+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/config/rdpaccess" }, { "title": "tasks", "rel": "tasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/tasks" }, { "title": "firewalls", "rel": "firewalls", "type": "application/vnd.abiquo.links+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/firewalls" }, { "title": "load balancers", "rel": "loadbalancers", "type": "application/vnd.abiquo.loadbalancers+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/loadbalancers" }, { "title": "request on demand backup", "rel": "requestbackup", "type": "application/vnd.abiquo.ondemandbackup+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/backup/action/request" }, { "title": "request a restore of a backup", "rel": "requestrestore", "type": "application/vnd.abiquo.restore+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/backup/action/restore" }, { "title": "move VM to a virtual appliance", "rel": "vappmove", "type": "application/vnd.abiquo.links+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/vappmove" }, { "title": "move VM to another virtual datacenter", "rel": "move", "type": "application/vnd.abiquo.movevm+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/move" }, { "title": "volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/storage/volumes" }, { "diskController": "lsilogic", "diskControllerType": "SCSI", "length": "100", "title": "f693e374-e07e-4a94-99db-a7268a904484", "rel": "disk0", "type": "application/vnd.abiquo.harddisk+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/disks/15069" }, { "title": "datastoretierESXI6.0_2.29", "rel": "datastoretier0", "type": "application/vnd.abiquo.datastoretier+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/58" }, { "title": "protect", "rel": "protect", "type": "text/plain", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/protect" }, { "title": "unprotect", "rel": "unprotect", "type": "text/plain", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/unprotect" }, { "title": "metricsmetadata", "rel": "metricsmetadata", "type": "application/vnd.abiquo.metricsmetadata+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/metrics" }, { "title": "disablemonitoring", "rel": "disablemonitoring", "type": "", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/disablemonitoring" }, { "title": "collectd", "rel": "collectd", "type": "application/json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/metrics/collectd" }, { "title": "alarmssearch", "rel": "alarmssearch", "type": "application/vnd.abiquo.alarms+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/alarms" }, { "title": "clone", "rel": "clone", "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/clone" }, { "title": "VMware vCenter", "rel": "hypervisortype", "type": "application/vnd.abiquo.hypervisortype+json", "href": "https://nardo40.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04" }, { "title": "Core", "rel": "virtualmachinetemplate", "type": "application/vnd.abiquo.virtualmachinetemplate+json", "href": "https://nardo40.bcn.abiquo.com:443/api/admin/enterprises/15/datacenterrepositories/1/virtualmachinetemplates/3" }, { "title": "Others", "rel": "category", "type": "application/vnd.abiquo.category+json", "href": "https://nardo40.bcn.abiquo.com:443/api/config/categories/1" } ], "usageStatistics": [] }
You will need the deploy link to launch the VM
Code Block { "title": "virtual machine deploy", "rel": "deploy", "type": "application/vnd.abiquo.acceptedrequest+json", "href": "https://abiquoapi.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/deploy" },
- Deploy the VM
- Reference: https://wiki.abiquo.com/api/latest/VirtualMachinesResource.html#deploy-a-virtual-machine
cURL
Code Block curl -X POST https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/action/deploy \ -H 'Accept:application/vnd.abiquo.acceptedrequest+json;version=4.7' \ -u user:password --verbose
Sample response. Success status code: 202
This request returns an acceptedrequest object with a link to track the progress of the deploy.Expand Code Block { "message": "You can keep track of the progress in the link", "links": [ { "title": "status", "rel": "status", "type": "application/vnd.abiquo.task+json", "href": "https://nardo40.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2075/virtualappliances/2596/virtualmachines/16644/tasks/d49aedbe-cc20-4410-9e74-2de1243342aa" } ] }
- Alternatively, you can deploy all the VMs in the virtual appliance using the deploy link from the virtual appliance.
Your VM should now be deployed and powered on. Congratulations! You have completed this tutorial.