mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-30 20:19:48 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
357c4ae119 |
No files matched your search
@@ -31,6 +31,8 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
ensure_dependencies cron
|
||||
|
||||
if check_for_gh_release "speedtest-tracker" "alexjustesen/speedtest-tracker"; then
|
||||
PHP_VERSION="8.4" PHP_FPM="YES" setup_php
|
||||
setup_composer
|
||||
|
||||
@@ -15,6 +15,7 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
cron \
|
||||
nginx \
|
||||
sqlite3
|
||||
setcap cap_net_raw+ep /bin/ping
|
||||
|
||||
@@ -181,7 +181,7 @@ fi
|
||||
msg_info "Creating a AllStarLink VM"
|
||||
qm create $VMID -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf${CPU_TYPE} -cores $CORE_COUNT -memory $RAM_SIZE \
|
||||
-name $HN -tags community-script,debian${var_version},radio -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
|
||||
vm_alloc_efi_disk "$DISK0"
|
||||
pvesm alloc $STORAGE $VMID $DISK0 4M 1>&/dev/null
|
||||
qm importdisk $VMID ${FILE} $STORAGE ${DISK_IMPORT:-} 1>&/dev/null
|
||||
qm set $VMID \
|
||||
-efidisk0 ${DISK0_REF}${FORMAT} \
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ fi
|
||||
msg_info "Creating an Alpine VM"
|
||||
qm create "$VMID" -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf${CPU_TYPE} -cores "$CORE_COUNT" -memory "$RAM_SIZE" \
|
||||
-name "$HN" -tags community-script -net0 virtio,bridge="$BRG",macaddr="$MAC""$VLAN""$MTU" -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
|
||||
vm_alloc_efi_disk "$DISK0"
|
||||
pvesm alloc "$STORAGE" "$VMID" "$DISK0" 4M 1>&/dev/null
|
||||
pvesm alloc "$STORAGE" "$VMID" "$DISK2" 4M 1>&/dev/null
|
||||
qm importdisk "$VMID" "$WORK_FILE" "$STORAGE" -format "$DISK_IMPORT_FORMAT" 1>&/dev/null
|
||||
qm set "$VMID" \
|
||||
|
||||
+3
-6
@@ -395,16 +395,14 @@ qm create $VMID -agent 1${MACHINE} -tablet 0 -bios ovmf${CPU_TYPE} -cores $CORE_
|
||||
-name $HN -tags community-script -net0 virtio,bridge=$BRG,macaddr=$MAC,firewall=0,queues=$CORE_COUNT$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
|
||||
vm_mark_created
|
||||
|
||||
# Retry on transient zfs_request "got timeout" errors (#14127)
|
||||
# Retry pvesm alloc on transient zfs_request "got timeout" errors (#14127)
|
||||
alloc_attempt=1
|
||||
alloc_max=4
|
||||
alloc_delay=5
|
||||
while :; do
|
||||
# Not in $( ): vm_alloc_efi_disk sets DISK0_REF to the volume Proxmox made.
|
||||
vm_alloc_efi_disk "$DISK0" 2>"/tmp/opnsense-efi-$$.err" && break
|
||||
alloc_err="$(<"/tmp/opnsense-efi-$$.err")"
|
||||
alloc_err=$(pvesm alloc $STORAGE $VMID $DISK0 4M 2>&1 >/dev/null) && break
|
||||
if [[ "$alloc_err" == *"got timeout"* && $alloc_attempt -lt $alloc_max ]]; then
|
||||
echo -e "${YW}[WARN]${CL} EFI disk allocation hit zfs timeout (attempt $alloc_attempt/$alloc_max), retrying in ${alloc_delay}s..."
|
||||
echo -e "${YW}[WARN]${CL} pvesm alloc hit zfs timeout (attempt $alloc_attempt/$alloc_max), retrying in ${alloc_delay}s..."
|
||||
pvesm free "${DISK0_REF}" &>/dev/null || true
|
||||
sleep "$alloc_delay"
|
||||
alloc_attempt=$((alloc_attempt + 1))
|
||||
@@ -414,7 +412,6 @@ while :; do
|
||||
msg_error "Could not allocate the EFI disk on ${STORAGE}: ${alloc_err}"
|
||||
exit 220
|
||||
done
|
||||
rm -f "/tmp/opnsense-efi-$$.err"
|
||||
vm_import_disk "$VMID" "$FILE" "$STORAGE"
|
||||
qm set $VMID \
|
||||
-efidisk0 ${DISK0_REF}${FORMAT} \
|
||||
|
||||
Reference in new issue
Block a user