summaryrefslogtreecommitdiff
path: root/website/docs/r/domain.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'website/docs/r/domain.html.markdown')
-rw-r--r--website/docs/r/domain.html.markdown94
1 files changed, 94 insertions, 0 deletions
diff --git a/website/docs/r/domain.html.markdown b/website/docs/r/domain.html.markdown
index b047a6e7..f008501e 100644
--- a/website/docs/r/domain.html.markdown
+++ b/website/docs/r/domain.html.markdown
@@ -59,6 +59,100 @@ The following arguments are supported:
[below](#define-boot-device-order).
* `emulator` - (Optional) The path of the emulator to use
+### Kernel and boot arguments
+
+* `kernel` - (Optional) The path of the kernel to boot
+
+If you are using a qcow2 volume, you can pass the id of the volume (eg. `${libvirt_volume.kernel.id}`)
+as they are local to the hypervisor.
+
+Given that you can define a volume from a remote http file, this means, you can also have remote kernels.
+
+```hcl
+resource "libvirt_volume" "kernel" {
+ source = "http://download.opensuse.org/tumbleweed/repo/oss/boot/x86_64/loader/linux"
+ name = "kernel"
+ pool = "default"
+ format = "raw"
+}
+
+resource "libvirt_domain" "domain-suse" {
+ name = "suse"
+ memory = "1024"
+ vcpu = 1
+
+ kernel = "${libvirt_volume.kernel.id}"
+
+ // ...
+}
+```
+
+* `kernel` - (Optional) The path of the initrd to boot.
+
+You can use it in the same way as the kernel.
+
+* `cmdline` - (Optional) Arguments to the kernel
+
+```hcl
+resource "libvirt_domain" "domain-suse" {
+ name = "suse"
+ memory = "1024"
+ vcpu = 1
+
+ kernel = "${libvirt_volume.kernel.id}"
+
+ cmdline {
+ arg1 = "value1"
+ arg2 = "value2"
+ }
+}
+```
+
+Also note that the `cmd` block is actually a list of maps, so it is possible to
+declare several of them by using either the literal list and map syntax as in
+the following examples:
+
+```hcl
+resource "libvirt_domain" "my_machine" {
+ //...
+
+ cmdline {
+ arg1 = "value1"
+ }
+ cmdline {
+ arg2 = "value2"
+ }
+}
+```
+
+```hcl
+resource "libvirt_domain" "my_machine" {
+ ...
+ cmdline = [
+ {
+ arg1 = "value1"
+ },
+ {
+ arg2 = "value2"
+ }
+ ]
+}
+```
+The kernel supports passing the same option multiple times. If you need this, use separate cmdline blocks.
+
+```hcl
+resource "libvirt_domain" "my_machine" {
+ //...
+
+ cmdline {
+ arg1 = "value1"
+ }
+ cmdline {
+ arg1 = "value2"
+ }
+}
+```
+
### UEFI images
Some extra arguments are also provided for using UEFI images: