How anthonyspiteri/project-otosukeru works
Project type and purpose
• Project Ōtosukēru is an automation/orchestration tool (open-source utility) that dynamically deploys, configures, scales, and destroys Veeam Backup proxies on a VMware vSphere platform using Terraform and PowerShell.
Top-level components from the file tree
• Root scripts:
• deploy_otosukeru.ps1 – master orchestration script
• first.ps1 – helper for Windows workgroup setup
• disk_creation.ps1 – (disk setup)
• pre.bat / post.bat – wrappers invoked by Veeam jobs
• Configuration:
• config.json – PowerShell input for VBR & VM credentials
• proxy_ips.json – optional IP management
• proxy_windows/ & proxy_linux/ – Terraform modules for Windows- and Linux-based proxies
• Logs:
• logs/ProjectOtosukeru-Log.txt
• CI/deploy helpers:
• .gitattributes, LICENSE, README.md
A. External systems & services
• Veeam Backup & Replication (VBR) Server (PowerShell snap-in)
• VMware vSphere / vCenter API
• Active Directory domain controller (for domain-joined VMs)
B. Orchestration layer
• User or Veeam job invokes pre.bat → deploy_otosukeru.ps1
• deploy_otosukeru.ps1:
– Reads config.json, command-line flags (–Windows/–Ubuntu/–CentOS/–SetProxies/–Destroy/–ProxyPerHost/–DHCP/–Workgroup)
– Connects to VBR via PowerShell cmdlets
– Determines desired proxy count and scale action
– Generates Terraform variable overrides (proxy count, IP offsets, distro)
– Calls “terraform apply” or “terraform destroy” in proxy_windows/ or proxy_linux/ folders
C. Provisioning layer
• Terraform modules (proxy_windows, proxy_linux):
– main.tf: vSphere provider + VM resource blocks
– anti-affinity_tf: host rules (optional HCI clusters)
– maps.tf (Linux only): firewall commands, template mapping per distro
– output.tf: expose VM names & IPs back to PowerShell
D. Post-provisioning configuration
• Terraform remote-exec or VMware customization: join domain, static/DHCP IPs
• deploy_otosukeru.ps1 picks up outputs and:
– Adds new proxies as managed servers in VBR
– Optionally removes proxies (on scale-down or destroy)
E. Veeam job integration
• pre.bat / post.bat wrap the PS script to run before/after Veeam backup jobs to ensure ephemeral proxies
Relationships and data‐flow
1. User/Veeam Job → invokes pre.bat
2. pre.bat → deploy_otosukeru.ps1 reads config + flags
3. PS → ► VBR Server (get jobs)
4. PS → determine count → write TF var file
5. PS → ► “terraform apply/destroy” → vSphere API
6. Terraform → ► VM Templates → create/destroy VMs
7. Terraform remote-exec → join domain, open FW ports
8. Terraform outputs → PS
9. PS → ► VBR Server (Add-VBRManagedServer or Remove-VBRManagedServer)
10. Job runs → uses proxies
11. After job, post.bat (if configured) cleans up
Architectural patterns & design principles
• Orchestration pattern: master script delegates provisioning to Terraform, configuration to PowerShell
• Infrastructure as Code (Terraform modules)
• Idempotency: scale up/down logic, destroy workflows
• Modular separation: Windows vs. Linux modules, maps.tf for distro specifics