For the complete documentation index, see llms.txt. This page is also available as Markdown.

Modifying Autoscaling Volumes

Modifying an Autoscaling Volume

There are two options for modifying the size of an autoscaling volume:

  1. On EC2 - Use the Datafy modify API instead of the AWS modify API

  2. In Kubernetes - Edit the size of the PVC that the volume is associated with

After autoscaling has been deactivated for a volume, you can use the AWS ModifyVolume API directly. As always, a reboot is recommended after deactivation in order to ensure expected behavior, especially if also uninstalling AutoScaler.

Volumes Attached to EC2 Instances

Call the Datafy modify endpoint with the volume ID of the original volume managed by Datafy (as it appears in the Datafy app). You should call the Datafy API wherever you currently call the AWS ModifyVolume API.

The modify request will change the size of the volume. In order to provide your application with access to this new size you need to expand the filesystem as well:

  1. Manually - after the modification completes, resize the filesystem like you would any volume.

  2. Automatically - pass expandFilesystem=true in your modify request and the AutoScaler agent will expand the filesystem for you.

A success response means the request was accepted and the modify is in progress, check the size of the volume to confirm that it has completed successfully.

PVCs in Kubernetes

Datafy integrates directly with the Kubernetes CSI volume expansion flow. Resizing a PersistentVolumeClaim works exactly as it does for any other EBS-backed PVC - edit the PVC's spec.resources.requests.storage and the CSI driver applies the change. For autoscaling volumes, Datafy's CSI integration intercepts and handles the resize request.

No additional configuration is required beyond the standard Kubernetes prerequisites for PVC expansion (allowVolumeExpansion: true on the StorageClass).

Kubernetes retries failed expansion requests indefinitely until they succeed or the PVC's size is edited back. Errors from individual attempts are available in the CSI controller pod logs.

What Happens When A Volume's Size is Modified

Modifying the size of an autoscaling volume will increase its Original Size - the size the volume would be without Datafy, as shown in the Datafy app. The Current Size will change depending on the state of the volume:

  • If the volume's current size is smaller than its Original Size - Only the Original Size updates. The autoscaling logic will use the new Original Size as the maximum size when growing the volume as usage increases. In this state, no cooldown limitations apply, and you can modify the volume size at any time.

  • If the volume has already grown to its full size - The Original Size updates, and the current size increases to keep the volume at full size. This involves modifying the underlying Datafy volumes, so the AWS cooldown applies. A subsequent modify at full size will only succeed once the cooldown has elapsed, or after a shrink action (when the underlying volumes are replaced).

Interaction With Ongoing Actions

A modify request interrupts any ongoing autoscaling activation, deactivation, or shrink, so your size change is applied right away: AutoScaler stops the action mid-flight, then applies the modify. To resume the action after the modify completes:

  • Autoscaling Activation - the volume will return to a non-autoscaling state. Re-enable autoscaling by turning the AutoScale toggle on for the volume, or by clearing the exception from autoscaling rules if they apply to the volume.

  • Autoscaling Deactivation - the volume is still autoscaling. Deactivate autoscaling again with the AutoScale toggle or API.

  • Shrink - the volume stays at its pre-shrink Current Size. No action is needed, shrink will begin again automatically if conditions match.

Last updated

Was this helpful?