Resize VMs

Resizing changes an Azure server’s VM size in place, from the server’s own page or through the API

Resizing is a server action named Resize VM, which Cloud Management Platform (CMP) enables by default. It runs against Azure and AWS servers.

Which sizes are offered

An Azure VM size, such as Standard_D2s_v3, sets the CPUs, memory, and disk types available to a server. Not every size can be resized to any other size, and what is possible depends on where the VM is deployed. See Microsoft’s documentation on sizes for Azure virtual machines.

The resize dialog offers the sizes that are in both of two sets: the sizes Azure reports the VM can move to, and the sizes CMP already knows as values of the Node Size parameter. A size Azure allows but CMP has never imported does not appear, and neither does a size CMP knows but Azure will not accept for that VM.

Enable or disable the action

Resize VM is enabled when CMP is installed. To turn it off or back on:

  1. Go to Admin > Server Actions.
  2. Find Resize VM and set its enable toggle.

When enabled, the action appears in the server actions list on every Azure and AWS server page.

Resize a server

  1. Open the server and select Resize VM from its server actions.
  2. Select a New Size.
  3. Select Run.

CMP starts a job to resize the VM and then refreshes the server, so the CPU and memory values in the server overview reflect the new size once the job finishes.

Resize through the API

For general API usage, including authentication, see REST API.

Request a server to see the actions available on it, each with the URI that runs it:

curl -H "Authorization: Bearer [encrypted_token_value]" https://[cb_server]/api/v2/servers/[server_number]/

The response lists each action under _links:

{
  "_links": {
    "actions": [
      {
        "Resize VM": {
          "href": "/api/v2/servers/[server_number]/actions/2/",
          "title": "Run 'Resize VM' on '[server_hostname]'"
        }
      }
    ]
  }
}

Post the new size to the href given for Resize VM:

$ curl -XPOST -H 'Content-Type: application/json' \
  -d '{"new_size": "Standard_D2s_v3"}' \
  -H "Authorization: Bearer [encrypted_token_value]" \
  https://[cb_server]/api/v2/servers/[server_number]/actions/2/