Skip to content

server: apply the restored volume max IOPS to the max IOPS field - #14024

Open
nagaboinaramgopal wants to merge 1 commit into
apache:mainfrom
nagaboinaramgopal:fix/volume-restore-maxiops
Open

server: apply the restored volume max IOPS to the max IOPS field#14024
nagaboinaramgopal wants to merge 1 commit into
apache:mainfrom
nagaboinaramgopal:fix/volume-restore-maxiops

Conversation

@nagaboinaramgopal

Copy link
Copy Markdown

Description

When a VM is restored, getRootVolumeSizeForVmRestore reads the requested min
and max IOPS from the volume details, but a copy-paste slip assigned the max
IOPS value into the min IOPS field:

if (StringUtils.isNumeric(maxIops)) {
    resizedVolume.setMinIops(Long.parseLong(maxIops));
}

So setMinIops was called twice and setMaxIops was never called. The result
is that restoring a VM silently drops the volume's max IOPS QoS setting and
overwrites min IOPS with the max value. Fixed by assigning the parsed max IOPS
to setMaxIops.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • Minor

How Has This Been Tested?

Added a unit test that restores a volume with min IOPS 500 and max IOPS 2000
and asserts each field holds its own value. Also built the standard packages
and deployed on a KVM advanced zone.

getRootVolumeSizeForVmRestore set the requested max IOPS onto the min IOPS
field, overwriting the min value and never applying the max, so restoring
a VM with an IOPS spec silently corrupted the volume QoS. Set the max IOPS
on the max IOPS field.

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants