Commit Graph

14 Commits

Author SHA1 Message Date
stack72 e57ee0a067 provider/azurerm: Change `azurerm_virtual_machine` to use MaxItems
There were lots of hacky checks in the ARM VM resource to check for a
length of 1 param block

MaxItems was introduced so this PR updates to use MaxItems
2016-06-13 13:25:32 +02: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
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
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
Maxime Bury bd073c539e Fixes terraform crash when using SSH keys with Azure VMs (#6766) 2016-05-19 16:45:58 +01:00
Maxime Bury b33bd427e1 Normalizes availability_set_id to lowercase to avoid spurious diffs (#6768) 2016-05-19 16:44:29 +01:00
Antoine Rouaze a105de19c0 [azurerm] Add os_type and image_uri in azurerm_virtual_machine (#6553)
Fix #6372

Partial fix of #6526
2016-05-09 18:51:19 +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 8dc47ac799 provider/azurerm: Error creating `azurerm_virtual_machine` data_disk
The `storage_data_disk` was trying to use vhd_url rather than vhd_uri.
This was causing an error on creating a new data_disk as part of a VM

Also added validation as data_disks can only be 1 - 1023 GB in size
2016-05-09 00:48:01 +01:00
stack72 712fc83a20 provider/azurerm: Fix an issue with `azurerm_virtual_machine` ssh_keys
ssh_keys were throwing an error similar to this:

```
* azurerm_virtual_machine.test: [DEBUG] Error setting Virtual Machine
* Storage OS Profile Linux Configuration: &errors.errorString{s:"Invalid
* address to set: []string{\"os_profile_linux_config\", \"0\",
* \"ssh_keys\"}"}
```

This was because of nesting of Set within a Set in the schema. By
changing this to a List within a Set, the schema works as expected. This
means we can now set SSH Keys on VMs. This has been tested using a
remote-exec and a connection block with the ssh key

```
azurerm_virtual_machine.test: Still creating... (2m10s elapsed)
azurerm_virtual_machine.test (remote-exec): Connected!
azurerm_virtual_machine.test (remote-exec): CONNECTED!
```
2016-05-08 22:51:51 +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