@@ -71,17 +71,17 @@ Given that you can define a volume from a remote http file, this means, you can
71
71
``` hcl
72
72
resource "libvirt_volume" "kernel" {
73
73
source = "http://download.opensuse.org/tumbleweed/repo/oss/boot/x86_64/loader/linux"
74
- name = "kernel"
75
- pool = "default"
74
+ name = "kernel"
75
+ pool = "default"
76
76
format = "raw"
77
77
}
78
78
79
79
resource "libvirt_domain" "domain-suse" {
80
- name = "suse"
80
+ name = "suse"
81
81
memory = "1024"
82
- vcpu = 1
82
+ vcpu = 1
83
83
84
- kernel = "${ libvirt_volume.kernel.id}"
84
+ kernel = libvirt_volume.kernel.id
85
85
86
86
// ...
87
87
}
@@ -95,11 +95,11 @@ You can use it in the same way as the kernel.
95
95
96
96
``` hcl
97
97
resource "libvirt_domain" "domain-suse" {
98
- name = "suse"
98
+ name = "suse"
99
99
memory = "1024"
100
- vcpu = 1
100
+ vcpu = 1
101
101
102
- kernel = "${ libvirt_volume.kernel.id}"
102
+ kernel = libvirt_volume.kernel.id
103
103
104
104
cmdline = [
105
105
{
@@ -168,12 +168,12 @@ So you should typically use the firmware as this,
168
168
169
169
``` hcl
170
170
resource "libvirt_domain" "my_machine" {
171
- name = "my_machine"
171
+ name = "my_machine"
172
172
firmware = "/usr/share/qemu/ovmf-x86_64-code.bin"
173
- memory = "2048"
173
+ memory = "2048"
174
174
175
175
disk {
176
- volume_id = "${ libvirt_volume.volume.id}"
176
+ volume_id = libvirt_volume.volume.id
177
177
}
178
178
...
179
179
}
@@ -192,15 +192,15 @@ look like this:
192
192
193
193
``` hcl
194
194
resource "libvirt_domain" "my_machine" {
195
- name = "my_machine"
195
+ name = "my_machine"
196
196
firmware = "/usr/share/qemu/ovmf-x86_64-code.bin"
197
197
nvram {
198
198
file = "/usr/local/share/qemu/custom-vars.bin"
199
199
}
200
200
memory = "2048"
201
201
202
202
disk {
203
- volume_id = "${ libvirt_volume.volume.id}"
203
+ volume_id = libvirt_volume.volume.id
204
204
}
205
205
...
206
206
}
@@ -212,7 +212,7 @@ coming from a template, the domain definition should look like this:
212
212
213
213
``` hcl
214
214
resource "libvirt_domain" "my_machine" {
215
- name = "my_machine"
215
+ name = "my_machine"
216
216
firmware = "/usr/share/qemu/ovmf-x86_64-code.bin"
217
217
nvram {
218
218
file = "/usr/local/share/qemu/custom-vars.bin"
@@ -221,7 +221,7 @@ resource "libvirt_domain" "my_machine" {
221
221
memory = "2048"
222
222
223
223
disk {
224
- volume_id = "${ libvirt_volume.volume.id}"
224
+ volume_id = libvirt_volume.volume.id
225
225
}
226
226
...
227
227
}
@@ -245,20 +245,20 @@ a scsi controller, if not specified then a random wwn is generated for the disk
245
245
246
246
``` hcl
247
247
resource "libvirt_volume" "leap" {
248
- name = "leap"
248
+ name = "leap"
249
249
source = "http://someurl/openSUSE_Leap-42.1.qcow2"
250
250
}
251
251
252
252
resource "libvirt_volume" "mydisk" {
253
- name = "mydisk"
254
- base_volume_id = "${ libvirt_volume.leap.id}"
253
+ name = "mydisk"
254
+ base_volume_id = libvirt_volume.leap.id
255
255
}
256
256
257
257
resource "libvirt_domain" "domain1" {
258
258
name = "domain1"
259
259
disk {
260
- volume_id = "${ libvirt_volume.mydisk.id}"
261
- scsi = "true"
260
+ volume_id = libvirt_volume.mydisk.id
261
+ scsi = "true"
262
262
}
263
263
264
264
disk {
@@ -279,10 +279,10 @@ the following examples:
279
279
resource "libvirt_domain" "my_machine" {
280
280
...
281
281
disk {
282
- volume_id = "${ libvirt_volume.volume1.id}"
282
+ volume_id = libvirt_volume.volume1.id
283
283
}
284
284
disk {
285
- volume_id = "${ libvirt_volume.volume2.id}"
285
+ volume_id = libvirt_volume.volume2.id
286
286
}
287
287
}
288
288
```
@@ -292,10 +292,10 @@ resource "libvirt_domain" "my_machine" {
292
292
...
293
293
disk = [
294
294
{
295
- volume_id = "${ libvirt_volume.volume1.id}"
295
+ volume_id = libvirt_volume.volume1.id
296
296
},
297
297
{
298
- volume_id = "${ libvirt_volume.volume2.id}"
298
+ volume_id = libvirt_volume.volume2.id
299
299
}
300
300
]
301
301
}
@@ -304,7 +304,7 @@ resource "libvirt_domain" "my_machine" {
304
304
``` hcl
305
305
resource "libvirt_domain" "my_machine" {
306
306
...
307
- disk = ["${ var.disk_map_list}" ]
307
+ disk = [var.disk_map_list]
308
308
}
309
309
```
310
310
@@ -319,10 +319,10 @@ resource "libvirt_domain" "domain1" {
319
319
name = "domain1"
320
320
321
321
network_interface {
322
- network_id = "${ libvirt_network.net1.id}"
323
- hostname = "master"
324
- addresses = ["10.17.3.3"]
325
- mac = "AA:BB:CC:11:22:22"
322
+ network_id = libvirt_network.net1.id
323
+ hostname = "master"
324
+ addresses = ["10.17.3.3"]
325
+ mac = "AA:BB:CC:11:22:22"
326
326
wait_for_lease = true
327
327
}
328
328
}
@@ -408,7 +408,7 @@ The `graphics` block will look as follows:
408
408
resource "libvirt_domain" "my_machine" {
409
409
...
410
410
graphics {
411
- type = "vnc"
411
+ type = "vnc"
412
412
listen_type = "address"
413
413
}
414
414
}
@@ -440,7 +440,7 @@ The block looks as follows:
440
440
resource "libvirt_domain" "my_machine" {
441
441
...
442
442
console {
443
- type = "pty"
443
+ type = "pty"
444
444
target_port = "0"
445
445
target_type = <"serial" or "virtio">
446
446
source_path = "/dev/pts/4"
@@ -513,13 +513,13 @@ Example:
513
513
514
514
``` hcl
515
515
filesystem {
516
- source = "/tmp"
517
- target = "tmp"
516
+ source = "/tmp"
517
+ target = "tmp"
518
518
readonly = false
519
519
}
520
520
filesystem {
521
- source = "/proc"
522
- target = "proc"
521
+ source = "/proc"
522
+ target = "proc"
523
523
readonly = true
524
524
}
525
525
```
0 commit comments