Hello, I want to create a vm using the script, but an error occurs:
Script:
I don't know what caused it and how to fix it. Help me, pls
Code:
unable to create VM 300 - can't activate LV '/dev/pve/vm-300-disk-0': Failed to find logical volume "pve/vm-300-disk-0"
Logical volume "vm-300-disk-0" created.
successfully created 'ssd:vm-300-disk-0'
Script:
Code:
# set vm id
id=300
# create image directory, download and uncomporess
mkdir -p /var/lib/vz/images/${id}
curl --location https://github.com/pocopico/tinycore-redpill/releases/download/v0.9.4.0/tinycore-redpill.v0.9.4.0.img.gz --output /var/lib/vz/images/${id}/tinycore-redpill.v0.9.4.0.img.gz
gzip --decompress /var/lib/vz/images/${id}/tinycore-redpill.v0.9.4.0.img.gz --keep
# create vm
qm create ${id} \
--args "-drive 'if=none,id=synoboot,format=raw,file=/var/lib/vz/images/${id}/tinycore-redpill.v0.9.4.0.img' -device 'qemu-xhci,addr=0x18' -device 'usb-storage,drive=synoboot,bootindex=5'" \
--cores 2 \
--cpu host \
--machine q35 \
--memory 2048 \
--name DSM \
--net0 virtio,bridge=vmbr11 \
--numa 0 \
--onboot 0 \
--ostype l26 \
--scsihw virtio-scsi-pci \
--sata0 ssd:vm-${id}-disk-0,discard=on,size=100G,ssd=1 \
--sockets 1 \
--serial0 socket \
--serial1 socket \
--tablet 1
# create disk for sata0
pvesm alloc ssd ${id} vm-${id}-disk-0 100G
I don't know what caused it and how to fix it. Help me, pls