Commit Graph

50 Commits

Author SHA1 Message Date
Brandon Tosch eb6f36fefb Re-added custom conflict validation for managed disks 2017-03-27 11:27:54 -07:00
Brandon Tosch 0168829ecb Merge branch 'master' into brandontosch/GH-11874 2017-03-23 13:07:49 -07:00
Brandon Tosch 808a9f04f6 removed commented import 2017-03-23 12:14:16 -07:00
Kevin Visscher 8bc049f351 provider/azurerm: Add support for setting the primary network interface (#11290)
Fixes #6514.

* add support for setting the primary network interface
* Tests and documentation for primary_network_interface_id
2017-03-23 16:42:01 +00:00
Brandon Tosch 03b8f05c99 Implemented ConflictsWith for vhd_uri and managed_disk fields 2017-03-17 19:37:05 -07:00
Brandon Tosch 58325b9d59 Merge pull request #1 from edevil/patch-1
Corrected variable reference
2017-03-10 15:15:00 -08:00
Brandon Tosch 34c0dd7ead fixed typo in vm_size 2017-03-10 14:58:08 -08:00
André Cruz 91db3e175d Corrected variable reference
This is a pointer.
2017-03-10 14:35:27 +00:00
Brandon Tosch a2716f76db Lowered data disk size to decrease provisioning time and cost 2017-03-09 19:33:09 -08:00
Brandon Tosch c2565497e6 removed TF_ACC setter 2017-03-05 18:07:19 -08:00
Brandon Tosch 5d915dd4f5 flattened managed disk structure in virtual machine
refactored managed disk acceptance tests
2017-03-05 17:48:35 -08:00
Brandon Tosch ac8eae9eff implemented attaching existing managed disks on vm creation 2017-03-03 21:50:32 -08:00
Brandon Tosch b7df7d4fd2 changed DS1 to DS1_v2 2017-03-01 19:01:04 -08:00
Brandon Tosch e761374738 fixed postConfig check to verify the corrent vm size 2017-03-01 19:00:15 -08:00
Brandon Tosch 5c0b750466 acceptance tests for managed disks
changed location to West US 2
2017-03-01 18:51:00 -08:00
Brandon Tosch 637915337f provider/azurerm: Bumped AzureRM/compute SDK to v8.1.0-beta 2017-03-01 17:10:27 -08:00
Brandon Tosch d1bca91cee updated other arm/compute references to mcardosos 2017-03-01 15:56:47 -08:00
Robert Rudduck da218a37c2 Dont send ssh_keys if length is 0. (#11804) 2017-02-10 11:52:33 +00:00
Peter McAtominey 57b9e7b30a provider/azurerm: add caching support for virtual_machine data_disks (#11142) 2017-01-12 15:52:40 +02:00
Peter McAtominey 6f21b78710 provider/azurerm: fix virtual_machine reading plan as the wrong type (#10626)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMVirtualMachine_plan -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_plan
--- PASS: TestAccAzureRMVirtualMachine_plan (798.75s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	798.835s
2016-12-09 10:41:45 +01:00
Paul Stack 54459900c5 [WIP] provider/azurerm: Bump sdk version to 7.0.1 (#10458)
* provider/azurerm: Bump sdk version to 7.0.1

* Fixing the build (#10489)

* Fixing the broken tests (#10499)

* Updating the method signatures to match (#10533)
2016-12-06 08:39:47 +00:00
Tom Straub 20003b2744 provider/azurerm support `license_type` virtual_machine property for Windows machines. (#10539)
* Added license_type to Azure VirtualMachineProperties call.

* Updated websit documentation.

* Added validation for license_type

* Added acceptance test

* Clarified documentation.
2016-12-06 08:38:10 +00:00
Peter McAtominey 20efd54995 provider/azurerm: set ForceNew for storage image and OS disk of virtual_machine (#10340)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachine_change" -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_changeStorageImageReference
--- PASS: TestAccAzureRMVirtualMachine_changeStorageImageReference (937.49s)
=== RUN   TestAccAzureRMVirtualMachine_changeOSDiskVhdUri
--- PASS: TestAccAzureRMVirtualMachine_changeOSDiskVhdUri (1187.81s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	2125.317s
2016-11-24 15:22:50 +00:00
Andreas Kyrris 59d036202d provider/azurerm: Fix VHD deletion when VM and Storage account are in separate resource groups (#9631)
* Improve messaging when storage account isn't found.

* Add client for finding resources when you don't know it's resource group.

* Add function to find Storage Account resource group name.

* Use the storage account resource group, not the virtual machine's resource group when deleting VHDs.

* Add description of storage account ID for clarity.

* Improve VHD deletion test when storage account is in different resource group.

* Use common function for ID parsing of storage account.
2016-10-27 16:42:47 +01:00
Jonathan Rudenberg d265a6fee3 provider/azurerm: Add disk_size_gb param to VM storage_os_disk (#9200)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMVirtualMachine_basicLinuxMachine -timeout 120m
    === RUN   TestAccAzureRMVirtualMachine_basicLinuxMachine
    --- PASS: TestAccAzureRMVirtualMachine_basicLinuxMachine (540.83s)
    PASS
    ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	540.841s

    TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMVirtualMachine_withDataDisk -timeout 120m
    === RUN   TestAccAzureRMVirtualMachine_withDataDisk
    --- PASS: TestAccAzureRMVirtualMachine_withDataDisk (431.19s)
    PASS
    ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	431.203s
2016-10-25 17:54:55 +01:00
Paul Stack 89138fe22b Merge pull request #9122 from hashicorp/b-arm-vm-diagnostics
provider/azurerm: arm_virtual_machine diagnostics_profile was causing a panic on the Read func
2016-10-07 19:42:15 +01:00
stack72 dcfdc6ab30
provider/azurerm: arm_virtual_machine diagnostics_profile was causing a
panic on the Read func

Fixes #8995

The Diagnostics profile was a badly laid out resource. All we needed to
set was whether it was enabled and the storage account to save the logs
to. The old schema parameter was deprecated and replaced with a much
simplier structure

```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_diagnosticsProfile'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/29 12:21:04 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_diagnosticsProfile -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_diagnosticsProfile
--- PASS: TestAccAzureRMVirtualMachine_diagnosticsProfile (1066.76s)
PASS
ok
github.com/hashicorp/terraform/builtin/providers/azurerm1066.776s
```
2016-10-07 19:36:45 +01:00
Paul Stack 250be11fdd Merge pull request #9073 from carinadigital/GH-9072
provider/azurerm: set resource_group_name on resource import
2016-10-07 13:29:08 +01:00
Andreas Kyrris da2bb09a32 Update tests to include capitalisation of resource group names.
Some azurerm resources store resource_group_name in lowercase only.
Other store resource_group_name using lower and upper case.
Ensure that all test cases use capitalisation in resource_group_name
to find errors in diffs due to capitalisation.

Some resource_group_name were refactored to match naming scheme
across the azurerm tests.
2016-10-03 15:46:34 +01:00
Andreas Kyrris 00c0c75b16 Add tests to azurerm resources for cases where created resources
disappear.
2016-10-03 10:10:10 +01:00
stack72 0fe822e822
provider/azurerm: Removing the diagnostics part of the test from the azurerm virtual machine unattended acceptance test 2016-09-12 17:52:54 +01:00
Jeff Goldschrafe 08f2e6797b provider/azurerm: support Diagnostics Profile
Add support for a diagnostics profile, which allows boot diagnostics to
be enabled on a virtual machine.
2016-08-18 23:46:47 -04:00
Paul Stack 390e1acb3c provider/azurerm: Change of `availability_set_id` on (#7650)
`azurerm_virtual_machine` should ForceNew

Fixes #6873

```
make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_ChangeAvailbilitySet'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_ChangeAvailbilitySet -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_ChangeAvailbilitySet
--- PASS: TestAccAzureRMVirtualMachine_ChangeAvailbilitySet (976.35s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
976.367s
```
2016-07-27 22:39:03 +01:00
Peter McAtominey 1c13cc994b provider/azurerm: add option to delete VMs Data disks on termination (#7793)
```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMVirtualMachine_deleteVHD -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_deleteVHDOptOut
--- PASS: TestAccAzureRMVirtualMachine_deleteVHDOptOut (621.84s)
=== RUN   TestAccAzureRMVirtualMachine_deleteVHDOptIn
--- PASS: TestAccAzureRMVirtualMachine_deleteVHDOptIn (623.95s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1245.930s
```
2016-07-25 17:57:02 +01:00
stack72 33233be247
provider/azurerm: Change of `azurerm_virtual_machine` computer_name now
ForceNew

```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_ChangeComputerName'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_ChangeComputerName -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_ChangeComputerName
--- PASS: TestAccAzureRMVirtualMachine_ChangeComputerName (965.04s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
965.051s
```
2016-07-14 15:48:41 +01:00
Peter McAtominey 324e78020d provider/azurerm: fix tests removed in c141050929 (#7640)
The tests were removed due to a nil pointer panic in
testCheckAzureRMVirtualMachineOSDiskVHDExistance when the storage account itself
had been deleted in the destroy stage

Added a test to cover opting out of VHD delete rather than polluting the basic
linux VM test.

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMVirtualMachine_deleteVHDOpt -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_deleteVHDOptOut
--- PASS: TestAccAzureRMVirtualMachine_deleteVHDOptOut (731.54s)
=== RUN   TestAccAzureRMVirtualMachine_deleteVHDOptIn
--- PASS: TestAccAzureRMVirtualMachine_deleteVHDOptIn (590.87s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1322.529s
```

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMVirtualMachine_basicLinuxMachine -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_basicLinuxMachine
^[--- PASS: TestAccAzureRMVirtualMachine_basicLinuxMachine (587.63s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	587.738s
```
2016-07-14 14:20:42 +01:00
stack72 c141050929
provider/azurerm: Remove tests for delete_on_termination 2016-07-14 08:33:30 +01:00
Peter McAtominey 37e3aa9d8c provider/azurerm: destroy azurerm_virtual_machine OS Disk VHD on deletion (#7584)
* provider/azurerm: destroy azurerm_virtual_machine OS Disk VHD on deletion

The OS Disk previously wasn't deleted with the VM, this causes subsequent
apply operations which recreate the VM to fail as the VHD blob already exists.

Fixes #6610

* provider/azurerm: add delete_os_disk_on_termination to azurerm_virtual_machine

delete_os_disk_on_termination is a bool which defaults to false to avoid making
a breaking change, and to follow the same flow as the Azure API
2016-07-13 23:52:20 +01:00
Paul Stack c965d9bea4 provider/azurerm: Add `azurerm_virtual_machine` Acceptance Test for (#7456)
`storage_data_disk`

```
make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_withDataDisk'
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
2016/07/01 15:47:13 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_withDataDisk -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_withDataDisk
--- PASS: TestAccAzureRMVirtualMachine_withDataDisk (575.39s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
```
2016-07-02 07:55:36 +01:00
Paul Stack ab721e2ffc provider/azurerm: Fix `azurerm_virtual_machine` windows_config (#7123)
When using winrm config block, we had an address issue. This is no
longer a set but a list (As a list fits it more approp)

    ```
    make testacc TEST=./builtin/providers/azurerm
    TESTARGS='-run=TestAccAzureRMVirtualMachine_'
    ==> Checking that code complies with gofmt requirements...
    go generate $(go list ./... | grep -v /vendor/)
    TF_ACC=1 go test ./builtin/providers/azurerm -v
    -run=TestAccAzureRMVirtualMachine_ -timeout 120m
    === RUN   TestAccAzureRMVirtualMachine_basicLinuxMachine
    --- PASS: TestAccAzureRMVirtualMachine_basicLinuxMachine (587.80s)
    === RUN   TestAccAzureRMVirtualMachine_tags
    --- PASS: TestAccAzureRMVirtualMachine_tags (554.53s)
    === RUN   TestAccAzureRMVirtualMachine_updateMachineSize
    --- PASS: TestAccAzureRMVirtualMachine_updateMachineSize (612.52s)
    === RUN   TestAccAzureRMVirtualMachine_basicWindowsMachine
    --- PASS: TestAccAzureRMVirtualMachine_basicWindowsMachine (765.90s)
    === RUN   TestAccAzureRMVirtualMachine_windowsUnattendedConfig
    --- PASS: TestAccAzureRMVirtualMachine_windowsUnattendedConfig
    (770.53s)
    === RUN   TestAccAzureRMVirtualMachine_winRMConfig
    --- PASS: TestAccAzureRMVirtualMachine_winRMConfig (827.90s)
    PASS
    ok      github.com/hashicorp/terraform/builtin/providers/azurerm
    4119.192s
    ```
2016-06-11 13:28:18 +02:00
Paul Hinze 81a436e956 Merge pull request #7105 from hashicorp/b-arm-vm-winconfig
provider/azurerm: `azurerm_virtual_machine` Windows_config
2016-06-10 16:17:09 -05:00
stack72 155a47fa80 provider/azurerm: `azurerm_virtual_machine` Windows_config
Fixes #7053 where, when using `additional_unattend_config` in
`os_profile_windows_config` we got an error as follows:

```
azurerm_virtual_machine.test: [DEBUG] Error setting Virtual Machine
Storage OS Profile Windows Configuration: &errors.errorString{s:"Invalid
address to set: []string{\"os_profile_windows_config\", \"1534614206\",
\"additional_unattend_config\"}"}
```
2016-06-10 19:33:09 +01:00
clint shryock fad26ec59e provider tests: Update to match new tags map in state 2016-06-10 10:07:02 -05:00
James Nugent 738f4bd777 provider/azurerm: Fix azurerm_virtual_machine 2016-06-01 19:52:57 -05:00
James Nugent 0769674c54 provider/azurerm: Use new library configuration
Most resources are commented out at this stage, as they require surgery
to make them work with the new world of the Azure SDK.
2016-06-01 19:52:55 -05:00
Paul Stack 8fce851878 provider/azurerm: Fixing Acceptance Test for VM tags (#6589) 2016-05-10 22:31:56 +01:00
Paul Stack d3939db0a1 provider/azurerm: Adding support for `tags` to `azurerm_virtual_machine` (#6556)
provider/azurerm: Adding support for `tags` to `azurerm_virtual_machine`
2016-05-09 18:14:02 +01:00
stack72 2e174ca3d4 provider/azurerm: Update `azurerm_virtual_machine` failed on
adminPassword

The Azure API never returns the AdminPAssword (as is correct) from the
Read API call. Therefore on Create, we do not set the AdminPassword of
the vm as part of the state. The Same func is used for Create & Update,
therefore when we changed anything on the VM, we were getting the
following error:

```
statusCode:Conflict
serviceRequestId:f498a6c8-6e7a-420f-9788-400f18078921
statusMessage:{"error":{"code":"PropertyChangeNotAllowed","target":"adminPassword","message":"Changing property 'adminPassword' is not allowed."}}
```

To fix this, we need to excldue the AdminPassword from the Update func
if it is empty
2016-05-06 23:44:03 +01:00
stack72 4db3242c53 provider/azurerm: Scaffolding the AzureRM Virtual Machine Test framework 2016-03-17 15:08:59 +00:00
stack72 cb109043f2 Scaffold the Azure RM Virtual Machine resource 2016-03-17 15:08:59 +00:00