# Proxmox VE Configuration
# Copy this file to proxmox.conf and update with your values

# Proxmox Host Connection
PROXMOX_HOST="proxmox.example.com"
PROXMOX_PORT="8006"
PROXMOX_USER="root@pam"

# API Token (recommended) or use password
PROXMOX_TOKEN_NAME="smom-dbis-138-token"
PROXMOX_TOKEN_SECRET="your-token-secret-here"

# Alternative: Use password (less secure, not recommended)
# PROXMOX_PASSWORD="your-password"

# Proxmox Node (default, can be overridden per-container)
PROXMOX_NODE="pve"

# Multi-Node Configuration (for cluster deployments)
# List all available nodes (comma-separated)
PROXMOX_NODES="pve,pve2,pve3"

# Node assignment strategy: auto, round-robin, manual
NODE_ASSIGNMENT_STRATEGY="auto"

# Storage Configuration
# Primary storage for containers
PROXMOX_STORAGE="local-lvm"

# Alternative storage pools (comma-separated, for multi-storage)
PROXMOX_STORAGE_POOLS="local-lvm,local-zfs,shared-storage"

# Backup storage
PROXMOX_BACKUP_STORAGE="local"

# Storage expansion settings
STORAGE_EXPANSION_ENABLED="true"
STORAGE_ALERT_THRESHOLD="80"  # Alert when storage usage exceeds 80%
STORAGE_EXPANSION_INCREMENT="50"  # Default expansion increment in GB

# Thin Pool Protection Settings
# Enable protection against thin pools running out of space
# Run: ./scripts/manage/enable-thin-pool-protection.sh
# This configures LVM to automatically manage thin pool capacity
THIN_POOL_AUTOEXTEND_THRESHOLD="80"  # Protection triggers at 80% usage (default: 80)
THIN_POOL_AUTOEXTEND_PERCENT="20"    # Extend pool by 20% when threshold reached (default: 20)

# Network Configuration
PROXMOX_BRIDGE="vmbr0"

# Container Base Configuration
CONTAINER_OS_TEMPLATE="local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"

# Alternative templates for different storage locations
# CONTAINER_OS_TEMPLATE_REMOTE="storage:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst"

CONTAINER_BASE_MEMORY="2048"  # MB
CONTAINER_BASE_CORES="2"
CONTAINER_BASE_DISK="20"  # GB

# Elastic Storage Configuration
# Enable automatic storage expansion
AUTO_EXPAND_STORAGE="false"

# Minimum free space required before expansion (GB)
MIN_FREE_SPACE="100"

# Project Configuration
PROJECT_NAME="smom-dbis-138"
PROJECT_ROOT="/opt/smom-dbis-138-proxmox"
DEPLOYMENT_USER="besu"
DEPLOYMENT_GROUP="besu"

# Resource Limits
VALIDATOR_MEMORY="8192"  # 8GB
VALIDATOR_CORES="4"
VALIDATOR_DISK="100"  # GB
VALIDATOR_DISK_EXPANDABLE="true"  # Allow disk expansion

SENTRY_MEMORY="4096"  # 4GB
SENTRY_CORES="2"
SENTRY_DISK="100"  # GB
SENTRY_DISK_EXPANDABLE="true"

RPC_MEMORY="16384"  # 16GB
RPC_CORES="4"
RPC_DISK="200"  # GB
RPC_DISK_EXPANDABLE="true"

SERVICE_MEMORY="2048"  # 2GB
SERVICE_CORES="2"
SERVICE_DISK="20"  # GB
SERVICE_DISK_EXPANDABLE="true"

MONITORING_MEMORY="4096"  # 4GB
MONITORING_CORES="4"
MONITORING_DISK="50"  # GB
MONITORING_DISK_EXPANDABLE="true"

# Hyperledger Services Resources
FIREFLY_MEMORY="4096"  # 4GB
FIREFLY_CORES="2"
FIREFLY_DISK="50"  # GB
FIREFLY_DISK_EXPANDABLE="true"

CACTI_MEMORY="4096"  # 4GB
CACTI_CORES="2"
CACTI_DISK="50"  # GB
CACTI_DISK_EXPANDABLE="true"

FABRIC_MEMORY="8192"  # 8GB
FABRIC_CORES="4"
FABRIC_DISK="100"  # GB
FABRIC_DISK_EXPANDABLE="true"

INDY_MEMORY="8192"  # 8GB
INDY_CORES="4"
INDY_DISK="100"  # GB
INDY_DISK_EXPANDABLE="true"

# VMID Ranges
VMID_VALIDATORS_START=1000
VMID_SENTRIES_START=1500
VMID_RPC_START=2500
VMID_SERVICES_START=3500
VMID_MONITORING_START=3500
VMID_EXPLORER_START=5000
VMID_FIREFLY_START=6200
VMID_CACTI_START=5200
VMID_FABRIC_START=6000
VMID_INDY_START=6400

# Network Configuration
VLAN_VALIDATORS=100
VLAN_SENTRIES=101
VLAN_RPC=102
VLAN_SERVICES=103
VLAN_MONITORING=104

SUBNET_BASE="10.3.1"
GATEWAY="10.3.1.1"
NETMASK="255.255.255.0"

# DNS Configuration
DNS_SERVERS="8.8.8.8 8.8.4.4"

# Backup Configuration
BACKUP_ENABLED="1"
BACKUP_RETENTION_DAYS="30"
BACKUP_SCHEDULE="02:00"  # Daily at 2 AM

# Migration Configuration
MIGRATION_ENABLED="true"
MIGRATION_PREFERRED_STORAGE=""
MIGRATION_TIMEOUT="300"  # seconds

# High Availability Configuration
HA_ENABLED="false"
HA_GROUP="smom-dbis-138"

# Logging
LOG_DIR="/var/log/smom-dbis-138"
LOG_LEVEL="INFO"

# Debug Mode
DEBUG="${DEBUG:-0}"

# Health Check Configuration
HEALTH_CHECK_ENABLED="true"
HEALTH_CHECK_INTERVAL="300"  # seconds

# Resource Monitoring
RESOURCE_MONITORING_ENABLED="true"
RESOURCE_ALERT_CPU="90"  # Alert if CPU usage > 90%
RESOURCE_ALERT_MEMORY="85"  # Alert if memory usage > 85%
RESOURCE_ALERT_DISK="80"  # Alert if disk usage > 80%
