# simonecnc/kvm-terraform-provisioner architecture

> Architecture diagram of the GitHub repository simonecnc/kvm-terraform-provisioner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/simonecnc/kvm-terraform-provisioner
- Repository: https://github.com/simonecnc/kvm-terraform-provisioner

## Overview

This repository provisions Ubuntu VMs on KVM through a CSV-driven deployment workflow: an operator runs the Python deployer, which reads VM definitions and invokes the VM creation script. The project also includes Terraform configuration, cloud-init and network settings, and per-VM Terraform management commands. The deployer’s CSV read and script invocation are visible in its excerpt; relationships among the creation script, templates, and generated VM files are not shown, so those links are omitted or marked unverified.

Main entry points: [`bin/deploy.py`](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/bin/deploy.py) (Deployment runner), [`VMs`](https://github.com/simonecnc/kvm-terraform-provisioner/tree/master/VMs) (Generated VM files), [`template/ubuntu-server/main.tf`](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/main.tf) (Terraform config), [`template/ubuntu-server/Makefile`](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/Makefile) (VM commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Provisioning workflow"]
  node_deployer["Deployment runner<br/>[deploy.py]"]
  node_vm_list["VM definitions<br/>[vm_list.csv]"]
  node_create_vm["VM creation script<br/>[create_vm.sh]"]
end

subgraph group_configuration["VM configuration"]
  node_terraform["Terraform config<br/>[main.tf]"]
  node_cloud_init["Cloud-init setup<br/>[cloud_init.cfg]"]
  node_network["Network settings"]
  node_vm_vars["VM parameters"]
  node_template_deploy["Template deploy script<br/>[deploy.sh]"]
end

subgraph group_management["VM management"]
  node_vm_commands["VM commands"]
  node_vm_output[("Generated VM files")]
end

node_operator(("Operator"))
node_kvm["KVM host"]

node_operator -->|"runs"| node_deployer
node_deployer -->|"reads"| node_vm_list
node_deployer -->|"invokes"| node_create_vm
node_deployer -->|"stores configs"| node_vm_output
node_terraform -.->|"provisions on"| node_kvm
node_vm_commands -->|"manages"| node_vm_output

click node_deployer "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/bin/deploy.py"
click node_vm_list "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/data/vm_list.csv"
click node_create_vm "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/bin/create_vm.sh"
click node_terraform "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/main.tf"
click node_cloud_init "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/cloud_init.cfg"
click node_network "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/network_config_static.cfg"
click node_vm_vars "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/ubuntu-server.tfvars"
click node_template_deploy "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/deploy.sh"
click node_vm_commands "https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/Makefile"
click node_vm_output "https://github.com/simonecnc/kvm-terraform-provisioner/tree/master/VMs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_deployer,node_vm_list,node_create_vm toneBlue
class node_terraform,node_cloud_init,node_network,node_vm_vars,node_template_deploy toneAmber
class node_vm_commands,node_vm_output toneMint
class node_operator,node_kvm toneIndigo
```

## Components

### Provisioning workflow

- [Deployment runner](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/bin/deploy.py): `bin/deploy.py`
- [VM definitions](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/data/vm_list.csv): `data/vm_list.csv`
- [VM creation script](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/bin/create_vm.sh): `bin/create_vm.sh`

### VM configuration

- [Terraform config](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/main.tf): `template/ubuntu-server/main.tf`
- [Cloud-init setup](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/cloud_init.cfg): `template/ubuntu-server/cloud_init.cfg`
- [Network settings](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/network_config_static.cfg): `template/ubuntu-server/network_config_static.cfg`
- [VM parameters](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/ubuntu-server.tfvars): `template/ubuntu-server/ubuntu-server.tfvars`
- [Template deploy script](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/deploy.sh): `template/ubuntu-server/deploy.sh`

### VM management

- [VM commands](https://github.com/simonecnc/kvm-terraform-provisioner/blob/master/template/ubuntu-server/Makefile): `template/ubuntu-server/Makefile`
- [Generated VM files](https://github.com/simonecnc/kvm-terraform-provisioner/tree/master/VMs): `VMs`

### Other components

- **Operator**
- **KVM host**

## Connections

- Operator → Deployment runner: runs (evidence: `README.md`)
- Deployment runner → VM definitions: reads (evidence: `bin/deploy.py`)
- Deployment runner → VM creation script: invokes (evidence: `bin/deploy.py`)
- Deployment runner → Generated VM files: stores configs (evidence: `README.md`)
- Terraform config → KVM host: provisions on (evidence: `README.md`)
- VM commands → Generated VM files: manages (evidence: `README.md`)
