Compare commits

..

1 Commits

Author SHA1 Message Date
MickLesk 65219d9469 host-migrate: add CIFS, logging, and export/import improvements
Enhance tools/pve/host-migrate.sh with several usability and reliability features:

- Add run logfile and mlog helper for traceability (writes /var/log/host-migrate-<ts>.log).
- Add CIFS/SMB share support to the location picker, auto-install cifs-utils, and mount CIFS shares for exports.
- Make export component selection more granular (pvecfg, network, hostid, dns, apt sources/keyrings, pkglist, cron, systemd, roothome, etc) and reorganize collection logic accordingly.
- Capture per-guest requirements (bridges and storages) into host/guest-requirements.info for import preflight checks.
- Generate bundle manifest with additional metadata (kernel, tool version, cluster flag) and produce sha256sums.txt; offer optional integrity verification on import.
- Add optional rsync/SSH push after export and install rsync if missing.
- Import-side: warn on architecture and cluster source, verify checksums, preflight missing bridges/storages, and allow package reinstallation from selection file.
- Add cleanup UI to manage and delete stored bundles.
- Various UI tweaks and messaging improvements, and minor safety/backups when restoring files.

These changes improve cross-host portability, provide better diagnostics, and make bundle management and restoration safer and more transparent.
2026-06-28 15:02:36 +02:00
3 changed files with 1253 additions and 9 deletions
+3 -5
View File
@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_version="${var_version:-12}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
@@ -60,9 +60,8 @@ function update_script() {
fi
$STD apt install -y build-essential "$pcre_pkg" libssl-dev zlib1g-dev
OPENRESTY_VERSION="1.29.2.5"
if [[ "$(cat ~/.openresty 2>/dev/null)" != "$OPENRESTY_VERSION" ]]; then
CLEAN_INSTALL=1 fetch_and_deploy_from_url "https://openresty.org/download/openresty-${OPENRESTY_VERSION}.tar.gz" "/opt/openresty"
if check_for_gh_release "openresty" "openresty/openresty"; then
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "openresty" "openresty/openresty" "prebuild" "${CHECK_UPDATE_RELEASE}" "/opt/openresty" "openresty-*.tar.gz"
msg_info "Building OpenResty"
cd /opt/openresty
@@ -78,7 +77,6 @@ function update_script() {
--with-stream_ssl_module
$STD make -j"$(nproc)"
$STD make install
echo "${OPENRESTY_VERSION}" >~/.openresty
rm -rf /opt/openresty
cat <<'EOF' >/lib/systemd/system/openresty.service
[Unit]
+2 -4
View File
@@ -18,7 +18,7 @@ $STD apt install -y \
apache2-utils \
logrotate \
build-essential \
libpcre2-dev \
libpcre3-dev \
libssl-dev \
zlib1g-dev \
git \
@@ -36,8 +36,7 @@ $STD /opt/certbot/bin/pip install certbot certbot-dns-cloudflare
ln -sf /opt/certbot/bin/certbot /usr/local/bin/certbot
msg_ok "Set up Certbot"
OPENRESTY_VERSION="1.29.2.5"
fetch_and_deploy_from_url "https://openresty.org/download/openresty-${OPENRESTY_VERSION}.tar.gz" "/opt/openresty"
fetch_and_deploy_gh_release "openresty" "openresty/openresty" "prebuild" "latest" "/opt/openresty" "openresty-*.tar.gz"
msg_info "Building OpenResty"
cd /opt/openresty
@@ -53,7 +52,6 @@ $STD ./configure \
--with-stream_ssl_module
$STD make -j"$(nproc)"
$STD make install
echo "${OPENRESTY_VERSION}" >~/.openresty
rm -rf /opt/openresty
cat <<'EOF' >/lib/systemd/system/openresty.service
File diff suppressed because it is too large Load Diff