churchers / vm-bhyve

Shell based, minimal dependency bhyve manager
BSD 2-Clause "Simplified" License
825 stars 174 forks source link

how to provision an image with custom disk size #527

Open nbari opened 1 year ago

nbari commented 1 year ago

I am creating an image with:

vm image create -d  "base image" <name of VM>

And for provisioning:

vm image provision <uid> <name of vm>

The problem that I have is that if the image was created with a disk of 200GB for example, all the new images that I provision have a disk of the same size, therefore wondering how to adjust the size when creating/provisioning the images

okalm commented 1 year ago

Have you tried the flag -s ? (from the file /vm/.templates/config.sample) It can be something like this: vm image create -d "base image" my_vm -s 50G

nbari commented 1 year ago

Hi, doesn't work, I think is expected otherwise you could truncate/corrupt the images, I think is easy to create a base image and then via ZFS only increase it from the host

okalm commented 1 year ago

I think is expected otherwise you could truncate/corrupt the images

Indeed it makes sense.

I think is easy to create a base image and then via ZFS only increase it from the host

Can't tell, but let us know if it works.