Create empty EFI disk then import #61

Sometimes pvesm will timeout when running `pvesm alloc` against ZFS pool
This commit is contained in:
whiskerz007 2020-08-17 08:47:43 +02:00
parent 4410a19133
commit 50c639216a
No known key found for this signature in database
GPG Key ID: A7EEAB6E1F1A6805

View File

@ -133,9 +133,11 @@ msg "Creating VM..."
VM_NAME=$(sed -e "s/\_//g" -e "s/.${RELEASE_EXT}//" <<< $FILE) VM_NAME=$(sed -e "s/\_//g" -e "s/.${RELEASE_EXT}//" <<< $FILE)
qm create $VMID -agent 1 -bios ovmf -name $VM_NAME -net0 virtio,bridge=vmbr0 \ qm create $VMID -agent 1 -bios ovmf -name $VM_NAME -net0 virtio,bridge=vmbr0 \
-onboot 1 -ostype l26 -scsihw virtio-scsi-pci -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
pvesm alloc $STORAGE $VMID $DISK0 128 1>&/dev/null EFI_SIZE=128K
truncate -s $EFI_SIZE efi
qm importdisk $VMID efi $STORAGE ${IMPORT_OPT:-} 1>&/dev/null
qm importdisk $VMID ${FILE%".gz"} $STORAGE ${IMPORT_OPT:-} 1>&/dev/null qm importdisk $VMID ${FILE%".gz"} $STORAGE ${IMPORT_OPT:-} 1>&/dev/null
qm set $VMID -bootdisk sata0 -efidisk0 ${DISK0_REF},size=128K \ qm set $VMID -bootdisk sata0 -efidisk0 ${DISK0_REF},size=$EFI_SIZE \
-sata0 ${DISK1_REF},size=6G > /dev/null -sata0 ${DISK1_REF},size=6G > /dev/null
# Add serial port and enable console output # Add serial port and enable console output