Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/azurerm: Update azurerm_virtual_machine failed on adminPassword #6528

Merged
merged 1 commit into from
May 6, 2016

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented May 6, 2016

Fixes #6517

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 exclude the AdminPassword from the Update func if it is empty

Test Results:

make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine' 2>~/tf.log
==> 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 (372.34s)
=== RUN   TestAccAzureRMVirtualMachine_updateMachineSize
--- PASS: TestAccAzureRMVirtualMachine_updateMachineSize (579.54s)
=== RUN   TestAccAzureRMVirtualMachine_basicWindowsMachine
--- PASS: TestAccAzureRMVirtualMachine_basicWindowsMachine (723.42s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    1675.313s

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
@stack72 stack72 changed the title provider/azurerm: Update azurerm_virtual_machine failed on adminPassword [WIP] provider/azurerm: Update azurerm_virtual_machine failed on adminPassword May 6, 2016
@stack72 stack72 mentioned this pull request May 6, 2016
8 tasks
@stack72 stack72 changed the title [WIP] provider/azurerm: Update azurerm_virtual_machine failed on adminPassword provider/azurerm: Update azurerm_virtual_machine failed on adminPassword May 6, 2016
@jen20
Copy link
Contributor

jen20 commented May 6, 2016

LGTM!

@jen20 jen20 merged commit 78283a9 into master May 6, 2016
@jen20 jen20 deleted the b-arm-update-vm branch May 6, 2016 23:12
@ghost
Copy link

ghost commented Apr 26, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azurerm can not adjust vm-size after deploy
2 participants