vm-manager/brand/nebula-vm/uninstall.ksh
Till Wegmueller 9dc492f90f
Add vm-manager library and vmctl CLI
Unified VM management consolidating QEMU-KVM (Linux) and Propolis/bhyve
(illumos) backends behind an async Hypervisor trait, with a vmctl CLI for
direct use and a library API for orchestrators.

- Core library: types, async Hypervisor trait, miette diagnostic errors
- QEMU backend: direct process management, raw QMP client, QCOW2 overlays
- Propolis backend: zone-based VMM with REST API control
- Shared infra: cloud-init NoCloud ISO generation, image download/cache,
  SSH helpers with retry
- vmctl CLI: create, start, stop, destroy, list, status, console, ssh,
  suspend, resume, image pull/list/inspect
- nebula-vm zone brand: lifecycle scripts and platform/config XML for
  illumos zone integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 18:25:17 +01:00

29 lines
631 B
Bash

#!/bin/ksh
#
# nebula-vm brand: uninstall script
#
# Called by zoneadm(8) during zone uninstallation.
# Arguments: %z = zone name, %R = zone root
#
ZONENAME="$1"
ZONEROOT="$2"
if [[ -z "$ZONENAME" || -z "$ZONEROOT" ]]; then
echo "Usage: uninstall.ksh <zone-name> <zone-root>" >&2
exit 1
fi
echo "nebula-vm: uninstalling zone '${ZONENAME}'"
# Remove the zone root contents
if [[ -d "${ZONEROOT}/root" ]]; then
rm -rf "${ZONEROOT}/root"
echo "nebula-vm: zone root removed"
fi
# Remove the zone path itself if empty
rmdir "${ZONEROOT}" 2>/dev/null || true
echo "nebula-vm: zone '${ZONENAME}' uninstalled"
exit 0