Skip to main content

VM Scaling

NetActuate supports two approaches to scaling your virtual machine infrastructure: vertical scaling (resizing a single VM) and horizontal autoscaling (adding or removing VMs automatically).

Vertical Scaling

Vertical scaling lets you increase or decrease the CPU and memory of an existing VM — with little to no downtime and no need to redeploy or migrate the instance.

How It Works

When a VM is created, it is configured with a maximum number of CPUs and memory it can scale to. You submit scaling requests through the API (portal UI support is planned).

  • CPU cores can be hot-added or removed without a reboot
  • RAM can be added live, but removing RAM may require a reboot

Every scaling event is recorded for billing purposes and reflected in your hourly usage.

Scaling Capabilities

ResourceScale UpScale DownLive (No Reboot)
CPUYes (up to 64 cores or host max)Yes (to base plan)Hot-add/remove supported
RAMYes (up to 512 GB or host max)Yes (to base plan, may require reboot)Hot-add supported only

API Endpoints

Get available scaling options:

GET /cloud/scaling/{mbpkgid}

Optional query parameters: min_ram, max_ram, min_cpus, max_cpus.

Response:

{
"options": [
{
"pkg_id": 1234,
"pkg_name": "VR32x32x100",
"ram": 8192,
"cpus": 4,
"must_reboot": false
}
]
}

Scale a VM:

POST /cloud/scale/{mbpkgid}
ParameterTypeRequiredDescription
pkg_idintegerYes (if pkg_name not provided)ID of the desired scaling package
pkg_namestringYes (if pkg_id not provided)Name of the desired scaling package
allow_rebootbooleanOptional (default: false)If true, VM can be rebooted to apply changes

Note: To discover available scaling options (including package IDs and whether a reboot is required), first call GET /cloud/scaling/{mbpkgid}.

Technical Details

  • Memory is added using DIMM devices. Due to hugepages and guest OS limitations, memory cannot always be removed live.

  • vCPU hotplug is supported via setvcpus. Guest OS must be configured to bring new CPUs online automatically. Example udev rule:

    ACTION=="add", SUBSYSTEM=="cpu", ATTR{online}=="0", ATTR{online}="1"
  • If memory removal fails live and rebooting is allowed, the system will automatically shut down and restart the VM with reduced memory.

Horizontal Autoscaling

Horizontal autoscaling automatically provisions or terminates VM instances based on CPU and network traffic thresholds. When combined with BGP and ECMP, new nodes are provisioned with upstream BGP sessions and immediately begin serving traffic.

How It Works

You define the base configuration for your autoscaling group — the OS image, plan, and scaling parameters. Scaling actions are triggered under two conditions:

  • Threshold-based scaling — CPU utilization or packets-per-second (PPS) exceeds or drops below your defined thresholds
  • Size-limit based scalingmin_instances or max_instances values are changed manually or programmatically

Upscaling

When usage exceeds your thresholds and the current node count is below max_instances:

  1. A new VM is created using your specified OS image
  2. Your SSH key is installed on the default user account
  3. A cloud-init script (if provided) is passed to the instance for bootstrapping
  4. If a bgp_group_id is specified, an upstream BGP session is created in the group and automatically advertised

Downscaling

When usage drops below your thresholds and the group size is above min_instances:

  • The most recently created nodes are terminated first
  • Downscaling will never reduce the group below min_instances

Note: Scaling events can also occur outside threshold evaluations. If max_instances is lowered, excess nodes are terminated. If min_instances is increased, additional instances are created to meet the new minimum.

Geographic Scaling

Autoscaling supports Anycast-based services across multiple locations. Each location is evaluated independently — a CPU spike in Europe only scales nodes in that region, not globally. This ensures your deployment scales proportionally to actual demand in each location.

Scaling Parameters

ParameterValueDescription
cpu_threshold0.0–1.0Average vCPU utilization across all provisioned vCPUs
pps_thresholdIntegerAverage ingress packets per second across all instances
target_ratio0.0–1.0Continue adding instances until usage is below target_ratio * threshold
downscale_ratio0.0–1.0Only terminate nodes if remaining usage stays above downscale_ratio * target_ratio * threshold
cooldown_hoursIntegerAfter upscaling, prevent downscaling for this many hours
upscale_hoursIntegerLookback window (hours) for CPU/PPS evaluation during upscaling
upscale_percentileIntegerPercentile of samples evaluated during the upscale window
downscale_hoursIntegerLookback window (hours) for CPU/PPS evaluation during downscaling
downscale_percentileIntegerPercentile of samples evaluated during the downscale window
package_idPlan IDCompute plan for new instances
min_instancesIntegerMinimum nodes to maintain
max_instancesIntegerMaximum nodes allowed

Instance Configuration

ParameterValueDescription
contract_idContract IDBilling contract for new instances
os_idCloud Image IDOS image for new VMs
ssh_key_idSSH Key IDSSH key installed on new instances
cloud_initStringCloud-init script for bootstrapping (supports dynamic templating)
bgp_group_idBGP Group IDBGP group for automatic upstream session creation

Need Help?

Contact support@netactuate.com or open a support ticket from the portal.