Adding VM domain node
This commit is contained in:
parent
c19dc59a3f
commit
d16f259959
1 changed files with 46 additions and 0 deletions
|
|
@ -48,4 +48,50 @@ resource "libvirt_network" "talos_bridge" {
|
|||
xml {
|
||||
xslt = file("control-plane-net.xsl")
|
||||
}
|
||||
}
|
||||
|
||||
# Download the ISO
|
||||
resource "libvirt_volume" "talos_iso" {
|
||||
name = "talos-metal-arm64.iso"
|
||||
pool = "images"
|
||||
source = "https://factory.talos.dev/image/4a0d65c669d46663f377e7161e50cfd570c401f26fd9e7bda34a0216b6f1922b/v1.11.1/metal-arm64.iso"
|
||||
format = "raw"
|
||||
}
|
||||
|
||||
# Create disk for VM
|
||||
resource "libvirt_volume" "control_plane_disk" {
|
||||
name = "control-plane-node-1-disk.qcow2"
|
||||
pool = "images"
|
||||
base_volume_id = libvirt_volume.talos_iso.id
|
||||
size = 42949672960 # 40GB in bytes
|
||||
format = "qcow2"
|
||||
}
|
||||
|
||||
# Create the VM
|
||||
resource "libvirt_domain" "control_plane_node_1" {
|
||||
name = "control-plane-node-1"
|
||||
memory = 2048
|
||||
vcpu = 2
|
||||
|
||||
disk {
|
||||
volume_id = libvirt_volume.control_plane_disk.id
|
||||
}
|
||||
|
||||
disk {
|
||||
file = libvirt_volume.talos_iso.id
|
||||
}
|
||||
|
||||
network_interface {
|
||||
network_name = "my-talos-net"
|
||||
}
|
||||
|
||||
graphics {
|
||||
type = "none"
|
||||
}
|
||||
|
||||
boot_device {
|
||||
dev = ["hd", "cdrom"]
|
||||
}
|
||||
|
||||
autostart = true
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue