[libvirt] virsh blockresize syntax is inconsistent with vol-resize and somewhat dangerous

Tim Small tim at seoss.co.uk
Thu Oct 24 15:19:18 UTC 2019


Hello,

virsh has two commands which can be used to resize block devices -
"blockresize" for volumes in use by and active guest, and "vol-resize"
for volumes which are not in use.

The vol-resize syntax allows to specify the size as a delta (increase or
decrease vs. the current size), and also refuses to shrink a volume
unless the "--shrink" argument is also passed.

Most other tools which can be used for block device resizing (outside of
libvirt) also have similar "--shrink" argument requirements when
reducing the size of an existing block device.  e.g. ceph requires
"--allow-shrink" when using the "rbd resize" command.

The lack of such a safety device makes "blockresize" a foot-gun (which I
recently found to great effect when I typoed the domain name to another
valid domain).

It seems I am not alone in making this error e.g.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902171

One possible solution would be to make a new command e.g. "domblkresize"
or perhaps "live-resize", which implement the "--shrink" and "--delta"
behaviour to make it consistent with "vol-resize" syntax, and mark the
"blockresize" command as deprecated in the documentation and help (so
that existing automation which depends on the current behaviour doesn't
break).

Any thoughts?  Should I open this as an RFE?

Thanks,

Tim.


-- 
South East Open Source Solutions Limited
Registered in England and Wales with company number 06134732.
Registered Office: 2 Powell Gardens, Redhill, Surrey, RH1 1TQ
VAT number: 900 6633 53  http://seoss.co.uk/ +44-(0)1273-808309




More information about the libvir-list mailing list