#Multi-VM Builds
A multi-VM module. The VMs boot in parallel, share networking, and each becomes a template VM in the resulting module — clones spin up running copies of all of them as a group.
network:
vpcs:
- name: vpc
internet: false
subnets:
- name: lan
vpc: vpc
cidr: '10.0.0.0/24'
vms:
- name: server
source:
url: 'https://cloud.debian.org/.../debian-12-genericcloud-amd64.qcow2'
nics:
- name: lan0
subnet: lan
ip: '10.0.0.10'
cloudInit:
userData: |
#cloud-config
ssh_authorized_keys: []
provisioners:
- type: shell
shell:
inline: |
# set up server
sudo apt-get install -y nginx
echo "Server ready" > /var/www/html/index.html
- name: client
source:
url: 'https://cloud.debian.org/.../debian-12-genericcloud-amd64.qcow2'
nics:
- name: lan0
subnet: lan
ip: '10.0.0.11'
cloudInit:
userData: |
#cloud-config
ssh_authorized_keys: []
provisioners:
- type: shell
shell:
inline: |
# client can reach server at 10.0.0.10
curl http://10.0.0.10/
Use cases:
- Modeling client/server pairs as a single module (one template VM is the server, the other is the client).
- Shipping a lab environment where multiple VMs are part of the same scenario as one module that always clones together.
- Capturing several differently-configured VMs that need to come up together with a shared network.
VMs in the same module run in parallel during the Building phase. Each VM has its own provisioners, its own resources, and becomes its own template VM in the module. They can reach each other by IP if you put them on the same subnet, both during the build and in any clone of the module.