Compare commits

..

2 Commits

Author SHA1 Message Date
github-actions[bot] d4ca5c4650 Update CHANGELOG.md 2026-11-06 18:32:15 +00:00
CanbiZ (MickLesk) c5c406b392 OPNsense VM: size the temp space check to the unpacked image | say why the EFI disk could not be allocated (#18404)
* OPNsense VM: size the temp space check to the unpacked image

The script refused to run unless TEMP_DIR had 20 GB free, a figure left
over from when the download went there too. The download now goes to the
image cache and only the unpacked FreeBSD image (2.5 GB) lands in
TEMP_DIR, so hosts with 8 to 16 GB free in /tmp stopped with exit 214.
Check the size xz reports for the image instead.

* OPNsense VM: say why the EFI disk could not be allocated

pvesm's error went to stderr only, so the two exit 220 runs in telemetry
carry no reason. As msg_error it reaches the log and the trace, e.g.
"disk image '.../vm-969-disk-0.qcow2' already exists" after an earlier
run left its disk on a storage that qm destroy does not clean.

* Clean up comments in opnsense-vm.sh

Removed comments about image cache and size calculation.
2026-11-06 19:31:58 +01:00
3 changed files with 15 additions and 43 deletions
-27
View File
@@ -1,27 +0,0 @@
name: Check Script Repo URL
on:
pull_request:
branches: ["main"]
paths:
- "ct/**"
- "install/**"
- "vm/**"
- "tools/**"
permissions:
contents: read
jobs:
check:
if: github.repository == 'community-scripts/ProxmoxVE'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Reject DevScripts URLs
run: |
if grep -rnE 'community-scripts/(ProxmoxVED|DevScripts)/' ct install vm tools; then
echo "::error::These lines point at DevScripts, so telemetry files the runs there. Use community-scripts/ProxmoxVE."
exit 1
fi
+8 -1
View File
@@ -573,9 +573,16 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
## 2026-11-06
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- OPNsense VM: size the temp space check to the unpacked image | say why the EFI disk could not be allocated [@MickLesk](https://github.com/MickLesk) ([#18404](https://github.com/community-scripts/ProxmoxVE/pull/18404))
### 💾 Core
- fix: report a container that went down during setup, keep finished installs [@MickLesk](https://github.com/MickLesk) ([core#211](https://github.com/community-scripts/core/pull/211))
- fix: spot same-filesystem bind mounts on Alpine [@rcourtman](https://github.com/rcourtman) ([core#212](https://github.com/community-scripts/core/pull/212))
- fix: report a container that went down during setup, keep finished installs [@MickLesk](https://github.com/MickLesk) ([core#211](https://github.com/community-scripts/core/pull/211))
## 2026-11-05
+7 -15
View File
@@ -47,7 +47,7 @@ function check_disk_space() {
}
TEMP_DIR=$(mktemp -d)
if ! check_disk_space "$TEMP_DIR" 20 && [ -d "/var/tmp" ] && check_disk_space "/var/tmp" 20; then
if ! check_disk_space "$TEMP_DIR" 4 && [ -d "/var/tmp" ] && check_disk_space "/var/tmp" 4; then
rm -rf "$TEMP_DIR"
TEMP_DIR=$(mktemp -d /var/tmp/opnsense-vm.XXXXXX)
fi
@@ -364,15 +364,6 @@ FREEBSD_VER="$VM_INDEX_LATEST"
URL="$VM_INDEX_URL"
msg_ok "Download URL: ${CL}${BL}${URL}${CL}"
# Check available disk space (require at least 20GB for safety)
if ! check_disk_space "$TEMP_DIR" 20; then
AVAILABLE_GB=$(df -h "$TEMP_DIR" | awk 'NR==2 {print $4}')
msg_error "Insufficient disk space in temporary directory ($TEMP_DIR)."
msg_error "Available: ${AVAILABLE_GB}, Required: ~20GB for FreeBSD image decompression."
msg_error "Please free up space or ensure /tmp has sufficient storage."
exit 214
fi
msg_info "Downloading FreeBSD Image"
# A mirror serving an error page returns 200, so size decides whether this
# is an image. Anything real here is far above 5 MB.
@@ -381,11 +372,12 @@ vm_fetch_image "$URL" "$CACHE_FILE" --cache --verify-xz --min-bytes $((5 * 1024
echo -en "\e[1A\e[0K"
msg_ok "Downloaded ${CL}${BL}$(basename "$CACHE_FILE")${CL}"
# Check disk space again before decompression
if ! check_disk_space "$TEMP_DIR" 15; then
NEED_GB=$(($(xz --robot -l "$CACHE_FILE" | awk '$1 == "totals" {print $5}') / 1024 / 1024 / 1024 + 1))
if ! check_disk_space "$TEMP_DIR" "$NEED_GB"; then
AVAILABLE_GB=$(df -h "$TEMP_DIR" | awk 'NR==2 {print $4}')
msg_error "Insufficient disk space for decompression."
msg_error "Available: ${AVAILABLE_GB}, Required: ~15GB for decompressed image."
msg_error "Insufficient disk space for decompression in ${TEMP_DIR}."
msg_error "Available: ${AVAILABLE_GB}, Required: ~${NEED_GB}GB for the decompressed image."
msg_error "Please free up space or ensure /tmp or /var/tmp has sufficient storage."
exit 214
fi
@@ -417,7 +409,7 @@ while :; do
alloc_delay=$((alloc_delay * 2))
continue
fi
echo -e "$alloc_err" >&2
msg_error "Could not allocate the EFI disk on ${STORAGE}: ${alloc_err}"
exit 220
done
vm_import_disk "$VMID" "$FILE" "$STORAGE"