style: normalizare CRLF -> LF pentru scripturile shell

Doar line endings, zero modificari de continut (verificat cu
git diff --ignore-cr-at-eol: fara diferente ramase pe aceste fisiere).

Fisierele aveau CRLF comis efectiv in repo, nu doar in working tree.
Sunt scripturi care ruleaza pe Linux (migrarea Oracle, LXC 171 claude-agent),
iar deployate direct din working tree bash le refuza cu
"$'\r': command not found" - exact capcana pe care .gitattributes (comis in
9475842) o previne de acum inainte pentru fisierele noi.

Nu sunt incluse fisierele .md/.sql din roa-windows-setup: acelea au
modificari reale de continut, in curs, si apartin altui commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BhQBTegE4PiMPPaapLHjkc
This commit is contained in:
Marius
2026-08-08 17:39:15 +03:00
parent 015cd797a1
commit 3b6a7b9d31
15 changed files with 2608 additions and 2608 deletions

View File

@@ -1,212 +1,212 @@
#!/bin/bash
# =============================================================================
# Clone VM 300 (Windows 11 Template) for Oracle Testing
# =============================================================================
#
# Purpose: Create a test VM for Oracle installation testing
#
# Usage:
# ./clone-vm300.sh [TARGET_VMID] [TARGET_NAME]
#
# Examples:
# ./clone-vm300.sh # Creates VM 301 named oracle-test-301
# ./clone-vm300.sh 305 # Creates VM 305 named oracle-test-305
# ./clone-vm300.sh 310 roa-prod # Creates VM 310 named roa-prod
#
# Prerequisites:
# - Run on Proxmox host (pvemini, pve1, or pveelite)
# - VM 300 exists as Windows 11 template
# - Sufficient storage space (~50GB per clone)
#
# =============================================================================
set -e
# -----------------------------------------------------------------------------
# Configuration
# -----------------------------------------------------------------------------
SOURCE_VMID=300
TARGET_VMID=${1:-301}
TARGET_NAME=${2:-"oracle-test-${TARGET_VMID}"}
# Storage for new VM (change if needed)
TARGET_STORAGE="local-zfs"
# Node where to create the VM (empty = same as source)
TARGET_NODE=""
# Full clone (true) or linked clone (false)
FULL_CLONE=true
# Start VM after creation
AUTO_START=true
# Description for the new VM
DESCRIPTION="Oracle 21c Test VM - Created $(date '+%Y-%m-%d %H:%M')"
# -----------------------------------------------------------------------------
# Validation
# -----------------------------------------------------------------------------
echo "=============================================="
echo "Proxmox VM Clone Script"
echo "=============================================="
echo ""
echo "Source VM: $SOURCE_VMID"
echo "Target VM: $TARGET_VMID"
echo "Target Name: $TARGET_NAME"
echo "Full Clone: $FULL_CLONE"
echo "Auto Start: $AUTO_START"
echo ""
# Check if running on Proxmox
if ! command -v qm &> /dev/null; then
echo "ERROR: This script must be run on a Proxmox host"
echo " (qm command not found)"
exit 1
fi
# Check if source VM exists
if ! qm status $SOURCE_VMID &> /dev/null; then
echo "ERROR: Source VM $SOURCE_VMID does not exist"
exit 1
fi
# Check if target VMID is already in use
if qm status $TARGET_VMID &> /dev/null 2>&1; then
echo "ERROR: Target VMID $TARGET_VMID already exists"
echo " Choose a different VMID or remove existing VM:"
echo " qm destroy $TARGET_VMID"
exit 1
fi
# Confirm before proceeding
read -p "Proceed with cloning? [y/N] " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted."
exit 0
fi
# -----------------------------------------------------------------------------
# Clone VM
# -----------------------------------------------------------------------------
echo ""
echo "Creating clone..."
CLONE_CMD="qm clone $SOURCE_VMID $TARGET_VMID --name $TARGET_NAME"
if [ "$FULL_CLONE" = true ]; then
CLONE_CMD="$CLONE_CMD --full"
fi
if [ -n "$TARGET_STORAGE" ]; then
CLONE_CMD="$CLONE_CMD --storage $TARGET_STORAGE"
fi
if [ -n "$TARGET_NODE" ]; then
CLONE_CMD="$CLONE_CMD --target $TARGET_NODE"
fi
echo "Running: $CLONE_CMD"
eval $CLONE_CMD
echo "Clone created successfully"
# -----------------------------------------------------------------------------
# Configure VM
# -----------------------------------------------------------------------------
echo ""
echo "Configuring VM..."
# Set description
qm set $TARGET_VMID --description "$DESCRIPTION"
# Optionally increase resources for Oracle
# qm set $TARGET_VMID --memory 8192 --cores 4
echo "VM configured"
# -----------------------------------------------------------------------------
# Start VM
# -----------------------------------------------------------------------------
if [ "$AUTO_START" = true ]; then
echo ""
echo "Starting VM..."
qm start $TARGET_VMID
# Wait for VM to start
sleep 5
# Check status
STATUS=$(qm status $TARGET_VMID | awk '{print $2}')
echo "VM Status: $STATUS"
fi
# -----------------------------------------------------------------------------
# Output Summary
# -----------------------------------------------------------------------------
echo ""
echo "=============================================="
echo "VM Clone Complete"
echo "=============================================="
echo ""
echo "VMID: $TARGET_VMID"
echo "Name: $TARGET_NAME"
echo "Status: $(qm status $TARGET_VMID | awk '{print $2}')"
echo ""
echo "Console URL: https://$(hostname -I | awk '{print $1}'):8006/#v1:0:=qemu%2F${TARGET_VMID}:4::::::"
echo ""
echo "Next steps:"
echo " 1. Connect to VM console"
echo " 2. Complete Windows OOBE if needed"
echo " 3. Install Oracle 21c XE or SE"
echo " 4. Run ROA setup scripts"
echo ""
echo "To delete this VM when done:"
echo " qm stop $TARGET_VMID"
echo " qm destroy $TARGET_VMID"
echo ""
# -----------------------------------------------------------------------------
# Helper Commands
# -----------------------------------------------------------------------------
# Print helpful commands
cat << 'COMMANDS'
# Useful Proxmox commands:
# List all VMs
qm list
# VM status
qm status TARGET_VMID
# Start/Stop/Restart VM
qm start TARGET_VMID
qm stop TARGET_VMID
qm restart TARGET_VMID
# Access VM console
qm terminal TARGET_VMID
# Clone with different storage
qm clone 300 TARGET_VMID --name NAME --full --storage local-lvm
# Snapshot before testing
qm snapshot TARGET_VMID snap-before-oracle --description "Before Oracle install"
# Rollback to snapshot
qm rollback TARGET_VMID snap-before-oracle
# Delete VM
qm stop TARGET_VMID && qm destroy TARGET_VMID
COMMANDS
exit 0
#!/bin/bash
# =============================================================================
# Clone VM 300 (Windows 11 Template) for Oracle Testing
# =============================================================================
#
# Purpose: Create a test VM for Oracle installation testing
#
# Usage:
# ./clone-vm300.sh [TARGET_VMID] [TARGET_NAME]
#
# Examples:
# ./clone-vm300.sh # Creates VM 301 named oracle-test-301
# ./clone-vm300.sh 305 # Creates VM 305 named oracle-test-305
# ./clone-vm300.sh 310 roa-prod # Creates VM 310 named roa-prod
#
# Prerequisites:
# - Run on Proxmox host (pvemini, pve1, or pveelite)
# - VM 300 exists as Windows 11 template
# - Sufficient storage space (~50GB per clone)
#
# =============================================================================
set -e
# -----------------------------------------------------------------------------
# Configuration
# -----------------------------------------------------------------------------
SOURCE_VMID=300
TARGET_VMID=${1:-301}
TARGET_NAME=${2:-"oracle-test-${TARGET_VMID}"}
# Storage for new VM (change if needed)
TARGET_STORAGE="local-zfs"
# Node where to create the VM (empty = same as source)
TARGET_NODE=""
# Full clone (true) or linked clone (false)
FULL_CLONE=true
# Start VM after creation
AUTO_START=true
# Description for the new VM
DESCRIPTION="Oracle 21c Test VM - Created $(date '+%Y-%m-%d %H:%M')"
# -----------------------------------------------------------------------------
# Validation
# -----------------------------------------------------------------------------
echo "=============================================="
echo "Proxmox VM Clone Script"
echo "=============================================="
echo ""
echo "Source VM: $SOURCE_VMID"
echo "Target VM: $TARGET_VMID"
echo "Target Name: $TARGET_NAME"
echo "Full Clone: $FULL_CLONE"
echo "Auto Start: $AUTO_START"
echo ""
# Check if running on Proxmox
if ! command -v qm &> /dev/null; then
echo "ERROR: This script must be run on a Proxmox host"
echo " (qm command not found)"
exit 1
fi
# Check if source VM exists
if ! qm status $SOURCE_VMID &> /dev/null; then
echo "ERROR: Source VM $SOURCE_VMID does not exist"
exit 1
fi
# Check if target VMID is already in use
if qm status $TARGET_VMID &> /dev/null 2>&1; then
echo "ERROR: Target VMID $TARGET_VMID already exists"
echo " Choose a different VMID or remove existing VM:"
echo " qm destroy $TARGET_VMID"
exit 1
fi
# Confirm before proceeding
read -p "Proceed with cloning? [y/N] " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted."
exit 0
fi
# -----------------------------------------------------------------------------
# Clone VM
# -----------------------------------------------------------------------------
echo ""
echo "Creating clone..."
CLONE_CMD="qm clone $SOURCE_VMID $TARGET_VMID --name $TARGET_NAME"
if [ "$FULL_CLONE" = true ]; then
CLONE_CMD="$CLONE_CMD --full"
fi
if [ -n "$TARGET_STORAGE" ]; then
CLONE_CMD="$CLONE_CMD --storage $TARGET_STORAGE"
fi
if [ -n "$TARGET_NODE" ]; then
CLONE_CMD="$CLONE_CMD --target $TARGET_NODE"
fi
echo "Running: $CLONE_CMD"
eval $CLONE_CMD
echo "Clone created successfully"
# -----------------------------------------------------------------------------
# Configure VM
# -----------------------------------------------------------------------------
echo ""
echo "Configuring VM..."
# Set description
qm set $TARGET_VMID --description "$DESCRIPTION"
# Optionally increase resources for Oracle
# qm set $TARGET_VMID --memory 8192 --cores 4
echo "VM configured"
# -----------------------------------------------------------------------------
# Start VM
# -----------------------------------------------------------------------------
if [ "$AUTO_START" = true ]; then
echo ""
echo "Starting VM..."
qm start $TARGET_VMID
# Wait for VM to start
sleep 5
# Check status
STATUS=$(qm status $TARGET_VMID | awk '{print $2}')
echo "VM Status: $STATUS"
fi
# -----------------------------------------------------------------------------
# Output Summary
# -----------------------------------------------------------------------------
echo ""
echo "=============================================="
echo "VM Clone Complete"
echo "=============================================="
echo ""
echo "VMID: $TARGET_VMID"
echo "Name: $TARGET_NAME"
echo "Status: $(qm status $TARGET_VMID | awk '{print $2}')"
echo ""
echo "Console URL: https://$(hostname -I | awk '{print $1}'):8006/#v1:0:=qemu%2F${TARGET_VMID}:4::::::"
echo ""
echo "Next steps:"
echo " 1. Connect to VM console"
echo " 2. Complete Windows OOBE if needed"
echo " 3. Install Oracle 21c XE or SE"
echo " 4. Run ROA setup scripts"
echo ""
echo "To delete this VM when done:"
echo " qm stop $TARGET_VMID"
echo " qm destroy $TARGET_VMID"
echo ""
# -----------------------------------------------------------------------------
# Helper Commands
# -----------------------------------------------------------------------------
# Print helpful commands
cat << 'COMMANDS'
# Useful Proxmox commands:
# List all VMs
qm list
# VM status
qm status TARGET_VMID
# Start/Stop/Restart VM
qm start TARGET_VMID
qm stop TARGET_VMID
qm restart TARGET_VMID
# Access VM console
qm terminal TARGET_VMID
# Clone with different storage
qm clone 300 TARGET_VMID --name NAME --full --storage local-lvm
# Snapshot before testing
qm snapshot TARGET_VMID snap-before-oracle --description "Before Oracle install"
# Rollback to snapshot
qm rollback TARGET_VMID snap-before-oracle
# Delete VM
qm stop TARGET_VMID && qm destroy TARGET_VMID
COMMANDS
exit 0