Skip to content

Can't downsize to the current size after failed volume upsize #4467

Description

@sebgl

The following situation happened to an Azure user:

  1. User resize their volume claims up
  2. Operator propagates the change to PVC & StatefulSet
  3. AKS can't resize the volume (see PVC resizing doesn't work as expected Azure/AKS#1477):
error expanding volume "elastic-system/elasticsearch-data-elastic-eck-es-data-0" of plugin "kubernetes.io/azure-disk": compute.DisksClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="OperationNotAllowed" Message="Cannot resize disk kubernetes-dynamic-pvc-cc190c75-488b-40f7-94ba-9ec8dc3b9e5c while it is attached to running VM /subscriptions/*****************/resourceGroups/******************/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool-93507671-vmss/virtualMachines/aks-agentpool-93507671-vmss_1. Resizing a disk of an Azure Virtual Machine requires the virtual machine to be deallocated. Please stop your VM and retry the operation."
  1. Users try to set back the initial size. This is rejected by the operator:
Failed to apply spec change: handle volume expansion: decreasing storage size is not supported: an attempt was made to decrease storage size for claim elasticsearch-data

At this point it's pretty hard for the user to figure out a way to get back to a clean state, since the StatefulSet has been recreated by ECK with the new size already.
Should the operator catch the PVC event error and allow a downsize to go through in that particular case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    >enhancementEnhancement of existing functionalitydiscussWe need to figure this out

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions