[SOLVED] How to create a virtual machine on a ZFS storage device from the command line?

al.semenenko88

Renowned Member
Dec 25, 2017
26
0
66
37
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
data 418G 241G 144K /data
data/subvol-2109-disk-0 430M 15.6G 430M /data/subvol-2109-disk-0
data/vm-2026-disk-0 3.07M 241G 76K -
data/vm-2026-disk-1 130G 241G 114G -

# qm create 2114 --name "mail-test" --memory 2048 --cores 2 --ostype l26 --scsi0 data:vm-2114-disk-0,size=10G --net0 model=e1000,bridge=vmbr0,macaddr=00:50:56:92:7f:6a --scsihw virtio-scsi-pci
unable to create VM 2114 - timeout: no zvol device link for 'vm-2114-disk-0' found after 300 sec.

Do I need to create a volume first?

That doesn't work either:
# qm create 2114 --name "mail-test" --memory 2048 --cores 2 --ostype l26 --scsi0 data:10G --net0 model=e1000,bridge=vmbr0,macaddr=00:50:56:92:7f:6a --scsihw virtio-scsi-pci
unable to parse zfs volume name '10G'
 
The correct command is:

# qm create 2114 --name "mail-test" --memory 2048 --cores 2 --ostype l26 --scsi0 data:10 --net0 model=e1000,bridge=vmbr0,macaddr=00:50:56:92:7f:6a --scsihw virtio-scsi-pci
 
unable to create VM 2114 - timeout: no zvol device link for 'vm-2114-disk-0' found after 300 sec.

Do I need to create a volume first?
If you want to create new volume as part of VM creation, you specified the syntax wrong, from "man qm":
Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
It should be: data:vm-2114-disk-0:10

That doesn't work either:
# qm create 2114 --name "mail-test" --memory 2048 --cores 2 --ostype l26 --scsi0 data:10G
The command only accepts numerical value, G is implied.



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
If you want to create new volume as part of VM creation, you specified the syntax wrong, from "man qm":
Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
It should be: data:vm-2114-disk-0:10


The command only accepts numerical value, G is implied.



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Thanks, it worked!