我在KVM主机上安装了这个设置:
virsh # pool-info --pool pool Name: pool UUID: bb13c37c-47fe-c4a9-78a4-9c8abc7524fe State: running Persistent: yes Autostart: yes Capacity: 1.64 TiB Allocation: 712.00 GiB Available: 963.12 GiB virsh # vol-list --details --pool pool Name Path Type Capacity Allocation --------------------------------------------------------------------------------- volume1 /dev/pool/volume1 block 192.00 GiB 192.00 GiB volume2 /dev/pool/volume2 block 192.00 GiB 192.00 GiB volume3 /dev/pool/volume3 block 192.00 GiB 192.00 GiB volume4 /dev/pool/volume4 block 136.00 GiB 136.00 GiB virsh # vol-info --pool pool volume3 Name: volume3 Type: block Capacity: 192.00 GiB Allocation: 192.00 GiB
我有一个运行在volume3的虚拟机,磁盘快满了。 在虚拟机上扩展磁盘之前,我想我必须扩展底层的卷。
但是当我尝试将volume3扩展到500GB时,出现以下错误:
virsh # vol-resize volume3 --capacity 500G --pool pool --allocate error: Failed to change size of volume 'volume3' to 500G error: invalid argument: storageVolumeResize: unsupported flags (0x1)
当我尝试扩展音量而未分配空间时,出现不同的错误:
virsh vol-resize volume3 --capacity 500G --pool pool error: Failed to change size of volume 'volume3' to 500G error: this function is not supported by the connection driver: storage pool does not support changing of volume capacity
有任何想法吗?
编辑:我也试过阻挡,没有改变:
virsh # blockresize volume3 /dev/pool/volume3 734003200 error: Failed to resize block device '/dev/pool/volume3' error: internal error unable to execute QEMU command 'block_resize': An undefined error has occurred
首先,你需要使用lvresize命令来调整块设备的大小,然后你需要告诉libvirt关于新的大小。
你应该可以这样做:
$ lvresize -L 500G /dev/pool/volume3 $ virsh blockresize volumes3 --path /dev/pool/volume3 --size 500G