aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Batschelet <samb@endpoint.com>2017-09-06 07:30:19 -0400
committerFlavio Castelli <flavio@castelli.me>2017-09-06 14:32:33 +0200
commit8367c0506c19ab7900f3540cd0e293f96472c179 (patch)
tree15e8b2d7fd27b89f06cb9a1c09585d1ee64616d0
parent8460d878ef9a36864caa7be7bc0ae5a719d3eb90 (diff)
downloadterraform-provider-libvirt-8367c0506c19ab7900f3540cd0e293f96472c179.tar
terraform-provider-libvirt-8367c0506c19ab7900f3540cd0e293f96472c179.tar.gz
domain: Improve documentation and add examples for BootDevice.
-rw-r--r--examples/boot/libvirt.tf33
-rw-r--r--website/docs/r/domain.html.markdown13
2 files changed, 45 insertions, 1 deletions
diff --git a/examples/boot/libvirt.tf b/examples/boot/libvirt.tf
new file mode 100644
index 00000000..048b3a35
--- /dev/null
+++ b/examples/boot/libvirt.tf
@@ -0,0 +1,33 @@
+provider "libvirt" {
+ uri = "qemu:///system"
+}
+
+// blank 10GB image for net install.
+resource "libvirt_volume" "debian9-qcow2" {
+ name = "debian9-qcow2"
+ pool = "default"
+ format = "qcow2"
+ size = 10000000000
+}
+
+// set boot order hd, network
+resource "libvirt_domain" "domain-debian9-qcow2" {
+ name = "debian9"
+ memory = "1024"
+ vcpu = 1
+
+ network_interface {
+ bridge = "br0"
+ mac = "52:54:00:b2:2f:86"
+ }
+ boot_devices {
+ dev = [ "hd", "network"]
+ }
+ disk {
+ volume_id = "${libvirt_volume.debian9-qcow2.id}"
+ }
+ graphics {
+ type = "vnc"
+ listen_type = "address"
+ }
+}
diff --git a/website/docs/r/domain.html.markdown b/website/docs/r/domain.html.markdown
index 994e5bfe..05838907 100644
--- a/website/docs/r/domain.html.markdown
+++ b/website/docs/r/domain.html.markdown
@@ -55,7 +55,8 @@ The following arguments are supported:
* `machine` - (Optional) The machine type,
you normally won't need to set this unless you are running on a platform that
defaults to the wrong machine type for your template
-* `boot_device` - (Optional) A list of devices (dev) which sets boot order
+* `boot_device` - (Optional) A list of devices (dev) which defines boot order. Example
+ [below](#define-boot-device-order).
### UEFI images
@@ -406,6 +407,16 @@ tmp /host/tmp 9p trans=virtio,version=9p2000.L,rw 0 0
proc /host/proc 9p trans=virtio,version=9p2000.L,r 0 0
```
+### Define Boot Device Order
+
+Set hd as default and fallback to network.
+
+```hcl
+boot_devices {
+ dev = [ "hd", "network"]
+}
+```
+
## Attributes Reference
* `id` - a unique identifier for the resource.