Versions Compared

Key

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

...

This simple walkthrough shows how to deploy in a scenario in AWS where a virtual datacenter and a template exist for the public cloud region. The user role in this example is a plain user. The privileges needed are displayed for every query.

Privileges

...

required

See privilege definitions.

...

Then we will retrieve the enterprise, in order to access the repository and the  virtual machine template s for the hypervisor of the virtual datacenter. To create the new virtual machine, we will take the virtual appliance and add the templates for the new  virtual machine s. 

Get all

...

virtual datacenters


Tip
titleAPI Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the page for this resource VirtualDatacenterResource.


API Roles roles required

Code Block
titleGET all Virtual Datacenters
* This action requires the privileges AUTHENTICATED, VDC_ENUMERATE

...

Div
classwidecode tinycode

API Roles roles required:


Code Block
titleCREATE a Virtual Appliance
* This action requires the privilege VDC_MANAGE_VAPP


cURL:


Code Block
curl -X POST https://example.com/api/cloud/virtualdatacenters/490/virtualappliances \ 
	 -H 'Accept:application/vnd.abiquo.virtualappliance+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualappliance+json; version=4.2' \ 
	 -d @requestpayload.xml \ 
	 -u user:password --verbose 


Success status code: 201

Request payload:


Code Block
{
	"name":"vapp_vdc_m01j_001",
	"iconUrl":"https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png"
}


Response payload:


Expand
titleClick here to show/hide the example response



Code Block
{
   "id":836,
   "error":0,
   "highDisponibility":0,
   "name":"vapp_vdc_m01j_001",
   "publicApp":0,
   "state":"NOT_DEPLOYED",
   "iconUrl":"https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png",
   "notAllocatedVirtualMachines":0,
   "onVirtualMachines":0,
   "offVirtualMachines":0,
   "pausedVirtualMachines":0,
   "allocatedVirtualMachines":0,
   "configuredVirtualMachines":0,
   "unknownVirtualMachines":0,
   "lockedVirtualMachines":0,
   "links":[
      {
         "title":"vapp_vdc_m01j_001",
         "rel":"edit",
         "type":"application/vnd.abiquo.virtualappliance+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836"
      },
      {
         "title":"vdc_m01j",
         "rel":"virtualdatacenter",
         "type":"application/vnd.abiquo.virtualdatacenter+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490"
      },
      {
         "title":"AWS_enterprise_forBilling",
         "rel":"enterprise",
         "type":"application/vnd.abiquo.enterprise+json",
         "href":"https://example.com:443/api/admin/enterprises/65"
      },
      {
         "title":"virtual machines",
         "rel":"virtualmachines",
         "type":"application/vnd.abiquo.virtualmachines+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/virtualmachines"
      },
      {
         "title":"virtual appliances state",
         "rel":"state",
         "type":"application/vnd.abiquo.virtualappliancestate+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/state"
      },
      {
         "title":"undeploy",
         "rel":"undeploy",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/action/undeploy"
      },
      {
         "title":"deploy",
         "rel":"deploy",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/action/deploy"
      },
      {
         "title":"price",
         "rel":"price",
         "type":"text/plain",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/action/price"
      },
      {
         "title":"layers",
         "rel":"layers",
         "type":"application/vnd.abiquo.layers+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/layers"
      },
      {
         "title":"alerts",
         "rel":"alerts",
         "type":"application/vnd.abiquo.alerts+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/alerts"
      },
      {
         "title":"spec",
         "rel":"spec",
         "type":"application/vnd.abiquo.virtualappliancespec+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/action/spec"
      },
      {
         "title":"tasks",
         "rel":"tasks",
         "type":"application/vnd.abiquo.tasks+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/tasks"
      },
      {
         "title":"scalinggroups",
         "rel":"scalinggroups",
         "type":"application/vnd.abiquo.scalinggroups+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/scalinggroups"
      },
      {
         "title":"metricsmetadata",
         "rel":"metricsmetadata",
         "type":"application/vnd.abiquo.metricsmetadata+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/metrics"
      },
      {
         "title":"collectd",
         "rel":"collectd",
         "type":"application/json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/metrics/collectd"
      }
   ]
}





  

...

Next we can determine which templates are available to deploy in our virtual datacenter.

Get

...

templates available to the

...

virtual datacenter

Get all the templates from the repository that are compatible with your virtual datacenter. In this example we only show one virtual machine template.

...

Expand
titleClick here to show/hide the example response


Code Block
{
    "links": [
        {
            "rel": "first",
            "href": "https://example.com:443/api/cloud/virtualdatacenters/490/action/templates?limit=25&by=id&asc=true"
        },
        {
            "rel": "last",
            "href": "https://example.com:443/api/cloud/virtualdatacenters/490/action/templates?startwith=0&limit=25&by=id&asc=true"
        }
    ],
    "collection": [
        {
            "id": "1168",
            "name": "amzn-ami-hvm-2015.03.0.x86_64-gp2",
            "description": "Amazon Linux AMI 2015.03.0 x86_64 HVM GP2",
            "osType": "OTHER_64",
            "cpuRequired": 2,
            "ramRequired": 60,
            "shared": false,
            "state": "DONE",
            "creationDate": "2018-02-13T11:41:04.000+0000",
            "creationUser": "137112412989",
            "chefEnabled": true,
            "iconUrl": "http://icons.abiquo.com/AWS-icon.png",
            "loginUser": "ec2-user",
            "variables": {},
            "enableCpuHotAdd": false,
            "enableRamHotAdd": false,
            "enableDisksHotReconfigure": false,
            "enableNicsHotReconfigure": false,
            "enableRemoteAccessHotReconfigure": false,
            "enableOnlyHPRecommended": false,
            "generateGuestInitialPassword": false,
            "links": [
                {
                    "title": "AWS_enterprise_forBilling",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://example.com:443/api/admin/enterprises/65"
                },
                {
                    "title": "Others",
                    "rel": "category",
                    "type": "application/vnd.abiquo.category+json",
                    "href": "https://example.com:443/api/config/categories/1"
                },
                {
                    "title": "amzn-ami-hvm-2015.03.0.x86_64-gp2",
                    "rel": "edit",
                    "type": "application/vnd.abiquo.virtualmachinetemplate+json",
                    "href": "https://example.com:443/api/admin/enterprises/65/datacenterrepositories/2/virtualmachinetemplates/1168"
                },
                {
                    "title": "tasks",
                    "rel": "tasks",
                    "type": "application/vnd.abiquo.tasks+json",
                    "href": "https://example.com:443/api/admin/enterprises/65/datacenterrepositories/2/virtualmachinetemplates/1168/tasks"
                },
                {
                    "title": "repository",
                    "rel": "datacenterrepository",
                    "type": "application/vnd.abiquo.datacenterrepository+json",
                    "href": "https://example.com:443/api/admin/enterprises/65/datacenterrepositories/2"
                },
                {
                    "title": "virtual machines",
                    "rel": "virtualmachines",
                    "type": "application/vnd.abiquo.virtualmachines+json",
                    "href": "https://example.com:443/api/admin/enterprises/65/datacenterrepositories/2/virtualmachinetemplates/1168/action/virtualmachines"
                },
                {
                    "title": "disks",
                    "rel": "disks",
                    "type": "application/vnd.abiquo.disks+json",
                    "href": "https://example.com:443/api/admin/enterprises/65/datacenterrepositories/2/virtualmachinetemplates/1168/disks"
                },
                {
                    "rel": "disk0",
                    "type": "application/vnd.abiquo.disk+json",
                    "href": "https://example.com:443/api/admin/enterprises/65/datacenterrepositories/2/virtualmachinetemplates/1168/disks/1371"
                },
                {
                    "title": "c3.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3084"
                },
                {
                    "title": "m3.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3106"
                },
                {
                    "title": "m4.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3111"
                },
                {
                    "title": "c3.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3085"
                },
                {
                    "title": "hs1.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3075"
                },
                {
                    "title": "t2.small",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3079"
                },
                {
                    "title": "c4.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3089"
                },
                {
                    "title": "m4.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3110"
                },
                {
                    "title": "c4.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3091"
                },
                {
                    "title": "r3.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3116"
                },
                {
                    "title": "r3.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3117"
                },
                {
                    "title": "g2.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3076"
                },
                {
                    "title": "r3.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3115"
                },
                {
                    "title": "m4.10xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3113"
                },
                {
                    "title": "cc2.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3073"
                },
                {
                    "title": "t2.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3081"
                },
                {
                    "title": "i2.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3096"
                },
                {
                    "title": "m3.medium",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3105"
                },
                {
                    "title": "m3.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3108"
                },
                {
                    "title": "i2.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3095"
                },
                {
                    "title": "i2.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3097"
                },
                {
                    "title": "c4.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3090"
                },
                {
                    "title": "m4.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3112"
                },
                {
                    "title": "r3.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3118"
                },
                {
                    "title": "i2.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3094"
                },
                {
                    "title": "d2.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3128"
                },
                {
                    "title": "c4.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3093"
                },
                {
                    "title": "m4.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3109"
                },
                {
                    "title": "d2.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3126"
                },
                {
                    "title": "hi1.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3074"
                },
                {
                    "title": "c3.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3088"
                },
                {
                    "title": "m3.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3107"
                },
                {
                    "title": "c3.2xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3086"
                },
                {
                    "title": "t2.medium",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3080"
                },
                {
                    "title": "cr1.8xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3129"
                },
                {
                    "title": "c3.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3087"
                },
                {
                    "title": "c4.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3092"
                },
                {
                    "title": "d2.4xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3127"
                },
                {
                    "title": "d2.xlarge",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3125"
                },
                {
                    "title": "r3.large",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3114"
                },
                {
                    "title": "t2.micro",
                    "rel": "hardwareprofile",
                    "type": "application/vnd.abiquo.hardwareprofile+json",
                    "href": "https://example.com:443/api/cloud/locations/2/hardwareprofiles/3078"
                }
            ]
        }
    ],
    "totalSize": 1
} 



Create the

...

virtual machine

Now we will create the virtual machine. To do this, you will need:

...

Code Block
        {
            "title": "virtual machine deploy",
            "rel": "deploy",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/virtualmachines/6376/action/deploy"
        },

 

Deploy a

...

virtual machine

 

Tip
titleAPI Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the pages for this resource VirtualMachineResource and VirtualApplianceResource.

...

Code Block
{
    "message": "You can keep track of the progress in the link",
    "links": [
        {
            "rel": "status",
            "href": "https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/virtualmachines/6376/tasks/8ceb8256-6599-45f2-8989-e2d8e507c41a"
        }
    ]
}

 

 

Undeploy a

...

virtual machine

And undeploy:

Code Block
titleUNDEPLOY a Virtual Machine
* This action requires the privilege VAPP_DEPLOY_UNDEPLOY
curl -X POST http://example.com:9000/api/cloud/virtualdatacenters/490/virtualappliances/836/virtualmachines/6376/action/undeploy \
     -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \
     -H 'Content-Type:application/vnd.abiquo.virtualmachinetask+json; version=4.2' \
     -d @requestpayload.json \
     -u user:password --verbose

...

Code Block
titleThe newly created Task
{
    "message": "You can keep track of the progress in the link",
    "links": [
        {
            "rel": "status",
            "href": "https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/virtualmachines/6376/tasks/cec70487-6d29-4fde-b6ef-e3488f5fe239"
        }
    ]
} 


Check

...

progress

We can query the progress using:

...