Introduction to autoscaling
Abiquo 4.0 introduces horizontal autoscaling of virtual machines through scaling groups created for virtual machines. When a scaling event is triggered, Abiquo will follow the scaling rules of the scaling group. To scale out, it will clone the base virtual machine (with the template disk content) and deploy, and to scale in, it will delete clones or undeploy the base virtual machine.
To use autoscaling do these steps:
- Create a base virtual machine
- Define a scaling group for a base virtual machine, including scaling rules
- Create an action plan for the virtual machine with scaling actions
- Create scaling triggers, which are either monitoring alerts for virtual appliances or schedules for planned scaling
Autoscaling limitation
In version 4.0, Abiquo does not clone captured virtual machines, so you will need to create an instance and recreate the virtual machine from the resulting template to use autoscaling
Screenshot: Create scaling group
How does Abiquo clone the base virtual machine
Abiquo clones the base virtual machine and deploys the clones. Abiquo will not deploy other virtual machines in the scaling group if they are not deployed.
- To clone the base virtual machine, Abiquo will do the following steps
- Create disks using the following:
- Copies of content of disks from the VM template
- Empty disks or volumes for each additional disk used in the VM
- Disk controllers used in the VM
- Apply ALL configuration used in the VM, for example:
- CPU and RAM
- Network connections of the type (e.g. private network)
- Assign firewall policies and attach to load balancers
- Chef recipes, backups, cloud-init, variables, and so on
- Metrics. The group of metrics from clone machines and the base machine (if it is deployed) can activate alarms in the base machine
- Exception:
- Alarms for a scaling group are only configured in the base machine
Does the state of the base virtual machine make a difference
If the base virtual machine is not deployed, Abiquo will not deploy it. In order to add another virtual machine, Abiquo will clone the base machine and deploy the clone. If the base machine is deployed, Abiquo will count it as one of the active machines in the scaling group. As part of a scale in operation, Abiquo will delete clone machines but it will only undeploy the base machine. Note that if the base machine were deleted directly on the hypervisor, this would destroy the scaling group, whereas if the base machine is undeployed, the scaling group is not vulnerable to interference at the hypervisor level.
How do I prepare for autoscaling
Ensure that you have enough resources in their virtual datacenter to deploy up to the maximum number of cloned virtual machines. In particular, obtain enough available IP addresses of the same category to assign to clones, for example, by reserving public IP addresses, or by obtaining IP addresses in external networks, or creating private networks.
Create a scaling group
Abiquo supports horizontal autoscaling with virtual machine scaling groups.
Before you begin:
- Create and configure a base virtual machine. When a scaling event is triggered, Abiquo will clone this virtual machine according to your scaling rules. The base virtual machine can be deployed or undeployed, as appropriate
- Abiquo may undeploy the base machine but it will not delete it
To create a scaling group:
- In virtual appliance view, select the virtual machine, and from the menu on the virtual machine icon, select the Create scaling group option
- Enter the autoscaling parameters and rules
- Click Save
When you save the scaling group, Abiquo will mark the virtual machine icon with the scaling group symbol and display the scaling group name. If necessary, Abiquo will create clones of the base machine and deploy them in order to reach the minimum size. The number in the bottom right-hand corner of the icon is the number of running virtual machines in the scaling group, including the base machine.
Create triggers for autoscaling
To trigger autoscaling operations, you will need to create an action plan for the virtual machine with the autoscaling group, and then create triggers to run the action plan. Example of triggers are virtual appliance alerts or action plan schedules.
See Manage action plans and triggers
What happens during scaling?
When an autoscaling event is triggered, Abiquo will search for a scaling rule that is valid for the specific time range, or for a default rule. Abiquo will create or delete/undeploy the number of virtual machines for the scaling operation, then wait for the cooldown period before accepting another scaling request.
Scaling operations are managed by action plans and subject to all standard Abiquo constraints, such as privileges and allocation limits.
To scale in, Abiquo deletes and undeploys virtual machines without waiting for user confirmation to force the undeploy of virtual machines with disks that are not stored in the Apps library (ISO configuration drive or additional hard disk). Abiquo currently selects the virtual machines to delete or undeploy using first in, first out (FIFO), but in future releases the administrator will be able to select the scale in policy, from last in, first out (LIFO) or FIFO.
To scale out, Abiquo will always create new clones instead of deploying virtual machines that are undeployed, for example, machines that were manually undeployed during maintenance.
What are the constraints on VMs in a scaling group
When a virtual machine is part of a scaling group, Abiquo does not allow you to perform deploy or configuration operations on the virtual machine, unless you put the scaling group into maintenance mode.
You cannot create alarms for cloned virtual machines that are part of a scaling group. This is because Abiquo will automatically apply the metrics from the base machine, that will be considered in the activation of the alarms from the base machine.
How do metrics and alarms work with scaling groups?
Abiquo will automatically apply the same metrics configuration from the base machine to the clone machines. And Abiquo will automatically consider the metrics from all of the virtual machines as a group, and use these metrics to determine if the alarms in the base machine should activate. This means that even if the base machine is undeployed, an alarm in the base machine can still activate, based on the performance of the clone group.
What is maintenance mode
Maintenance mode temporarily disables autoscaling and enables you to make changes to your virtual machines, for example, to manually deploy or undeploy machines, or to edit the scaling group itself. Remember that if you manually undeploy virtual machines, Abiquo will not reuse them. Abiquo will always clone the base virtual machine to expand the scaling group.
Note that in maintenance mode you can undeploy the base virtual machine but you cannot delete it; to delete the base virtual machine, you will need to delete the scaling group.
When you leave maintenance mode, Abiquo will apply your modifications to the scaling group, e.g. adding new rules. Then Abiquo will adjust the number of virtual machines in the group to within the minimum and maximum size range.
Perform maintenance on the scaling group
To put the scaling group in maintenance mode:
- Click the "cog" maintenance button
- Trigger an action plan with the action "Scaling group: start maintenance mode"
You can now make changes to the scaling group:
- Open the scaling group
- Edit the scaling group, e.g. add new rules
- Reconfigure, deploy or undeploy the base machine or clone machines
- Delete clone machines
Remember that when you leave maintenance mode, Abiquo will adjust the number of virtual machines in the scaling group to within the maximum and minimum range, creating and deleting clones or undeploying the base machine, as appropriate.
To leave maintenance mode:
- Click the "cog" maintenance button again
- Trigger an action plan with the action "Scaling group: end maintenance mode".
Delete a scaling group
When you delete a scaling group, Abiquo will not destroy the virtual machines. It will place all the virtual machines in the virtual appliance as regular virtual machines and the scaling group constraints will no longer exist.
To delete a scaling group, first put it into maintenance mode, then click the delete button.