How to: Schedule Azure AWS GCE VMs to Resize

This feature is in beta however has been tested to be stable with AWS, Azure and GCE

Most cloud platforms like Azure and AWS have auto-scale features. Typically this is used by a fleet of Virtual Machines, like web-facing servers, to scale or shrink horizontally.

Horizontal Scaling?

Horizontal scaling is a method of scaling compute resources by adding more nodes into a cluster of VMs. This works well for web servers which can receive variable amounts of traffic depending on users.

Typically you can configure autoscale easily on your native cloud platform and works best with tasks that can easily be split up between computers. This is the case for web services.

Vertical Scaling?

Vertical scaling as you might guess is increasing the compute capacity of a single VM. Typically the term used in cloud providers is 'resizing'.

So for example resizing an AWS VM from a t2.micro to a g1.large would be vertical scaling. Cloud providers don't offer an easy way to schedule when VMs have a particular size.

Example: CI Server

Most development teams have these servers either running Jenkins, Drone or another continuous integration (CI) platform. During off hours, builds become less frequent, however you probably need to have the CI service running for engineers that may be working late hours.

Instead of leaving a g1.large instance running overnight or on the weekend, VMPower can automatically resize this VM with a downtime of only a couple minutes (depending on your cloud providers allocation/deallocate/resize speeds).

From our research here are the approximate downtimes of a resize to a running VM by platform:

  • AWS 2 Minutes
  • GCE 1 - 2 Minutes
  • Azure 2 - 3 Minutes

How to Schedule a VM to Resize

Step 1 Create a VM Group:

VM Groups are how VMPower logically groups VMs. This allows VMPower to act on batches of VMs. These groups can contain VMs from any subscription, including VMs from different cloud vendors!

VM Group create animation

Step 2 Create a VM Schedule:

Go to the VM Groups tab on the left hand side and click the 'Edit or Create Schedule' button:

VM Group create animation

Step 3 Create a Resize Event:

The calendar presented to you represents a weekly schedule of actions to take on the VMs within the VM Group. Click on the calendar to drop a recurring VM Event. These events are 30 minute blocks of time for VMPower to either power on, off or resize the VMs in the group.

By default the event will be a POWER OFF event:

VM Scheduler event dropped on calendar

Step 4 Change to a Resize Event:

Click on the event to change the event type and click OK:

Select VM Action Type

Step 5 Select the VM types to resize to:

You'll now get the Resize Schedule dialog. VMPower automatically detects the possible resizable VMs given your current VM type, cloud provider and datacenter region. In addition, VMPower calculates the monthly additional cost or savings based on the region and cloud provider of the VM to resize.

Select the desired target VM size and click 'Schedule Resizes':

Schedule VM Dialog animation

Step 6 Save the schedule:

You'll now see the Resize VM event on the calendar. You can drag and drop this resize event at any 1/2 hour slot during the week. Click 'Create Schedule' (or 'Update Schedule' if you are modifying an existing schedule):

Resize event on calendar


Now you have a recurring weekly automation of VM resizing. You can resize, power on or off as often as you'd like every week.

If your cloud application can stand to go down for 2-3 minutes, it may be worth scheduling VM resizes as a way to save money during times of the week you don't need as much compute power.

Resize events will always return a VM back to its original state. So if your VM is running before the resize event, it will be turned off, resized and turned back on again. Otherwise if it was off before the resize the VM simply remains off.

You can always mix and match VM POWER ON, POWER OFF and RESIZE events all on the same schedule.