Documentation

Skip to end of metadata
Go to start of metadata

This page gives a brief introduction to how to manage virtual machines and the virtual machine lifecycle in Abiquo. However, you should also read the other sections on virtual machine and virtual appliance configuration.

 

Create a virtual machine from a template

To get started working with virtual machines:
  1. Go to the Virtual datacenters view
  2. Select a virtual datacenter (which is like a virtual private cloud)
  3. Open a virtual appliance (which is like a folder for a group of related virtual machines), by double clicking its name or clicking the Enter link

To create a new virtual machine in the platform, from the Templates tab, select a template just double-click or drag and drop to the Virtual machines pane.

It is that easy to create virtual machines in Abiquo!

Select hardware profile in public cloud region

If you are working in a public cloud region, select a hardware profile for your virtual machine.

In AWS, the smallest hardware profile for use with a free starter account is t1.micro.

Abiquo will display the CPU and RAM for your selected profile.

Add instances of virtual machines in datacenter

If there are other copies (instances) of the virtual machine template you are adding to your virtual appliance, the following pop-up is shown so you can select an instance or the master template. Note that by default the master template is selected but you can deselect it.

Your new virtual machine

The new virtual machine you created it is not deployed, which means it is not allocated to a cloud node and it is not consuming compute resources. 

You can now configure the virtual machine to change the compute resources and add network and storage resources, as well as other configuration. Please note that your cloud provider may charge you for network and storage resources, even if you are not using compute resources.

Of course, you can create a group of related virtual machines in the same virtual appliance, just add more templates!

Deploy actions in the cloud

Deploy to launch a virtual machine

To launch a single virtual machine to a virtualization technology or Docker host:

  1. Select the virtual machine
  2. Click the Deploy VM button

The platform will check your access and schedule or allocate your virtual machine to a hypervisor, public cloud region or Docker. Then the platform will configure it in the virtualization technology, then power it on.

Of course, you can also deploy a group of virtual machines in a virtual appliance - just click the Deploy virtual appliance button.

Synchronize a virtual appliance

Sometimes you will have a virtual machine that is deployed, while another is not deployed. For example, when you add new virtual machine or deploy only one virtual machine out of a group. This means that the virtual appliance is deployed but not synchronized with the hypervisor, public cloud or Docker. So the green Deploy virtual appliance button changes to become the blue Sync virtual appliance button.

To deploy the virtual machine(s) that are not allocated, click the blue Sync virtual appliance button.

Undeploy to destroy a virtual machine and data

When a group of virtual machines are all deployed, you will see the red Undeploy buttons for a selected virtual machine and a virtual appliance.

To stop a virtual machine and remove it from the platform, destroying all data on non-persistent volumes, select the virtual machine and click the Undeploy VM button.   

When you undeploy a virtual machine, then the virtual machine will be DESTROYED on the hypervisor and all changes and DATA on non-persistent disks will be lost.

  • This includes the system disk of a standard (non-persistent) virtual machine
  • Before you undeploy, you can save changes to your non-persistent disks by creating an Abiquo instance template

When you undeploy a virtual machine, it will return to the not allocated state.

Of course, you can also undeploy a virtual appliance, which will undeploy the whole group of virtual machines at the same time.

Manage deploy errors

If your virtual machine did not deploy properly, for example, because you did not have enough resources in your Enterprise, then you may see an (warning) error symbol on the virtual machine icon.

To view recent events, move the mouse over the virtual machine and then click the error symbol. 

To see the full text of a field, move the mouse over it.

To view an event trace, select the event in the list. The trace will display below the list.

To remove the warning symbol, after checking the Event messages, click Yes.

If you have the privilege to Manage Users, you can delete warnings for the users of the enterprises that you manage.

View virtual machine

View VM details

If you select a virtual machine, the platform will display a control panel below the virtual machines panel.  Here you can check the details of the virtual machine.

The General tab contains the CPU and RAM and other information such as the remote access address for connecting via VNC or RDP.

The Network tab contains the details of the IP addresses of the virtual machine.

The Storage tab contains the details of the hard disks and volumes attached to the virtual machine. 

View VM configuration

To display the virtual machine configuration, on the virtual machine icon, click the pencil edit button. 

The virtual machine configuration popup will open. 

If you are working with ESXi and your virtual machine template and operating system support hot add and hot reconfigure, you can change the configuration in this dialog, without powering off the virtual machine.

Virtual machine power actions

To perform power actions, select the virtual machine and use the buttons on the virtual machine control panel in the lower right-hand corner of the screen. The power actions available may vary depending on the virtualization technology.

The following screenshots show two virtual machines: the virtual machine on the left is selected to perform an operation. The virtual machine on the right shows the result of the operation.

Power on

To power on a deployed virtual machine that is OFF or PAUSED, click the power on button. After power on, the virtual machine is running in the cloud node and its icon displays a green bar with the ON state. 

Pause

To pause a virtual machine that is ON, click the pause button. The platform will suspend the virtual machine, which will still exist in the cloud node. The virtual machine icon will display a yellow bar with the paused state. 

Reset

To reset a virtual machine, click the reset button. The platform will reboot the virtual machine. 

Stop

To stop a virtual machine, click the power off button. A pull-down menu will open. Select from two options: graceful shutdown and hard power off.

  • Shutdown: The platform will try to gracefully shut down the virtual machine. This option may require hypervisor and guest VM configuration
  • Power off: The platform will perform a hard power off on the virtualization technology. (minus) Using this option may cause loss of data




Undeployed vs Powered Off Virtual Machines

If a virtual machine is powered off, this does not mean that the virtual machines is undeployed.
A powered off virtual machine is still consuming resources because the virtual machine still exists in the cloud node.

Connect to your virtual machine

If remote access is supported in your environment, you may be able to connect to the virtual machine from the user interface.

Before you connect to your virtual machine, edit your VM to obtain the connection details. Click the pencil edit button on the VM icon.

On the Edit virtual machine dialog on the General information tab, check that remote access is enabled. Select the checkbox to Show password and copy the remote access password (for VNC and RDP access). If they are available, you can also copy the SSH user and password.

Now close the VM configuration popup.

To connect to your virtual machine, click the remote access eye icon.

A noVNC dialog may open, similar to the one shown below. In the Password field, enter the remote access password.

The remote access connection to the virtual machine will open and you can work with the virtual machine. 

If remote access is not supported, the platform may display a popup window with connection details.

You may then use an appropriate remote access client to connect to the virtual machine.

Protected virtual machine

An administrator can lock or protect a deployed virtual machine for maintenance when it is powered on, paused, or powered off.

The user will not be able select the virtual machine to view the details or perform platform operations on this virtual machine. The platform will display a small padlock symbol in the top left-hand corner of the virtual machine icon.

 

Reconfigure a virtual machine

To change the configuration of a virtual machine, including the storage and network configuration, first check if your virtual machine supports hot add and hot reconfigure (currently available for ESXi). If hot add and hot reconfigure are not supported, power off the virtual machine.

Move the mouse over the virtual machine and click the pencil edit button.

In the virtual machine configuration dialog, make your changes following the instructions in the section on how to Configure Virtual Machines.

If the virtual machine is deployed, the changes will be applied in the hypervisor directly. Otherwise, the final configuration will be created when you deploy.

Save changes to virtual machines

Abiquo supports two types of virtual machine disks: persistent and non-persistent disks.
  • The platform stores persistent disks as external storage volumes and any changes you make to the data will be saved, even after you undeploy the virtual machine.
  • The platform stores non-persistent disks on the virtualization technology, e.g. ESXi hypervisor, and the platform will destroy all data on these disks when you undeploy the virtual machine.

Virtual machine templates can be persistent or non-persistent, depending on the system disk type.

Copy virtual machine disks to create a new instance template

To save a new template disk from virtual machine disks, select the virtual machine, power it off and click Create instance. 

Select the virtual machine.

Then select the virtual machine disks to save to a new template in the template library. Click Create instance. 

Use a saved template

To use an instance template in a virtual machine, double-click or drag and drop the original template and an instance menu will open. Select the instance template. 

Save a template to create a persistent VM

You can select a template and save it to a volume as a persistent virtual machine. The persistent virtual machine will deploy using the volume and the changes you make to the virtual machine will be saved on the volume.

To create a persistent virtual machine, open the Persistent VM template tab and click the + button. 

Select the master or instance template that you would like to save to the persistent volume.

Then select the disks and click Start conversion. 

Use a persistent VM

Persistent VMs are available on the Persistent VM tab of the virtual appliance templates panel.

You can create a single virtual machine from the persistent VM and deploy it in the usual way. A virtual machine with a persistent system disk has a disk symbol on the virtual machine icon. 

When you undeploy the persistent virtual machine, the volume will remain intact and the persistent virtual machine will return to the Persistent VM tab.

Delete a virtual machine

To delete a virtual machine, move the mouse over the virtual machine and click the virtual machine delete button.

The following screenshots are based on a virtual appliance with two virtual machines, which has already been deployed. One of the virtual machines is running and one is powered off. 

First delete the powered-off machine.

After you confirm the delete, the icon for the deleted virtual machine is removed from the virtual appliance. 

If the virtual appliance is deployed and the virtual machine is running, you do not need to undeploy - the deployed virtual machine can also be deleted directly.

Retrieve a VM with the API

This section describes how to retrieve a virtual machine with the Abiquo API.
  1. Before you begin, create a virtual machine with the Abiquo UI and power it off. Open the browser console. This example uses Chrome, so click F12.
  2. Select the Network view
  3. Click the red Record button and the Clear button next to it
  4. Click the Start button

  5. Scroll up to the first request, which should be a PUT request to the virtual machine state URL. Click on the request
    1. If you can't see the Method column, right click on a column heading and select Method from the list

  6. Select the link to the virtual machine, which ends in the virtual machine ID number

  7. Use a cURL request like in the example below or REST API tool such as Postman to perform the GET request to this link

 

curl -X GET https://38testing.bcn.abiquo.com/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763 \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=3.8' \ 
	 -u admin:xabiquo --verbose 
 Click here to show or hide the response example

Success status code: 200

Response payload:

{
    "links": [
        {
            "title": "VMX_04",
            "rel": "machine",
            "type": "application/vnd.abiquo.machine+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/74"
        },
        {
            "title": "Abiquo-DC",
            "rel": "location",
            "type": "application/vnd.abiquo.datacenter+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/locations/1"
        },
        {
            "title": "ABQ_5e57c34d-5dcb-482b-be0f-a78931f4abd0",
            "rel": "edit",
            "type": "application/vnd.abiquo.virtualmachine+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763"
        },
        {
            "title": "send mail",
            "rel": "sendmail",
            "type": "application/vnd.abiquo.mail+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/admin/datacenters/1/racks/1/machines/74/virtualmachines/1763/action/sendmail"
        },
        {
            "title": "MJEnterprise",
            "rel": "enterprise",
            "type": "application/vnd.abiquo.enterprise+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/admin/enterprises/74"
        },
        {
            "title": "MJEnt Admin",
            "rel": "user",
            "type": "application/vnd.abiquo.user+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/admin/enterprises/74/users/27"
        },
        {
            "title": "VDC_for_Neutron",
            "rel": "virtualdatacenter",
            "type": "application/vnd.abiquo.virtualdatacenter+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55"
        },
        {
            "title": "vapp_VDC_for_Neutron",
            "rel": "virtualappliance",
            "type": "application/vnd.abiquo.virtualappliance+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200"
        },
        {
            "title": "metadata",
            "rel": "metadata",
            "type": "application/vnd.abiquo.metadata+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/metadata"
        },
        {
            "title": "vlan network configurations",
            "rel": "configurations",
            "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/network/configurations"
        },
        {
            "title": "192.168.0.0/22",
            "rel": "network_configuration",
            "type": "application/vnd.abiquo.virtualmachinenetworkconfiguration+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/network/configurations/230"
        },
        {
            "title": "nics",
            "rel": "nics",
            "type": "application/vnd.abiquo.nics+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/network/nics"
        },
        {
            "title": "disks",
            "rel": "harddisks",
            "type": "application/vnd.abiquo.harddisks+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/storage/disks"
        },
        {
            "title": "OFF",
            "rel": "state",
            "type": "application/vnd.abiquo.virtualmachinestate+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/state"
        },
        {
            "title": "virtual machine undeploy",
            "rel": "undeploy",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/action/undeploy"
        },
        {
            "title": "virtual machine deploy",
            "rel": "deploy",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/action/deploy"
        },
        {
            "title": "virtual machine reset",
            "rel": "reset",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/action/reset"
        },
        {
            "title": "virtual machine snapshot",
            "rel": "instance",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/action/instance"
        },
        {
            "title": "virtual machine restore backup",
            "rel": "restorebackup",
            "type": "application/vnd.abiquo.acceptedrequest+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/action/restorebackup"
        },
        {
            "title": "remote access",
            "rel": "rdpaccess",
            "type": "text/plain",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/config/rdpaccess"
        },
        {
            "title": "tasks",
            "rel": "tasks",
            "type": "application/vnd.abiquo.tasks+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/tasks"
        },
        {
            "title": "firewalls",
            "rel": "firewalls",
            "type": "application/vnd.abiquo.links+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/firewalls"
        },
        {
            "title": "load balancers",
            "rel": "loadbalancers",
            "type": "application/vnd.abiquo.loadbalancers+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/loadbalancers"
        },
        {
            "title": "volumes",
            "rel": "volumes",
            "type": "application/vnd.abiquo.volumes+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/storage/volumes"
        },
        {
            "title": "metrics",
            "rel": "metrics",
            "type": "application/vnd.abiquo.metrics+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/metrics"
        },
        {
            "title": "metricsmetadata",
            "rel": "metricsmetadata",
            "type": "application/vnd.abiquo.metricsmetadata+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/metrics"
        },
        {
            "title": "createcustommetric",
            "rel": "createcustommetric",
            "type": "application/vnd.abiquo.custommetric+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/metrics"
        },
        {
            "title": "enablemonitoring",
            "rel": "enablemonitoring",
            "type": "",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/enablemonitoring"
        },
        {
            "title": "collectd",
            "rel": "collectd",
            "type": "application/json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/collectd"
        },
        {
            "title": "alarms",
            "rel": "alarms",
            "type": "application/vnd.abiquo.alarms+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/alarms"
        },
        {
            "title": "protect",
            "rel": "protect",
            "type": "text/plain",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/action/protect"
        },
        {
            "title": "unprotect",
            "rel": "unprotect",
            "type": "text/plain",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/action/unprotect"
        },
        {
            "title": "metrics",
            "rel": "metrics",
            "type": "application/vnd.abiquo.metrics+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/metrics"
        },
        {
            "title": "metricsmetadata",
            "rel": "metricsmetadata",
            "type": "application/vnd.abiquo.metricsmetadata+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/metrics"
        },
        {
            "title": "createcustommetric",
            "rel": "createcustommetric",
            "type": "application/vnd.abiquo.custommetric+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/metrics"
        },
        {
            "title": "enablemonitoring",
            "rel": "enablemonitoring",
            "type": "",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/enablemonitoring"
        },
        {
            "title": "collectd",
            "rel": "collectd",
            "type": "application/json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/collectd"
        },
        {
            "title": "alarms",
            "rel": "alarms",
            "type": "application/vnd.abiquo.alarms+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/alarms"
        },
        {
            "title": "ESXi",
            "rel": "hypervisortype",
            "type": "application/vnd.abiquo.hypervisortype+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/config/hypervisortypes/VMX_04"
        },
        {
            "title": "Core",
            "rel": "virtualmachinetemplate",
            "type": "application/vnd.abiquo.virtualmachinetemplate+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/admin/enterprises/74/datacenterrepositories/1/virtualmachinetemplates/1"
        },
        {
            "title": "Others",
            "rel": "category",
            "type": "application/vnd.abiquo.category+json",
            "href": "https://38testing.bcn.abiquo.com:443/api/config/categories/1"
        }
    ],
    "id": 1763,
    "name": "ABQ_5e57c34d-5dcb-482b-be0f-a78931f4abd0",
    "ram": 64,
    "cpu": 1,
    "vdrpPort": 5004,
    "vdrpIP": "192.168.2.54",
    "vdrpEnabled": true,
    "idState": 6,
    "state": "OFF",
    "highDisponibility": 0,
    "idType": 0,
    "type": "MANAGED",
    "password": "CAKuvHjj",
    "uuid": "5e57c34d-5dcb-482b-be0f-a78931f4abd0",
    "label": "Core",
    "monitored": false,
    "monitoringLevel": "DEFAULT",
    "variables": {
        "PYTHONHOMEAPP": "/usr/share/python"
    },
    "volumes": {
        "links": [],
        "collection": [
            {
                "links": [
                    {
                        "title": "Persistent volume",
                        "rel": "disk1",
                        "type": "application/vnd.abiquo.volume+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/volumes/2678"
                    },
                    {
                        "title": "NFS Tier",
                        "rel": "tier",
                        "type": "application/vnd.abiquo.tier+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/tiers/1"
                    },
                    {
                        "title": "initiator mappings",
                        "rel": "initiatormappings",
                        "type": "application/vnd.abiquo.initiatormappings+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/volumes/2678/action/initiatormappings"
                    },
                    {
                        "title": "VDC_for_Neutron",
                        "rel": "virtualdatacenter",
                        "type": "application/vnd.abiquo.virtualdatacenter+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55"
                    },
                    {
                        "title": "vapp_VDC_for_Neutron",
                        "rel": "virtualappliance",
                        "type": "application/vnd.abiquo.virtualappliance+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200"
                    },
                    {
                        "title": "ABQ_5e57c34d-5dcb-482b-be0f-a78931f4abd0",
                        "rel": "virtualmachine",
                        "type": "application/vnd.abiquo.virtualmachine+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763"
                    }
                ],
                "id": 2678,
                "name": "Persistent volume",
                "description": "Persistent volume",
                "state": "ATTACHED",
                "sizeInMB": 10,
                "sequence": 1,
                "allowResize": true,
                "diskControllerType": "IDE",
                "bus": 0,
                "unit": 0,
                "bootable": false
            }
        ]
    },
    "disks": {
        "links": [],
        "collection": [
            {
                "links": [
                    {
                        "title": "VDC_for_Neutron",
                        "rel": "virtualdatacenter",
                        "type": "application/vnd.abiquo.virtualdatacenter+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55"
                    },
                    {
                        "rel": "disk0",
                        "type": "application/vnd.abiquo.harddisk+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/disks/2662"
                    },
                    {
                        "title": "disk",
                        "rel": "disk",
                        "type": "application/vnd.abiquo.disk+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/1/virtualmachinetemplates/1/disks/1"
                    },
                    {
                        "title": "FINISHED",
                        "rel": "conversion",
                        "type": "application/vnd.abiquo.conversion+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/1/virtualmachinetemplates/1/disks/1/conversions/VMDK_FLAT"
                    },
                    {
                        "title": "ABQ_5e57c34d-5dcb-482b-be0f-a78931f4abd0",
                        "rel": "virtualmachine",
                        "type": "application/vnd.abiquo.virtualmachine+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763"
                    },
                    {
                        "title": "datasotertierESXI5.5",
                        "rel": "datastoretier",
                        "type": "application/vnd.abiquo.datastoretier+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/44"
                    },
                    {
                        "title": "Core",
                        "rel": "virtualmachinetemplate",
                        "type": "application/vnd.abiquo.virtualmachinetemplate+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/1/virtualmachinetemplates/1"
                    },
                    {
                        "title": "FINISHED",
                        "rel": "conversion",
                        "type": "application/vnd.abiquo.conversion+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/1/virtualmachinetemplates/1/disks/1/conversions/VMDK_FLAT"
                    }
                ],
                "id": 2662,
                "sizeInMb": 100,
                "sequence": 0,
                "diskFormatType": "VMDK_FLAT",
                "path": "2/10.60.1.70/abiport9000/ovf/305/formats/Core-VMDK_FLAT.qcow2",
                "diskFileSize": 104857600,
                "diskControllerType": "SCSI",
                "diskController": "sas",
                "bus": 0,
                "unit": 0,
                "bootable": true
            },
            {
                "links": [
                    {
                        "title": "VDC_for_Neutron",
                        "rel": "virtualdatacenter",
                        "type": "application/vnd.abiquo.virtualdatacenter+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55"
                    },
                    {
                        "rel": "disk2",
                        "type": "application/vnd.abiquo.harddisk+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/disks/2679"
                    },
                    {
                        "title": "ABQ_5e57c34d-5dcb-482b-be0f-a78931f4abd0",
                        "rel": "virtualmachine",
                        "type": "application/vnd.abiquo.virtualmachine+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763"
                    },
                    {
                        "title": "datasotertierESXI5.5",
                        "rel": "datastoretier",
                        "type": "application/vnd.abiquo.datastoretier+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/44"
                    }
                ],
                "id": 2679,
                "sizeInMb": 20,
                "sequence": 2,
                "diskFormatType": "RAW",
                "diskFileSize": 0,
                "diskControllerType": "SCSI",
                "diskController": "sas",
                "bus": 0,
                "unit": 1,
                "bootable": false
            }
        ]
    },
    "nics": {
        "links": [],
        "collection": [
            {
                "links": [
                    {
                        "title": "00:50:56:22:75:AB",
                        "rel": "self",
                        "type": "application/vnd.abiquo.nic+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/network/nics/1704"
                    },
                    {
                        "title": "10.0.10.15",
                        "rel": "edit",
                        "type": "application/vnd.abiquo.publicip+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/publicips/purchased/1704"
                    },
                    {
                        "title": "mj_public_network",
                        "rel": "publicnetwork",
                        "type": "application/vnd.abiquo.vlan+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/admin/datacenters/1/network/233"
                    }
                ],
                "id": 1704,
                "ip": "10.0.10.15",
                "mac": "00:50:56:22:75:AB",
                "sequence": 1,
                "tag": 10
            },
            {
                "links": [
                    {
                        "title": "00:50:56:3A:43:B3",
                        "rel": "self",
                        "type": "application/vnd.abiquo.nic+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/network/nics/2347"
                    },
                    {
                        "title": "192.168.0.2",
                        "rel": "edit",
                        "type": "application/vnd.abiquo.privateip+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/privatenetworks/230/ips/2347"
                    },
                    {
                        "title": "default_private_network",
                        "rel": "privatenetwork",
                        "type": "application/vnd.abiquo.vlan+json",
                        "href": "https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/privatenetworks/230"
                    }
                ],
                "id": 2347,
                "ip": "192.168.0.2",
                "mac": "00:50:56:3A:43:B3",
                "sequence": 0,
                "tag": 8
            }
        ]
    },
    "protected": false
}

Manage virtual machine power cycle via API

 

To manage the virtual machine using the API, first you need to retrieve the virtual machine and find the links for different actions. Remember to see VirtualMachineResource for full details of virtual machine operations using the Abiquo API.

Power on, power off, or pause a VM using the API

To perform a power action on a virtual machine using the API:
  1. Obtain the virtual machine object and its virtual machine state link
    1. See Retrieve a VM with the API
  2. Create a virtualmachinestate object
  3. Send a PUT request to the virtual machine state link

The virtual machine state link is a link in the virtual machine object with the "rel" attribute set to state. The "title" attribute contains the current state. You can send a PUT request of a virtualmachine state object to the link (in the "href" attribute) to change the state of the virtual machine.

           {  
               "title":"PAUSED",
               "rel":"state",
               "type":"application/vnd.abiquo.virtualmachinestate+json",
               "href":"https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/state"
            },

Examples of virtualmachinestate objects

Hard power off

{"state": "OFF"}

Graceful shutdown

{state: "OFF", gracefulShutdown: true}

Power on

{"state": "ON"}

Pause

{"state": "PAUSED"}

Example of VM hard power off via API

To hard power off a VM using the API, perform a request like the one shown below.

 Click here to show or hide the request example

Unable to render {include} The included page could not be found.

The API will return a link where you can monitor the progress of this operation.

Example of failed graceful shutdown

To perform a graceful shutdown, your virtual machine will need to have guest extensions installed on it. After an operation completes, you can view the status of the task by performing a get request on the accepted request link. In this case, the graceful shutdown was not supported and failed. 

 Click here to show or hide the request example
{
   "links":[
      {
         "rel":"self",
         "href":"https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/tasks/8812ddf4-a372-40af-81ee-5f5d1e53454c"
      },
      {
         "rel":"parent",
         "href":"https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/tasks"
      },
      {
         "rel":"acknowledge",
         "href":"https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763/tasks/8812ddf4-a372-40af-81ee-5f5d1e53454c/action/ack"
      },
      {
         "title":"cloudadmin",
         "rel":"user",
         "type":"application/vnd.abiquo.user+json",
         "href":"https://38testing.bcn.abiquo.com:443/api/admin/enterprises/74/users/17"
      },
      {
         "title":"ABQ_5e57c34d-5dcb-482b-be0f-a78931f4abd0",
         "rel":"virtualmachine",
         "type":"application/vnd.abiquo.virtualmachine+json",
         "href":"https://38testing.bcn.abiquo.com:443/api/cloud/virtualdatacenters/55/virtualappliances/200/virtualmachines/1763"
      }
   ],
   "taskId":"8812ddf4-a372-40af-81ee-5f5d1e53454c",
   "userId":"17",
   "type":"SHUTDOWN",
   "ownerId":"1763",
   "state":"FINISHED_UNSUCCESSFULLY",
   "creationTimestamp":1458647896,
   "timestamp":1458647897,
   "jobs":{
      "links":[
      ],
      "collection":[
         {
            "links":[
            ],
            "id":"8812ddf4-a372-40af-81ee-5f5d1e53454c.191e44d9-74fa-453a-b7e0-596237618fcf",
            "parentTaskId":"8812ddf4-a372-40af-81ee-5f5d1e53454c",
            "type":"SHUTDOWN",
            "description":"Shutdown task's shutdown on virtual machine with id 1763",
            "state":"FAILED",
            "rollbackState":"ROLLBACK_DONE",
            "creationTimestamp":1458647896,
            "timestamp":1458647897
         }
      ]
   }
}

Reset a VM using the API

To reset a virtual machine using the API, use a POST request to the reset action link.

 Click here to expand...

API example removed: POST_cld_vdcs_X_vapps_X_vms_X_act_reset_AC_acrq_j
You can download the API examples archive from ABI38Confluence-space-export-152334-314.html.zip