summaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
authorJ. Eduardo <j.eduardo@gmail.com>2017-07-31 22:16:24 +0200
committerFlavio Castelli <flavio@castelli.me>2017-08-01 09:11:49 +0200
commit968bf16201a9f13030f84765b027d7e45fdbef57 (patch)
tree2f581ce06f099681af4550c25593365428b06b21 /website
parent78341e5971cac8f23e7c36321180a71ee6816131 (diff)
downloadterraform-provider-libvirt-968bf16201a9f13030f84765b027d7e45fdbef57.tar
terraform-provider-libvirt-968bf16201a9f13030f84765b027d7e45fdbef57.tar.gz
Added support for specifying NVRAM templates when using UEFI images.
Diffstat (limited to 'website')
-rw-r--r--website/docs/r/domain.html.markdown53
1 files changed, 48 insertions, 5 deletions
diff --git a/website/docs/r/domain.html.markdown b/website/docs/r/domain.html.markdown
index 6c40cb10..bdb71077 100644
--- a/website/docs/r/domain.html.markdown
+++ b/website/docs/r/domain.html.markdown
@@ -59,11 +59,14 @@ Some extra arguments are also provided for using UEFI images:
environment. Users should usually specify one of the standard _Open Virtual Machine
Firmware_ (_OVMF_) images available for their distributions. The file will be opened
read-only.
-* `nvram` - (Optional) the _nvram_ variables file corresponding to the firmware. When provided,
-this file must be writable and specific to this domain, as it will be updated when running
-the domain. However, `libvirt` can manage this automatically (and this is the recommended solution)
-if a mapping for the firmware to a _variables file_ exists in `/etc/libvirt/qemu.conf:nvram`.
-In that case, `libvirt` will copy that variables file into a file specific for this domain.
+* `nvram` - (Optional) this block allows specifying the following attributes related to the _nvram_:
+ * `file` - path to the file backing the NVRAM store for non-volatile variables. When provided,
+ this file must be writable and specific to this domain, as it will be updated when running the
+ domain. However, `libvirt` can manage this automatically (and this is the recommended solution)
+ if a mapping for the firmware to a _variables file_ exists in `/etc/libvirt/qemu.conf:nvram`.
+ In that case, `libvirt` will copy that variables file into a file specific for this domain.
+ * `template` - (Optional) path to the file used to override variables from the master NVRAM
+ store.
So you should typically use the firmware as this,
@@ -88,6 +91,46 @@ nvram = [
]
```
+In case you need (or want) to specify the path for the NVRAM store, the domain definition should
+look like this:
+
+```hcl
+resource "libvirt_domain" "my_machine" {
+ name = "my_machine"
+ firmware = "/usr/share/qemu/ovmf-x86_64-code.bin"
+ nvram {
+ file = "/usr/local/share/qemu/custom-vars.bin"
+ }
+ memory = "2048"
+
+ disk {
+ volume_id = "${libvirt_volume.volume.id}"
+ }
+ ...
+}
+
+```
+
+Finally, if you want the initial values for the NVRAM to be overridden by custom initial values
+coming from a template, the domain definition should look like this:
+
+```hcl
+resource "libvirt_domain" "my_machine" {
+ name = "my_machine"
+ firmware = "/usr/share/qemu/ovmf-x86_64-code.bin"
+ nvram {
+ file = "/usr/local/share/qemu/custom-vars.bin"
+ template = "/usr/local/share/qemu/template-vars.bin"
+ }
+ memory = "2048"
+
+ disk {
+ volume_id = "${libvirt_volume.volume.id}"
+ }
+ ...
+}
+```
+
### Handling disks
The `disk` block supports: