You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current state (vm-bhyve 1.5), vm created from a cloud image have a disk whose size is the virtual size of the cloud image size.
For example:
vm img https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
vm create -i ubuntu-22.04-server-cloudimg-amd64.img -s 100G
This creates a VM whose disk is 2.2GB, which is the virtual size of the Ubuntu cloud image (check with qemu-img info <vm-path>/.img/ubuntu-22.04-server-cloudimg-amd64.img), even though we expect a VM with a 100GB disk.
One way to fix this would be to use qemu-img resize. But since we probably do not want to touch the original image, would it be acceptable to modify core::write_img to:
Copy $_imgpath to ${img_path}.tmp.
Call qemu-img resize ${img_path}.tmp $_size.
Run qemu-img dd on the temporary image.
Delete the temporary image.
Of course it would mean extra disk usage during the operation. I do not think this is a huge deal, but someone may have a better idea.
I can write the patch if maintainers (who are they?) agree.
The text was updated successfully, but these errors were encountered:
I just ran into this as well with some of my testing. I had this issue while using the default value for disk0_dev=file in my template. This does not seem to be an issue for disk0_dev=sparse-zvol or disk0_dev=zvol which still honor disk0_size.
Simplest way Ive been able to reproduce this behavior was to manually do what the vm create command does when disk0_dev=file in a template.
Starting with my raw image:
~ # ls -lah myimage.img
-rw-r--r-- 1 root wheel 2.4G Dec 29 09:40 myimage.img
Create the disk:
~ # truncate -s 10G disk0
~ # ls -lah disk0
-rw-r--r-- 1 root wheel 10G Dec 29 09:15 disk0
Write the image to it:
~ # qemu-img dd -O raw if=myimage.img of=./disk0 bs=1M
~ # ls -lah disk0
-rw-r--r-- 1 root wheel 2.4G Dec 29 09:39 disk0
In the current state (vm-bhyve 1.5), vm created from a cloud image have a disk whose size is the virtual size of the cloud image size.
For example:
This creates a VM whose disk is 2.2GB, which is the virtual size of the Ubuntu cloud image (check with
qemu-img info <vm-path>/.img/ubuntu-22.04-server-cloudimg-amd64.img
), even though we expect a VM with a 100GB disk.One way to fix this would be to use
qemu-img resize
. But since we probably do not want to touch the original image, would it be acceptable to modifycore::write_img
to:$_imgpath
to${img_path}.tmp
.qemu-img resize ${img_path}.tmp $_size
.qemu-img dd
on the temporary image.Of course it would mean extra disk usage during the operation. I do not think this is a huge deal, but someone may have a better idea.
I can write the patch if maintainers (who are they?) agree.
The text was updated successfully, but these errors were encountered: