I running following commands to create VM from CLI, however
It is always creating 10G of VM although image size for qm importdisk AlmaLinux-8.9-x86_64.qcow2 image is 2.4G.
I confirmed this disk image size after creation, its 10GB
What I wish is it import in original size then I can resize to my desired size using
How do I make sure that disk size is always equal to image size from which I am importing or atleast I can set disk size myself.
Code:
qm create 1001 --name AlmaLinux-8.9-x86-64 --cores 2 --memory 1024 --net0 virtio,bridge=vmbr0
qm importdisk 1001 AlmaLinux-8.9-x86_64.qcow2 local
It is always creating 10G of VM although image size for qm importdisk AlmaLinux-8.9-x86_64.qcow2 image is 2.4G.
Code:
importing disk 'AlmaLinux-8.9-x86_64.qcow2' to VM 1001 ...
Formatting '/var/lib/vz/images/1001/vm-1001-disk-0.raw', fmt=raw size=10737418240 preallocation=off
transferred 0.0 B of 10.0 GiB (0.00%)
transferred 103.4 MiB of 10.0 GiB (1.01%)
transferred 205.8 MiB of 10.0 GiB (2.01%)
...
...
I confirmed this disk image size after creation, its 10GB
Code:
-r--r--r-- 1 root root 10G Dec 15 18:34 vm-1001-disk-0.raw
What I wish is it import in original size then I can resize to my desired size using
qm resize
. How do I make sure that disk size is always equal to image size from which I am importing or atleast I can set disk size myself.