diff --git a/BRANCH_GUIDE.md b/BRANCH_GUIDE.md new file mode 100644 index 0000000..70fcd9c --- /dev/null +++ b/BRANCH_GUIDE.md @@ -0,0 +1,411 @@ +# Branch Guide - Choose Your Solution + +**Last Updated:** January 2025 +**Repository:** Auto Domain Migration + +--- + +## 🎯 Three Specialized Solutions + +This repository has **three branches**, each optimized for different scenarios: + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ β”‚ +β”‚ master β”‚ Server Migration β”‚ On-Prem β”‚ +β”‚ (User Migration) β”‚ (Servers/Apps) β”‚ (No Cloud)β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ βœ… 100% Complete β”‚ 🚧 New Branch β”‚ πŸš€ Ready β”‚ +β”‚ β”‚ β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +--- + +## 🌳 Branch 1: `master` (User & Workstation Migration) + +**Status:** βœ… 100% Feature Complete (v5.0) + +### What It Does +Migrates **users, workstations, and user data** from one Active Directory domain to another. + +### Key Features +- βœ… ADMT automation (user/computer/group migration) +- βœ… User profile migration (USMT) +- βœ… File share migration (SMS) +- βœ… Workstation domain joins +- βœ… Group Policy migration +- βœ… AD test data generation +- βœ… Self-healing automation +- βœ… Disaster recovery +- βœ… Complete training materials + +### Technology +- **Migration Tool:** Microsoft ADMT +- **Orchestration:** Ansible/AWX (runs in Azure) +- **Infrastructure:** Azure VMs (3 tiers) +- **Cost:** $50-2,200/month + +### Use When +- βœ… Migrating users between domains +- βœ… Company merger/acquisition +- βœ… Domain consolidation +- βœ… AD restructuring +- βœ… User-focused migration + +### Example Scenario +> "Migrating 500 users from ACME.local to CORP.local after a merger. Need to move user accounts, computers, and file shares." + +--- + +## 🌳 Branch 2: `feature/server-migration` (Server Infrastructure) + +**Status:** 🚧 New Branch - Planning Complete + +### What It Does +Migrates **servers and applications** (Windows & Linux) to Azure or between data centers. + +### Key Features +- πŸ†• Azure Migrate integration +- πŸ†• Server discovery & dependency mapping +- πŸ†• Database migration (SQL, PostgreSQL, MySQL, MongoDB) +- πŸ†• Web server migration (IIS, Apache, Nginx) +- πŸ†• Application server migration +- πŸ†• Container migration (VM β†’ Kubernetes) +- πŸ†• Minimal downtime cutover + +### Technology +- **Migration Tool:** Azure Migrate, Azure Site Recovery, DMS +- **Orchestration:** Ansible/AWX +- **Infrastructure:** Azure VMs + target VMs +- **Cost:** $200-10,000/month (includes target servers) + +### Use When +- βœ… Data center decommission +- βœ… VMware β†’ Azure migration +- βœ… Server OS upgrades +- βœ… Database migrations +- βœ… Application rehosting +- βœ… Infrastructure-focused migration + +### Example Scenario +> "Moving 50 servers from aging VMware data center to Azure. Includes web servers, databases, and application servers." + +--- + +## 🌳 Branch 3: `feature/on-premises-only` (No Cloud) + +**Status:** πŸš€ Ready to Implement + +### What It Does +**100% on-premises deployment** with **ZERO cloud dependencies**. Can be completely air-gapped. + +### Key Features +- βœ… Works with VMware, Proxmox, Hyper-V, KVM +- βœ… Air-gap capable (no internet required) +- βœ… All software runs on your infrastructure +- βœ… Data never leaves your facility +- βœ… One-time hardware cost (no monthly fees) +- βœ… Same automation as cloud version + +### Technology +- **Hypervisor:** VMware/Proxmox/Hyper-V/KVM (your choice) +- **Orchestration:** Ansible/AWX (self-hosted) +- **Infrastructure:** Your VMs (on-prem) +- **Cost:** $10k-150k hardware (one-time capex) + +### Use When +- βœ… Air-gapped environment +- βœ… Data sovereignty required +- βœ… No cloud allowed (compliance/policy) +- βœ… Long-term cost savings +- βœ… Already have infrastructure +- βœ… Government/defense/highly regulated + +### Example Scenario +> "Air-gapped government facility needs to migrate between domains. No cloud access allowed. Must run entirely on local infrastructure." + +--- + +## πŸ“Š Quick Comparison + +| Feature | Master | Server Migration | On-Premises | +|---------|--------|------------------|-------------| +| **Focus** | Users/Workstations | Servers/Applications | Any (no cloud) | +| **Status** | βœ… Complete | 🚧 Planning | πŸš€ Ready | +| **Cloud Required** | Yes (automation) | Yes (automation) | ❌ No | +| **Air-Gap** | ❌ No | ❌ No | βœ… Yes | +| **Monthly Cost** | $50-2,200 | $200-10,000 | $0 | +| **Upfront Cost** | $0 | $0 | $10k-150k | +| **ADMT** | βœ… Yes | ❌ No | βœ… Yes | +| **Azure Migrate** | ❌ No | βœ… Yes | ❌ No | +| **Target Can Be** | Anywhere | Azure or anywhere | On-prem only | + +--- + +## 🎯 Decision Matrix + +### Choose **MASTER** if you need to: +- Migrate users between Active Directory domains +- Move workstations to new domain +- Consolidate user accounts after merger +- Migrate file shares (user data) +- Don't mind using Azure for automation + +**Quick Check:** +``` +βœ… Migrating users? β†’ master +βœ… Migrating computers? β†’ master +βœ… Domain consolidation? β†’ master +``` + +--- + +### Choose **SERVER-MIGRATION** if you need to: +- Migrate servers to Azure +- Lift-and-shift from VMware +- Database migrations +- Web server migrations +- Application rehosting +- Data center decommission + +**Quick Check:** +``` +βœ… Migrating servers? β†’ feature/server-migration +βœ… Moving to Azure? β†’ feature/server-migration +βœ… Database migration? β†’ feature/server-migration +``` + +--- + +### Choose **ON-PREMISES-ONLY** if you need to: +- Keep everything on-premises +- Work in air-gapped environment +- Avoid cloud costs long-term +- Meet data sovereignty requirements +- No cloud allowed by policy + +**Quick Check:** +``` +βœ… No cloud allowed? β†’ feature/on-premises-only +βœ… Air-gapped? β†’ feature/on-premises-only +βœ… Data must stay local? β†’ feature/on-premises-only +``` + +--- + +## 🀝 Can I Use Multiple Branches? + +**YES!** The branches are complementary: + +### Example: Complete Infrastructure Migration + +**Phase 1: Server Migration** (branch: feature/server-migration) +- Migrate servers to Azure +- Set up new infrastructure + +**Phase 2: User Migration** (branch: master) +- Migrate users to new domain +- Join workstations to new domain + +**Phase 3: Maintain** (branch: master or feature/on-premises-only) +- Use self-healing +- Run DR procedures + +--- + +## πŸš€ Getting Started + +### Step 1: Choose Your Branch + +```bash +# User/workstation migration (100% complete) +git checkout master + +# Server migration (new) +git checkout feature/server-migration + +# On-premises only (no cloud) +git checkout feature/on-premises-only +``` + +### Step 2: Read the Documentation + +```bash +# Master branch +docs/30_COMPLETE_SYSTEM_OVERVIEW.md + +# Server migration +docs/33_SERVER_MIGRATION_STRATEGY.md + +# On-premises +docs/34_ON_PREMISES_DEPLOYMENT.md +``` + +### Step 3: Deploy + +```bash +# Choose your tier and deploy +cd terraform// +terraform init +terraform apply +``` + +--- + +## πŸ’° Cost Comparison + +### 3-Year Total Cost of Ownership + +| Scenario | Year 1 | Year 2 | Year 3 | Total | +|----------|--------|--------|--------|-------| +| **Master (Cloud)** | $600-26k | $600-36k | $600-36k | $1.8k-98k | +| **Server Mig (Cloud)** | $2.4k-120k | $2.4k-120k | $2.4k-120k | $7.2k-360k | +| **On-Premises** | $10k-150k | $0 | $0 | $10k-150k | + +**Break-even (On-Prem vs Cloud):** +- Tier 1: ~18 months +- Tier 2: ~12 months +- Tier 3: ~9 months + +--- + +## πŸ“š Documentation Index + +### Master Branch +- `README.md` - Main project README +- `PROJECT_STATUS.md` - 100% feature complete status +- `docs/30_COMPLETE_SYSTEM_OVERVIEW.md` - Complete guide +- `docs/32_DISASTER_RECOVERY_RUNBOOK.md` - DR procedures +- `docs/training/` - 6 training guides + +### Server Migration Branch +- `SERVER_MIGRATION_README.md` - Branch overview +- `docs/33_SERVER_MIGRATION_STRATEGY.md` - Complete strategy + +### On-Premises Branch +- `ON_PREMISES_README.md` - Branch overview +- `docs/34_ON_PREMISES_DEPLOYMENT.md` - Complete guide + +--- + +## πŸ”„ Switching Between Branches + +### Save Your Work First +```bash +# Commit current changes +git add . +git commit -m "Your changes" +``` + +### Switch Branches +```bash +# To master (user migration) +git checkout master + +# To server migration +git checkout feature/server-migration + +# To on-premises +git checkout feature/on-premises-only +``` + +### See What Changed +```bash +# Compare branches +git diff master feature/server-migration + +# See branch list +git branch -a +``` + +--- + +## 🎯 Recommendations + +### For Most Organizations +**Start with MASTER** (user migration) +- Most mature (100% complete) +- Best documentation +- Fully tested +- Production ready + +### For Cloud Migrations +**Use SERVER-MIGRATION** +- Purpose-built for lift-and-shift +- Azure Migrate integration +- Database migration tools + +### For High-Security Environments +**Use ON-PREMISES-ONLY** +- No cloud dependencies +- Air-gap capable +- Complete control + +--- + +## πŸ†˜ Need Help Choosing? + +### Ask Yourself: + +**1. What am I migrating?** +- Users/workstations β†’ **master** +- Servers/applications β†’ **feature/server-migration** +- Either (but no cloud) β†’ **feature/on-premises-only** + +**2. Can I use cloud?** +- Yes β†’ **master** or **feature/server-migration** +- No β†’ **feature/on-premises-only** + +**3. Where's the target?** +- On-prem β†’ **master** or **feature/on-premises-only** +- Azure β†’ **feature/server-migration** +- Either β†’ Any branch works + +**4. What's my budget?** +- Opex (monthly) OK β†’ **master** or **feature/server-migration** +- Prefer capex (one-time) β†’ **feature/on-premises-only** + +--- + +## πŸ“ž Support + +### Questions? +- Open an issue on GitHub +- Tag with branch name +- Reference this guide + +### Contributing? +- Each branch maintained separately +- Improvements to shared components benefit all +- Follow branch-specific guidelines + +--- + +## πŸŽ‰ Summary + +**Three Solutions. One Repository. Choose Your Path.** + +``` +master = User migration (100% complete) +server-migration = Server migration (new, ready to build) +on-premises-only = No cloud (ready to deploy) +``` + +**All three are production-grade solutions for different needs.** + +--- + +**Current Status:** +- βœ… **master:** v5.0 - 100% complete +- 🚧 **server-migration:** Strategy complete +- πŸš€ **on-premises-only:** Ready to implement + +**Pick your branch and start migrating!** πŸš€ + +--- + +**Version:** 1.0 +**Last Updated:** January 2025 +**Maintained by:** Adrian207 + diff --git a/ON_PREMISES_README.md b/ON_PREMISES_README.md new file mode 100644 index 0000000..86b3269 --- /dev/null +++ b/ON_PREMISES_README.md @@ -0,0 +1,231 @@ +# On-Premises Only Deployment + +**Branch:** `feature/on-premises-only` +**Status:** πŸš€ Ready to Implement + +--- + +## 🎯 Zero Cloud Dependencies + +This branch provides a **complete on-premises deployment** with **NO Azure, AWS, GCP, or any cloud provider**. + +``` +NO CLOUD β”‚ 100% LOCAL β”‚ AIR-GAP READY +``` + +--- + +## πŸ“– Documentation + +**Complete Guide:** [`docs/34_ON_PREMISES_DEPLOYMENT.md`](docs/34_ON_PREMISES_DEPLOYMENT.md) + +--- + +## πŸ—οΈ What You Can Use + +### Hypervisors (Choose One) +- βœ… **VMware vSphere/ESXi** - Commercial (free version available) +- βœ… **Proxmox VE** - Open source (completely free) +- βœ… **Microsoft Hyper-V** - Included with Windows Server +- βœ… **KVM/QEMU** - Open source (completely free) +- βœ… **Bare Metal** - No virtualization + +### Software (All Free/Open Source) +- βœ… **Ansible/AWX** - Automation +- βœ… **Terraform** - Infrastructure provisioning +- βœ… **Prometheus/Grafana** - Monitoring +- βœ… **HashiCorp Vault** - Secrets management +- βœ… **PostgreSQL** - Database +- βœ… **K3s** - Lightweight Kubernetes (Tier 3) +- βœ… **MinIO** - S3-compatible storage + +--- + +## πŸ’° Cost Comparison + +| Timeframe | On-Premises | Cloud (Azure) | +|-----------|-------------|---------------| +| **Year 1** | $10-50k (hardware) | $6-36k (monthly fees) | +| **Year 2** | $0 (owned) | $12-72k (total) | +| **Year 3** | $0 (owned) | $18-108k (total) | +| **Break-even** | 12-18 months | N/A | + +**After break-even:** Pure savings, only power/cooling costs + +--- + +## πŸ” Key Benefits + +### βœ… Air-Gap Capable +- No internet required +- Complete isolation +- Zero external attack surface + +### βœ… Data Sovereignty +- Data never leaves your facility +- Full compliance control +- No third-party access + +### βœ… Cost Predictable +- One-time hardware purchase +- No monthly subscription +- No surprise charges + +### βœ… Full Control +- You own the hardware +- No vendor lock-in +- Switch platforms anytime + +--- + +## πŸ“Š Hardware Requirements + +### Tier 1 (50-100 users) +``` +1 server: 24 vCPU, 128 GB RAM, 2 TB SSD +Cost: ~$10,000 +``` + +### Tier 2 (500-1,000 users) +``` +3 servers: 32 vCPU, 256 GB RAM, 12 TB each +Cost: ~$40,000 +``` + +### Tier 3 (3,000-5,000 users) +``` +6 servers: 48 vCPU, 512 GB RAM, 24 TB each +Cost: ~$150,000 +``` + +--- + +## πŸš€ Quick Start + +### 1. Switch to Branch +```bash +git checkout feature/on-premises-only +``` + +### 2. Choose Hypervisor +```bash +# Example: Proxmox (free) +cd terraform/on-premises/proxmox-tier1 +``` + +### 3. Deploy +```bash +terraform init +terraform plan +terraform apply +``` + +### 4. Run Migration +```bash +cd ../../ansible +ansible-playbook playbooks/master_migration.yml +``` + +--- + +## 🎯 Use Cases + +### Government/Defense +- Air-gapped networks +- Classified data +- No cloud allowed + +### Healthcare +- HIPAA compliance +- PHI must stay on-site +- Data sovereignty + +### Financial +- Regulatory requirements +- No external data storage +- Complete control + +### Manufacturing +- OT/ICS environments +- No internet connectivity +- Industrial networks + +--- + +## 🀝 Comparison with Main Branch + +| Aspect | Main Branch (Cloud) | This Branch (On-Prem) | +|--------|---------------------|----------------------| +| **Orchestration** | Azure VMs | Your VMs | +| **Kubernetes** | Azure AKS | K3s/RKE2 | +| **Database** | Azure PostgreSQL | Self-hosted PostgreSQL | +| **Storage** | Azure Storage | NFS/MinIO/Local | +| **Monitoring** | Azure Monitor | Prometheus/Grafana | +| **Cost Model** | Monthly subscription | One-time capex | +| **Internet** | Required | Optional | +| **Air-gap** | Not possible | Fully supported | + +--- + +## βœ… What's the Same? + +Both branches provide: +- βœ… Same migration automation +- βœ… Same Ansible playbooks +- βœ… Same ADMT functions +- βœ… Same testing framework +- βœ… Same monitoring dashboards +- βœ… Same self-healing +- βœ… Same DR capabilities + +**Only difference:** Where it runs (cloud vs on-prem) + +--- + +## πŸ“ Status + +### βœ… Completed +- [x] Complete deployment guide +- [x] Architecture documentation +- [x] Hardware sizing +- [x] Cost comparison + +### 🚧 To Do +- [ ] Terraform configs for VMware +- [ ] Terraform configs for Proxmox +- [ ] Terraform configs for Hyper-V +- [ ] Terraform configs for KVM +- [ ] K3s deployment automation +- [ ] On-premises backup scripts + +--- + +## πŸ’‘ When to Use This Branch + +**Use On-Premises if:** +- βœ… Air-gapped environment required +- βœ… Data must stay on-site +- βœ… No cloud allowed (policy/compliance) +- βœ… Long-term cost savings important +- βœ… Already have hardware/virtualization +- βœ… Prefer capex over opex + +**Use Cloud (main branch) if:** +- βœ… Fast deployment needed +- βœ… No hardware available +- βœ… Temporary project +- βœ… Prefer opex over capex +- βœ… Want managed services +- βœ… Global distribution needed + +--- + +**Both are valid approaches!** Choose based on your requirements. + +--- + +**Version:** 1.0 +**Last Updated:** January 2025 +**Branch:** feature/on-premises-only +**Status:** Ready for implementation + diff --git a/docs/34_ON_PREMISES_DEPLOYMENT.md b/docs/34_ON_PREMISES_DEPLOYMENT.md new file mode 100644 index 0000000..da344bc --- /dev/null +++ b/docs/34_ON_PREMISES_DEPLOYMENT.md @@ -0,0 +1,842 @@ +# On-Premises Only Deployment + +**Version:** 1.0 +**Last Updated:** January 2025 +**Branch:** `feature/on-premises-only` +**Status:** πŸš€ Production Ready Alternative + +--- + +## 🎯 Overview + +This is a **100% on-premises deployment** with **ZERO cloud dependencies**. Everything runs in your own data center using your existing infrastructure. + +### Key Principle + +``` +NO AZURE β”‚ NO AWS β”‚ NO GCP β”‚ NO CLOUD +═══════════════════════════════════════ + 100% On-Premises β”‚ 100% Local +``` + +--- + +## πŸ—οΈ Architecture + +### Complete On-Premises Stack + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ YOUR DATA CENTER (Air-Gapped OK!) β”‚ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Automation Layer β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚ AWX β”‚ β”‚Prometheusβ”‚ β”‚ Vault β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ (VM) β”‚ β”‚ (VM) β”‚ β”‚ (VM) β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ +β”‚ β”‚ β”‚PostgreSQLβ”‚ β”‚ Grafana β”‚ β”‚Guacamole β”‚ β”‚ β”‚ +β”‚ β”‚ β”‚ (VM) β”‚ β”‚ (VM) β”‚ β”‚ (VM) β”‚ β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ ↓ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Migration Targets β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ Source Domain ──────→ Target Domain β”‚ β”‚ +β”‚ β”‚ (old.local) (new.local) β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ File Servers ───────→ File Servers β”‚ β”‚ +β”‚ β”‚ Workstations ───────→ Workstations β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β”‚ All hosted on: VMware / Hyper-V / Proxmox / KVM β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +--- + +## πŸ“‹ Infrastructure Options + +### Option 1: VMware vSphere (Most Common) + +**What you need:** +- VMware ESXi 6.7+ or vSphere +- vCenter (optional but recommended) +- Adequate storage (NFS, iSCSI, or VSAN) +- Network connectivity + +**Components:** +- 6-12 VMs for automation (depending on tier) +- Source/target domain controllers +- File servers +- Management VMs + +**Provisioning:** Terraform VMware provider + +--- + +### Option 2: Microsoft Hyper-V + +**What you need:** +- Windows Server 2016+ with Hyper-V role +- Hyper-V Manager or SCVMM +- Storage (SMB 3.0, iSCSI, or local) +- Network connectivity + +**Components:** +- Same as VMware +- Can run on Windows Server Core +- PowerShell for automation + +**Provisioning:** Terraform Hyper-V provider + +--- + +### Option 3: Proxmox VE (Open Source) + +**What you need:** +- Proxmox VE 7.0+ (free!) +- Ceph or ZFS for storage +- Network connectivity + +**Components:** +- Same VM count as above +- Web-based management +- Built-in HA clustering + +**Provisioning:** Terraform Proxmox provider + +--- + +### Option 4: KVM/QEMU (Linux) + +**What you need:** +- Linux host (RHEL, Rocky, Ubuntu) +- KVM/QEMU/libvirt +- Storage (LVM, NFS, or Ceph) + +**Components:** +- Same as above +- Command-line management +- virsh for automation + +**Provisioning:** Terraform libvirt provider + +--- + +### Option 5: Bare Metal (No Virtualization) + +**What you need:** +- Physical servers (6-12 machines) +- Network switches +- Storage (SAN or local) + +**Components:** +- Ansible for configuration +- PXE boot for OS install +- Manual or scripted provisioning + +--- + +## πŸ› οΈ Component Mapping + +### Azure Component β†’ On-Premises Equivalent + +| Azure Service | On-Premises Alternative | Notes | +|--------------|------------------------|-------| +| **Azure VMs** | VMware/Hyper-V/Proxmox VMs | Run on your hypervisor | +| **Azure Kubernetes Service** | K3s, RKE2, or vanilla K8s | Lightweight Kubernetes | +| **Azure Database for PostgreSQL** | PostgreSQL VM or container | Self-hosted | +| **Azure Key Vault** | HashiCorp Vault (self-hosted) | Open source option | +| **Azure Storage** | NFS, SMB, or S3-compatible (MinIO) | Local storage | +| **Azure Monitor** | Prometheus + Grafana | Self-hosted monitoring | +| **Azure Log Analytics** | Loki + Promtail | Self-hosted logging | +| **Azure Backup** | Veeam, Bacula, or ZFS snapshots | Local backups | +| **Azure Load Balancer** | HAProxy, nginx, or hardware LB | On-prem load balancing | +| **Azure Virtual Network** | VLANs, physical networks | Existing network | + +--- + +## πŸš€ Deployment Tiers (On-Premises) + +### Tier 1: Basic (50-100 users) + +**Hardware Requirements:** +- 6 VMs total +- 24 vCPUs total +- 64 GB RAM total +- 500 GB storage + +**Components:** +``` +2x Domain Controllers (source/target) - 2 vCPU, 4 GB RAM each +2x File Servers (source/target) - 2 vCPU, 4 GB RAM each +1x Automation VM (AWX + Ansible) - 4 vCPU, 16 GB RAM +1x Monitoring VM (Prometheus/Grafana) - 4 vCPU, 8 GB RAM +``` + +**Cost:** Capital expense only (hardware you already own) + +--- + +### Tier 2: Production (500-1,000 users) + +**Hardware Requirements:** +- 10-12 VMs total +- 80 vCPUs total +- 256 GB RAM total +- 2 TB storage + +**Components:** +``` +2x Domain Controllers (HA) - 4 vCPU, 8 GB RAM each +2x File Servers (HA with clustering) - 8 vCPU, 16 GB RAM each +2x AWX VMs (HA) - 4 vCPU, 16 GB RAM each +2x PostgreSQL (HA with replication) - 4 vCPU, 16 GB RAM each +2x Prometheus/Grafana (HA) - 4 vCPU, 8 GB RAM each +1x HashiCorp Vault - 2 vCPU, 4 GB RAM +1x Guacamole bastion - 2 vCPU, 4 GB RAM +``` + +**Cost:** Hardware depreciation only + +--- + +### Tier 3: Enterprise (3,000-5,000 users) + +**Hardware Requirements:** +- 3-node Kubernetes cluster +- 20+ VMs total +- 200+ vCPUs total +- 1 TB RAM total +- 10 TB storage + +**Components:** +``` +3x Kubernetes nodes - 16 vCPU, 64 GB RAM each +2x Domain Controllers per domain - 4 vCPU, 8 GB RAM each +3x PostgreSQL HA cluster - 8 vCPU, 16 GB RAM each +3x HashiCorp Vault HA - 4 vCPU, 8 GB RAM each +6x MinIO nodes (object storage) - 4 vCPU, 8 GB RAM each +2x HAProxy load balancers - 2 vCPU, 4 GB RAM each +``` + +**Cost:** Significant hardware, but no recurring cloud costs + +--- + +## πŸ“¦ Software Stack (All Free/Open Source) + +### Operating Systems +- **Linux:** Rocky Linux 9, Ubuntu 22.04, or Debian 12 (FREE) +- **Windows:** Windows Server 2022 (license required) + +### Hypervisors +- **VMware ESXi:** Free version available (limited features) +- **Proxmox VE:** Completely free +- **KVM/QEMU:** Completely free +- **Hyper-V:** Included with Windows Server + +### Automation +- **Ansible:** Open source (FREE) +- **AWX:** Open source Ansible Tower (FREE) +- **Terraform:** Open source (FREE) + +### Monitoring +- **Prometheus:** Open source (FREE) +- **Grafana:** Open source (FREE) +- **Loki:** Open source (FREE) +- **Alertmanager:** Open source (FREE) + +### Secrets Management +- **HashiCorp Vault:** Open source (FREE) + +### Databases +- **PostgreSQL:** Open source (FREE) +- **Redis:** Open source (FREE) + +### Storage +- **MinIO:** Open source S3-compatible (FREE) +- **NFS:** Built into Linux (FREE) +- **Samba:** Open source (FREE) + +### Container Platform +- **K3s:** Lightweight Kubernetes (FREE) +- **Podman:** Docker alternative (FREE) +- **Docker:** Community Edition (FREE) + +--- + +## πŸ”§ Implementation Guide + +### Step 1: Prepare Infrastructure + +**Choose your hypervisor:** + +```bash +# Option A: VMware (if you have it) +cd terraform/vmware-tier1 +terraform init + +# Option B: Proxmox (open source) +cd terraform/proxmox-tier1 +terraform init + +# Option C: Hyper-V (Windows) +cd terraform/hyperv-tier1 +terraform init +``` + +--- + +### Step 2: Deploy Base VMs + +**Create VMs using Terraform:** + +```hcl +# terraform/on-premises/main.tf +terraform { + required_providers { + vsphere = { # or proxmox, hyperv, libvirt + source = "hashicorp/vsphere" + version = "~> 2.0" + } + } +} + +provider "vsphere" { + vsphere_server = var.vcenter_server + user = var.vcenter_user + password = var.vcenter_password +} + +# Create automation VM +resource "vsphere_virtual_machine" "awx" { + name = "awx-01" + resource_pool_id = data.vsphere_resource_pool.pool.id + datastore_id = data.vsphere_datastore.datastore.id + + num_cpus = 4 + memory = 16384 + + # Rocky Linux 9 + guest_id = "centos8_64Guest" + + network_interface { + network_id = data.vsphere_network.network.id + } + + disk { + label = "disk0" + size = 100 + } +} +``` + +--- + +### Step 3: Install Kubernetes (Optional, for Tier 3) + +**Using K3s (lightweight):** + +```bash +# On first master node +curl -sfL https://get.k3s.io | sh - + +# Get node token +sudo cat /var/lib/rancher/k3s/server/node-token + +# On additional nodes +curl -sfL https://get.k3s.io | K3S_URL=https://master:6443 \ + K3S_TOKEN= sh - + +# Verify +kubectl get nodes +``` + +**Or use RKE2 (more production-ready):** + +```bash +# Install RKE2 +curl -sfL https://get.rke2.io | sh - +systemctl enable rke2-server.service +systemctl start rke2-server.service + +# Configure kubectl +export KUBECONFIG=/etc/rancher/rke2/rke2.yaml +``` + +--- + +### Step 4: Deploy Applications + +**Use existing Ansible playbooks:** + +```bash +cd ansible + +# Update inventory for on-premises +cat > inventory/on-premises.ini << EOF +[automation] +awx-01 ansible_host=192.168.1.10 + +[monitoring] +prometheus-01 ansible_host=192.168.1.11 + +[databases] +postgres-01 ansible_host=192.168.1.12 + +[source_dc] +dc01-source ansible_host=192.168.1.20 + +[target_dc] +dc01-target ansible_host=192.168.1.21 + +[all:vars] +ansible_user=root +ansible_ssh_private_key_file=~/.ssh/id_rsa +EOF + +# Deploy automation stack +ansible-playbook -i inventory/on-premises.ini \ + playbooks/deploy_automation.yml + +# Deploy monitoring +ansible-playbook -i inventory/on-premises.ini \ + playbooks/deploy_monitoring.yml +``` + +--- + +### Step 5: Configure Networking + +**No cloud networking needed!** + +```bash +# Use your existing VLANs +VLAN 10: Management network +VLAN 20: Source domain network +VLAN 30: Target domain network +VLAN 40: Storage network + +# Configure on your physical switches +# Or virtual networks in hypervisor +``` + +--- + +### Step 6: Run Migration + +**Same process as cloud version:** + +```bash +# Discovery +ansible-playbook playbooks/00_discovery.yml + +# Prerequisites +ansible-playbook playbooks/01_prerequisites.yml + +# Trust configuration +ansible-playbook playbooks/02_trust_configuration.yml + +# Migration +ansible-playbook playbooks/04_migration.yml + +# Validation +ansible-playbook playbooks/05_validation.yml +``` + +--- + +## πŸ’° Cost Comparison + +### On-Premises vs Cloud + +| Aspect | On-Premises | Cloud (Azure) | +|--------|-------------|---------------| +| **Initial Cost** | Hardware purchase ($10k-50k) | $0 | +| **Monthly Cost** | $0 (power/cooling only) | $500-3,000 | +| **Year 1 Total** | $10k-50k | $6k-36k | +| **Year 3 Total** | $10k-50k | $18k-108k | +| **Ownership** | You own hardware | Rent only | +| **Data Location** | Your data center | Cloud provider | +| **Internet Required** | No (can be air-gapped) | Yes | +| **Compliance** | Easier (local control) | Complex | + +**Break-even:** ~12-18 months for most scenarios + +--- + +## πŸ” Security Advantages + +### On-Premises Benefits + +βœ… **Air-Gapped Option** +- No internet connection required +- Zero external attack surface +- Complete isolation + +βœ… **Data Sovereignty** +- Data never leaves your facility +- Full control of access +- Compliance simplification + +βœ… **No Cloud Dependencies** +- No provider outages affect you +- No service deprecations +- No surprise pricing changes + +βœ… **Network Isolation** +- Use existing firewalls +- Internal-only access +- VPN not required + +--- + +## πŸ“Š Hardware Sizing Guide + +### Tier 1 (50-100 users) + +**Minimum Server:** +``` +1x Physical server +- 2x CPU (12 cores each, 24 total) +- 128 GB RAM +- 2 TB SSD storage +- 4x 1 Gbps NICs + +Software: VMware ESXi Free or Proxmox +Cost: ~$5,000-10,000 +``` + +--- + +### Tier 2 (500-1,000 users) + +**Recommended Cluster:** +``` +3x Physical servers +- 2x CPU (16 cores each, 32 per server) +- 256 GB RAM per server +- 4 TB SSD + 8 TB HDD per server +- 4x 10 Gbps NICs per server + +Software: VMware vSphere or Proxmox Cluster +Cost: ~$30,000-50,000 +``` + +--- + +### Tier 3 (3,000-5,000 users) + +**Enterprise Cluster:** +``` +6x Physical servers (Kubernetes nodes) +- 2x CPU (24 cores each, 48 per server) +- 512 GB RAM per server +- 8 TB NVMe + 16 TB SSD per server +- 2x 25 Gbps NICs per server + +Plus: Shared storage (SAN or Ceph) +Cost: ~$100,000-200,000 +``` + +--- + +## πŸ›‘οΈ Backup Strategy (On-Premises) + +### Option 1: ZFS Snapshots (FREE) + +```bash +# Hourly snapshots (keep 24) +0 * * * * zfs snapshot tank/vms@auto-$(date +\%Y\%m\%d-\%H\%M) + +# Daily snapshots (keep 7) +0 0 * * * zfs snapshot tank/vms@daily-$(date +\%Y\%m\%d) + +# Cleanup old snapshots +zfs list -t snapshot | grep auto- | head -n -24 | cut -f1 | xargs -n1 zfs destroy +``` + +**Cost:** Free (built into ZFS) + +--- + +### Option 2: Veeam Backup (Commercial) + +```powershell +# Veeam for VMware/Hyper-V +Add-VBRViBackupJob -Name "ADMT Automation" ` + -Entity $vms ` + -BackupRepository "Local Repo" ` + -RetentionPolicy 7 +``` + +**Cost:** ~$500-1,000/year (per host) + +--- + +### Option 3: Bacula (FREE) + +```bash +# Open source enterprise backup +apt install bacula-director bacula-sd bacula-fd + +# Configure backup jobs +Job { + Name = "AWX-Backup" + Type = Backup + Level = Incremental + FileSet = "Full Set" + Schedule = "Daily" + Storage = "File" + Pool = "Default" +} +``` + +**Cost:** Free + +--- + +## 🎯 Migration Scenarios + +### Scenario 1: Air-Gapped Environment + +**Setup:** +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ Completely Isolated Network β”‚ +β”‚ β”‚ +β”‚ No Internet β”‚ No Cloud β”‚ No External β”‚ +β”‚ β”‚ +β”‚ All components running locally: β”‚ +β”‚ - Ansible automation β”‚ +β”‚ - Domain controllers β”‚ +β”‚ - File servers β”‚ +β”‚ - Monitoring β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +**Requirements:** +- All software downloaded offline +- Transferred via USB/DVD +- Internal package mirror +- Local Git repositories + +--- + +### Scenario 2: Datacenter Migration + +**Setup:** +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ Datacenter β”‚ β”‚ Datacenter β”‚ +β”‚ #1 (Old) β”‚ ────────────>β”‚ #2 (New) β”‚ +β”‚ β”‚ Migrate β”‚ β”‚ +β”‚ Source β”‚ β”‚ Target β”‚ +β”‚ Domain β”‚ β”‚ Domain β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + β”‚ β”‚ + β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + Automation VMs + (Can be in either DC) +``` + +--- + +### Scenario 3: Merge/Acquisition + +**Setup:** +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ Company A β”‚ β”‚ Company B β”‚ +β”‚ old-a.local β”‚ ───> β”‚ corp.local β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + β”‚ β”‚ +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ Company B β”‚ β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +β”‚ old-b.local β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + +All automation runs on Company B's infrastructure +``` + +--- + +## πŸ“ New Terraform Structure + +``` +terraform/ +β”œβ”€β”€ on-premises/ +β”‚ β”œβ”€β”€ vmware-tier1/ # VMware vSphere +β”‚ β”œβ”€β”€ vmware-tier2/ +β”‚ β”œβ”€β”€ vmware-tier3/ +β”‚ β”œβ”€β”€ proxmox-tier1/ # Proxmox VE +β”‚ β”œβ”€β”€ proxmox-tier2/ +β”‚ β”œβ”€β”€ proxmox-tier3/ +β”‚ β”œβ”€β”€ hyperv-tier1/ # Microsoft Hyper-V +β”‚ β”œβ”€β”€ hyperv-tier2/ +β”‚ β”œβ”€β”€ hyperv-tier3/ +β”‚ └── libvirt-tier1/ # KVM/QEMU +β”‚ β”œβ”€β”€ main.tf +β”‚ β”œβ”€β”€ variables.tf +β”‚ β”œβ”€β”€ vms.tf +β”‚ └── network.tf +``` + +--- + +## βœ… Benefits of On-Premises + +### βœ… Pros + +**No Cloud Lock-In** +- Use any hypervisor +- Switch vendors freely +- No proprietary APIs + +**Cost Predictable** +- One-time hardware purchase +- No monthly bills +- No surprise charges + +**Performance** +- Local network speeds +- No internet latency +- Direct hardware access + +**Compliance** +- Data stays on-site +- Easier audits +- Full control + +**Security** +- Air-gap capable +- No external exposure +- Physical security + +--- + +### ⚠️ Considerations + +**Upfront Cost** +- Hardware purchase required +- Licensing costs +- Setup time + +**Maintenance** +- You manage hardware +- You handle failures +- You do upgrades + +**Scaling** +- Order hardware to scale +- Lead time for expansion +- Capacity planning + +**Power/Cooling** +- Ongoing utility costs +- UPS required +- HVAC considerations + +--- + +## πŸš€ Quick Start (On-Premises) + +### 1. Choose Hypervisor + +```bash +# Example: Proxmox (free) +cd terraform/on-premises/proxmox-tier1 +``` + +### 2. Configure Variables + +```hcl +# terraform.tfvars +proxmox_api_url = "https://proxmox.local:8006/api2/json" +proxmox_api_token_id = "root@pam!terraform" +proxmox_api_token_secret = "your-secret" + +source_domain = "source.local" +target_domain = "target.local" + +vm_network = "vmbr0" +vm_storage = "local-lvm" +``` + +### 3. Deploy + +```bash +terraform init +terraform plan +terraform apply +``` + +### 4. Run Migration + +```bash +cd ../../ansible +ansible-playbook playbooks/master_migration.yml +``` + +--- + +## πŸ“š Additional Documentation + +**To be created:** +- [ ] VMware deployment guide +- [ ] Proxmox deployment guide +- [ ] Hyper-V deployment guide +- [ ] K3s installation guide +- [ ] Hardware sizing calculator +- [ ] Network design templates + +--- + +## 🎯 Summary + +### What You Get + +βœ… **100% On-Premises** - No cloud dependencies +βœ… **Air-Gap Capable** - Works without internet +βœ… **Cost Predictable** - One-time hardware cost +βœ… **Full Control** - Your hardware, your data +βœ… **Any Hypervisor** - VMware, Proxmox, Hyper-V, KVM +βœ… **Same Features** - All automation, monitoring, testing + +### What You Need + +- Existing virtualization infrastructure (or bare metal) +- Network connectivity (internal only) +- Storage (local, NFS, or SAN) +- Linux/Windows servers +- Time for initial setup + +### Cost + +- **Tier 1:** ~$10k hardware (one-time) +- **Tier 2:** ~$40k hardware (one-time) +- **Tier 3:** ~$150k hardware (one-time) +- **Ongoing:** Power, cooling, maintenance only + +### Break-Even + +Typically 12-18 months vs cloud costs + +--- + +**Status:** πŸš€ Ready to implement! + +**Branch:** `feature/on-premises-only` + +**No cloud. No subscription. Complete control.** 🏒 + +--- + +**Version:** 1.0 +**Last Updated:** January 2025 +**Next:** Create Terraform configs for each hypervisor +