Skip to content

Commit

Permalink
fix(static-or-dynamic): don't default to static, but rather force peo…
Browse files Browse the repository at this point in the history
…ple to chose static over dynamic.
  • Loading branch information
taliesins committed Mar 12, 2021
1 parent e27c034 commit da10a53
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions examples/clone-existing-vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ resource "hyperv_vhd" "web_server_g3_vhd" {

resource "hyperv_machine_instance" "web_server_g3" {
name = "web_server_g3"
static_memory = true

network_adaptors {
name = "wan"
Expand Down
2 changes: 2 additions & 0 deletions examples/vm-from-scratch/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ resource "hyperv_machine_instance" "web_server_g1" {
name = "web_server_g1"
generation = 1
processor_count = 2
static_memory = true
memory_startup_bytes = 536870912 #512MB
wait_for_state_timeout = 10
wait_for_ips_timeout = 10
Expand Down Expand Up @@ -61,6 +62,7 @@ resource "hyperv_machine_instance" "web_server_g2" {
name = "web_server_g2"
generation = 2
processor_count = 2
static_memory = true
memory_startup_bytes = 536870912 #512MB
wait_for_state_timeout = 10
wait_for_ips_timeout = 10
Expand Down
14 changes: 8 additions & 6 deletions hyperv/resource_hyperv_machine_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ func resourceHyperVMachineInstance() *schema.Resource {
},

"dynamic_memory": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Type: schema.TypeBool,
Optional: true,
ExactlyOneOf: []string{"dynamic_memory", "static_memory"},
Default: false,
},

"guest_controlled_cache_types": {
Expand Down Expand Up @@ -148,9 +149,10 @@ func resourceHyperVMachineInstance() *schema.Resource {
},

"static_memory": {
Type: schema.TypeBool,
Optional: true,
Default: true,
Type: schema.TypeBool,
Optional: true,
ExactlyOneOf: []string{"dynamic_memory", "static_memory"},
Default: false,
},

"integration_services": {
Expand Down

0 comments on commit da10a53

Please sign in to comment.