diff options
author | Thomas Hipp <thomashipp@gmail.com> | 2017-08-29 14:15:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-29 14:15:54 +0200 |
commit | b53fd8e523ffff0c269b8e4738c846693fe8e781 (patch) | |
tree | a61bb9d96aa0d966020f74a0eb4a65dd06abb594 | |
parent | 1ec3dcdefd17561926eee63f59460e015af91d78 (diff) | |
parent | 0ac07fb315a7f2537e4a921fb08a2f9048f21bdc (diff) | |
download | terraform-provider-libvirt-b53fd8e523ffff0c269b8e4738c846693fe8e781.tar terraform-provider-libvirt-b53fd8e523ffff0c269b8e4738c846693fe8e781.tar.gz |
Merge pull request #166 from deasmi/ostypesupport
Adding support for arch and machine type
-rw-r--r-- | libvirt/resource_libvirt_domain.go | 11 | ||||
-rw-r--r-- | website/docs/r/domain.html.markdown | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libvirt/resource_libvirt_domain.go b/libvirt/resource_libvirt_domain.go index 1044223d..561cb712 100644 --- a/libvirt/resource_libvirt_domain.go +++ b/libvirt/resource_libvirt_domain.go @@ -147,6 +147,14 @@ func resourceLibvirtDomain() *schema.Resource { Optional: true, Required: false, }, + "machine": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, + "arch": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, }, } } @@ -239,6 +247,9 @@ func resourceLibvirtDomainCreate(d *schema.ResourceData, meta interface{}) error } } + domainDef.OS.Type.Arch = d.Get("arch").(string) + domainDef.OS.Type.Machine = d.Get("machine").(string) + if firmware, ok := d.GetOk("firmware"); ok { firmwareFile := firmware.(string) if _, err := os.Stat(firmwareFile); os.IsNotExist(err) { diff --git a/website/docs/r/domain.html.markdown b/website/docs/r/domain.html.markdown index bdb71077..5fae0006 100644 --- a/website/docs/r/domain.html.markdown +++ b/website/docs/r/domain.html.markdown @@ -50,6 +50,11 @@ The following arguments are supported: * `coreos_ignition` - (Optional) The [libvirt_ignition](/docs/providers/libvirt/r/coreos_ignition.html) resource that is to be used by the CoreOS domain. +* `arch` - (Optional) The architecture for the VM (probably x86_64 or i686), + you normally won't need to set this unless you are building a special VM +* `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 ### UEFI images |