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 boot diagnostics don't allow for managed storage accounts #993

Closed
woodbb opened this issue Oct 10, 2022 · 3 comments · Fixed by #1206
Closed

azure_rm_virtualmachine boot diagnostics don't allow for managed storage accounts #993

woodbb opened this issue Oct 10, 2022 · 3 comments · Fixed by #1206
Labels
bug Something isn't working medium_priority Medium priority work in In trying to solve, or in working with contributors

Comments

@woodbb
Copy link

woodbb commented Oct 10, 2022

SUMMARY

When boot diagnostics are enabled, but not storage account is specified, the behavior should be to use a managed storage account and not create a custom one (as there are limits to how many custom SAs can be created)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure.azcollection.azure_rm_virtualmachine

ANSIBLE VERSION
ansible [core 2.13.4]
  config file = /runner/ansible.cfg
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  ansible collection location = /runner/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.13 (default, Jun 24 2022, 15:27:57) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)]
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection         Version
------------------ -------
azure.azcollection 1.13.0 
CONFIGURATION
COLLECTIONS_PATHS(/runner/ansible.cfg) = ['/runner/collections']
DEFAULT_FILTER_PLUGIN_PATH(/runner/ansible.cfg) = ['/runner/custom_filters']
DEFAULT_ROLES_PATH(/runner/ansible.cfg) = ['/runner/roles']
DEFAULT_STRATEGY_PLUGIN_PATH(/runner/ansible.cfg) = ['/runner/custom_plugins/mitogen-0.3.0-rc.0/ansible_mitogen/plugins/strategy']
DEFAULT_TIMEOUT(/runner/ansible.cfg) = 40
HOST_KEY_CHECKING(/runner/ansible.cfg) = False
PARAMIKO_LOOK_FOR_KEYS(/runner/ansible.cfg) = False
OS / ENVIRONMENT

Running on the awx-ee

STEPS TO REPRODUCE

When using:
boot_diagnostics:
enable: true

On the play, the result is always a custom (not managed) storage account tied to the diagnostics.

Contrast that with the az-cli behavior:

https://learn.microsoft.com/en-us/cli/azure/vm/boot-diagnostics?view=azure-cli-latest

--storage
Name or URI of a storage account (e.g. https://your_storage_account_name.blob.core.windows.net/). If it's not specified, managed storage will be used.

-or the api:
https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP#create-a-vm-with-managed-boot-diagnostics. (note the managed diagnostics portion)

EXPECTED RESULTS

Expectation is that just enabling boot_diagnostics, but not specifying a storage account, it will be a managed diagnostic state and not be using a custom storage account for diagnostics. There is a limit to how many custom SAs can exist in a RG/subscription, I believe.

ACTUAL RESULTS

A storage account is always created and the settings are not in a managed state - nor does there appear to be any ability to override this behavior?


@akira6592
Copy link
Contributor

akira6592 commented Dec 19, 2022

I also met the same problem with azure.azcollection 1.14.0.

If storage account is not specified, I also hope it uses managed storage account.

@Fred-sun Fred-sun added bug Something isn't working medium_priority Medium priority work in In trying to solve, or in working with contributors labels Feb 24, 2023
@Fred-sun
Copy link
Collaborator

@akira6592 Do you mean if you do not configure, you will use the managed account (no new account is created), if you configure, you will use the current configuration? right?

@akira6592
Copy link
Contributor

@Fred-sun Yes, that is correct.

Klaas- added a commit to Klaas-/azure that referenced this issue Jun 30, 2023
xuzhang3 pushed a commit that referenced this issue Jul 14, 2023
* Fixes #993 allow to set boot diagnostics storage account to managed

* Fix changing boot diagnostics if boot diagnostics are disabled

* fix blank space

Co-authored-by: Fred-sun <[email protected]>

* Introduce new var type for boot diagnostics

* Fix type for default case of creating/preexisting storage account

* Fix managed boot diagnostics for vm creation -- include freds changes

* Adress review, add mutually exclusive description

* Fix argspec for mutually exvlusiveness inside a suboption

thanks to @flowerysong for explaining it :)

* boot_diagnostics.enabled default is undefined

* Fix sanity tests

* Adress freds review

* Add single newline at the end

---------

Co-authored-by: Fred-sun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium_priority Medium priority work in In trying to solve, or in working with contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants