diff --git a/example/resource_virtual_environment_vm.tf b/example/resource_virtual_environment_vm.tf index 823db9ea..bbbb1df2 100644 --- a/example/resource_virtual_environment_vm.tf +++ b/example/resource_virtual_environment_vm.tf @@ -107,6 +107,10 @@ resource "proxmox_virtual_environment_vm" "example_template" { serial_device {} + vga { + type = "qxl" + } + template = true // use auto-generated vm_id diff --git a/fwprovider/test/resource_vm_test.go b/fwprovider/test/resource_vm_test.go index 60fae670..5ead6a3d 100644 --- a/fwprovider/test/resource_vm_test.go +++ b/fwprovider/test/resource_vm_test.go @@ -175,7 +175,8 @@ func TestAccResourceVM(t *testing.T) { }`), Check: resource.ComposeTestCheckFunc( ResourceAttributes("proxmox_virtual_environment_vm.test_vm", map[string]string{ - "vga.0.type": "none", + "vga.0.type": "none", + "vga.0.clipboard": "", }), ), }, { @@ -195,6 +196,23 @@ func TestAccResourceVM(t *testing.T) { "vga.0.clipboard": "vnc", }), ), + }, { + Config: te.RenderConfig(` + resource "proxmox_virtual_environment_vm" "test_vm" { + node_name = "{{.NodeName}}" + started = false + + vga { + type = "virtio-gl" + clipboard = "" + } + }`), + Check: resource.ComposeTestCheckFunc( + ResourceAttributes("proxmox_virtual_environment_vm.test_vm", map[string]string{ + "vga.0.type": "virtio-gl", + "vga.0.clipboard": "", + }), + ), }}, }, } diff --git a/fwprovider/vm/vga/resource_test.go b/fwprovider/vm/vga/resource_test.go index 096836bd..b4ee4be4 100644 --- a/fwprovider/vm/vga/resource_test.go +++ b/fwprovider/vm/vga/resource_test.go @@ -66,6 +66,9 @@ func TestAccResourceVM2VGA(t *testing.T) { "vga.type": "std", "vga.memory": "16", }), + test.NoResourceAttributesSet("proxmox_virtual_environment_vm2.test_vm", []string{ + "vga.clipboard", + }), ), }, { // now update the vga params and check if they are updated diff --git a/proxmoxtf/resource/vm/vm.go b/proxmoxtf/resource/vm/vm.go index 473a0468..96f2a981 100644 --- a/proxmoxtf/resource/vm/vm.go +++ b/proxmoxtf/resource/vm/vm.go @@ -1403,6 +1403,7 @@ func VM() *schema.Resource { Optional: true, Default: dvVGAClipboard, ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{ + "", "vnc", }, true)), },