diff options
author | Dean Smith <dean@zelotus.com> | 2017-08-29 08:26:10 +0100 |
---|---|---|
committer | Dean Smith <dean@zelotus.com> | 2017-08-29 12:44:49 +0100 |
commit | 0ac07fb315a7f2537e4a921fb08a2f9048f21bdc (patch) | |
tree | a61bb9d96aa0d966020f74a0eb4a65dd06abb594 /libvirt/resource_libvirt_domain.go | |
parent | 1ec3dcdefd17561926eee63f59460e015af91d78 (diff) | |
download | terraform-provider-libvirt-0ac07fb315a7f2537e4a921fb08a2f9048f21bdc.tar terraform-provider-libvirt-0ac07fb315a7f2537e4a921fb08a2f9048f21bdc.tar.gz |
Adding support for arch and machine type
This adds support for setting the architecture and machine type
of the created virtual machine by adding two new attributes
machine and arch to the domain definition
Diffstat (limited to 'libvirt/resource_libvirt_domain.go')
-rw-r--r-- | libvirt/resource_libvirt_domain.go | 11 |
1 files changed, 11 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) { |