A Go-based service that creates microVMs using Firecracker and provides SSH access.
- Linux operating system (required for Firecracker)
- Go 1.21 or later
- Root/sudo access (for network setup)
- Clone the repository:
git clone <repository-url>
cd microvm-provisioner
- Run the setup script:
chmod +x setup.sh
sudo ./setup.sh
- Install Go dependencies:
go mod download
- Start the service:
go run main.go
- The service will be available at
http://localhost:8080
curl -X POST http://localhost:8080/vm \
-H "Content-Type: application/json" \
-d '{
"os": "ubuntu",
"memory": 512,
"cpus": 1,
"disk_size": 2
}'
Response:
{
"id": "vm-uuid",
"ip_address": "172.16.0.2",
"ssh_key": "ssh-rsa ..."
}
curl http://localhost:8080/health
- The service currently supports Ubuntu and Linux VMs
- Memory is specified in MB
- Disk size is specified in GB
- SSH keys are generated automatically for each VM
- VMs are assigned IP addresses in the 172.16.0.0/24 range
- The service requires root access for network setup
- Firecracker provides strong isolation between VMs
- Each VM gets its own SSH key pair
- Network access is restricted to the tap interface