Closed jovial closed 5 years ago
IIRC the reason for resizing is that the previous 'upload' step simply replaced the volume with the image, and it ended up having the size of the image.
Can you verify that this isn't the case for raw volumes?
(venv-openstack) [verne@kef1c-cde-ucd0001 vm]$ sudo virsh vol-create-as --pool libvirt-storage --name delete_me --capacity 1GiB --format raw
(venv-openstack) [verne@kef1c-cde-ucd0001 vm]$ sudo virsh vol-info --pool libvirt-storage delete_me
Name: delete_me
Type: file
Capacity: 1.00 GiB
Allocation: 1.00 GiB
(venv-openstack) [verne@kef1c-cde-ucd0001 vm]$ dd if=/dev/zero of=/tmp/raw.img bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00210321 s, 499 MB/s
(venv-openstack) [verne@kef1c-cde-ucd0001 vm]$ sudo virsh vol-upload --pool libvirt-storage delete_me /tmp/raw.img
(venv-openstack) [verne@kef1c-cde-ucd0001 vm]$ sudo virsh vol-info --pool libvirt-storage delete_me
Name: delete_me
Type: file
Capacity: 1.00 GiB
Allocation: 1.00 GiB
Seems to stay at the same capacity.
Fixes #23. Not sure why we are resizing the volume when we just created it with a given capacity.