Commit d4c9d940 authored by Vitaly Lipatov's avatar Vitaly Lipatov

pve: add pve-start.sh to start VM/CT by VMID

Resolves VMID to its node via cluster resources, dispatches to qm/pct depending on type, no-op if the resource is already running. Co-Authored-By: 's avatarClaude Opus 4.7 (1M context) <noreply@anthropic.com>
parent 652c3a06
#!/bin/sh
# Start VM or CT by VMID
# Usage: pve-start.sh VMID
set -e
MYDIR=$(dirname "$0")
. "$MYDIR/functions"
VMID="$1"
if [ -z "$VMID" ] ; then
echo "Usage: $(basename "$0") VMID" >&2
echo "Start a VM or CT in the PVE cluster." >&2
exit 1
fi
resolve_vmid "$VMID"
mgr=$(vm_mgr)
if [ "$RES_STATUS" = "running" ] ; then
log "$RES_TYPE $VMID ($RES_NAME) is already running on $RES_NODE"
exit 0
fi
log "Starting $RES_TYPE $VMID ($RES_NAME) on $RES_NODE ..."
vm_cmd "$mgr" start "$VMID"
log "Started."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment