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

azure_rm_virtualmachine: enable custom storage account #392

Open
Sneedes opened this issue Jan 11, 2021 · 0 comments
Open

azure_rm_virtualmachine: enable custom storage account #392

Sneedes opened this issue Jan 11, 2021 · 0 comments

Comments

@Sneedes
Copy link

Sneedes commented Jan 11, 2021

Attempting to utilize azure_rm_virtualmachine module to define an Azure Virtual Machine with:

  • Boot Diagnostics Enabled
  • Custom Storage Account in a different Resource Group than the VM
  • VM using managed disks

Appears the Ansible module is written in such a way that the VM Boot Diagnostics cannot be enabled with an existing Storage Account that exists outside of the Resource Group of the VM. Noting that this can occur in the Azure Portal/GUI.

Azure Portal> Target VM > Support + troubleshooting > Boot diagnostics >Settings
Status: Enable with custom storage account
Diagnostics storage account drop-down lists possible Storage Accounts that may be utilized

Encounter the following error message from Ansible:

Error fetching storage account myCustomStorageAccount- Azure Error: ResourceNotFound

Message: The Resource 'Microsoft.Storage/storageAccounts/myCustomStorageAccount' under resource group 'myVMResourceGroup' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

- name: Create Azure VM myVMName
  azure_rm_virtualmachine:
    name: myVMName
    resource_group: myVMResourceGroup
    managed_disk_type: "Premium_LRS"
    boot_diagnostics": {
      enabled: true,
      storage_account: myCustomStorageAccount
$ ansible-config dump --only-changed
INTERPRETER_PYTHON(.ansible.cfg) = auto_silent

$ ansible --version
ansible 2.10.0.dev0
  config file = .ansible.cfg
  configured module search path = [u'.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/ansible/azure-20200212/lib/python2.7/site-packages/ansible
  executable location = /opt/ansible/azure-20200212/bin/ansible
  python version = 2.7.5 (default, Aug 13 2020, 02:51:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant