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

[AVM Module Issue]: avm/res/network/virtual-network duplicate subnet creations #1519

Closed
1 task done
rodney-almeida opened this issue Apr 3, 2024 · 7 comments · Fixed by #1771
Closed
1 task done
Assignees
Labels
Class: Resource Module 📦 This is a resource module Needs: Attention 👋 Reply has been added to issue, maintainer to review Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue

Comments

@rodney-almeida
Copy link
Contributor

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

I'm not sure

Module Name

avm/res/network/virtual-network

(Optional) Module Name if not listed above

No response

(Optional) Module Version

0.1.5

Description

I have used this module a few times and most of the times i don't have an issue with it and creating subnets. However, I have had to clone it and modify it locally for a particular project as I kept getting "Another operation on this or dependent resource is in progress" when creating the subnets (child module call).
I removed the child module call on the local version because (as the commented section in the bicep mentions) the subnets are already been done in the parent vnet resource.
I have seen the commented section and question is, is the child subnet module call suppose to be included in the module that is been referenced publicly or was that an oversight? In other words, is there a way you can test the subnet module without then having this duplicate call included in the public referenced module?
If it is to stay and therefore duplicate the subnet creation, can we have a batch decorator to help prevent these error messages?

PS: love using these module, great work to all the team helping to create and maintain them :)

(Optional) Correlation Id

a8b70743-ceff-41e0-933e-0bdd2c1a05be

@rodney-almeida rodney-almeida added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels Apr 3, 2024
@github-actions github-actions bot added Needs: Attention 👋 Reply has been added to issue, maintainer to review Class: Resource Module 📦 This is a resource module labels Apr 3, 2024
Copy link
Contributor

github-actions bot commented Apr 3, 2024

@rodney-almeida, thanks for submitting this issue for the avm/res/network/virtual-network module!

A member of the @azure/avm-res-network-virtualnetwork-module-owners-bicep or @azure/avm-res-network-virtualnetwork-module-contributors-bicep team will review it soon!

@elbatane
Copy link
Contributor

elbatane commented Apr 5, 2024

Hi, thank you @rodney-almeida for raising the issue. We will review it and come back to you.

@elbatane elbatane removed the Needs: Triage 🔍 Maintainers need to triage still label Apr 5, 2024
@AlexanderSehr
Copy link
Contributor

Hey @rodney-almeida,
thanks for raising the issue. To provide some context

  • You're right that the subnet deployment is in the resource effectively twice, once in the properties of the vnet, once as a seperate resource
  • The first (property) MUST be there, as without, the vnet deployment would first delete all current subnets, and then re-deploythem via the child-module. So that's not an option
  • The first (child-module) should be there for 2 reasons
    • It would in theory be published as its own module (something that happens via the CARML CI, just not in AVM yet)
    • It has more features, like RBAC that you cannot deploy via the property (though could create custom logic for to make it deployable in the parent).

Now to your problem - if you get the issue that 'another operation is in progress' it sounds like there is a concurrency issue. @elbatane let's try to reproduce the issue, but I guess, like suggested by @rodney-almeida, we may need a batchSize(1) annotation for the child-module deployment.

@elbatane
Copy link
Contributor

elbatane commented Apr 19, 2024

Hi @rodney-almeida , did you have the chance to test the solution from @AlexanderSehr ? Thanks!

@h2floh
Copy link

h2floh commented Apr 19, 2024

+1 ⬆️ I ran and run into the same issue. First deployment is always good and on the second run if resources already exist then I see this error hit often, like 90% + almost not possible to test out new changes without deleting the network and associated resources. Since virtualNetwork is a module I can't use the batchSize decorator as a workaround or to try it out.

@AlexanderSehr
Copy link
Contributor

Fair.

@elbatane, I guess to be on the safe side, let's add the batch size deployment. The issue does not seem to happen consistently, but if it happens, I guess it's reason enough.

@rodney-almeida
Copy link
Contributor Author

rodney-almeida commented Apr 29, 2024

@elbatane @AlexanderSehr
I have create a PR for this. Please let me know if there is anything i have missed.
#1771
Thanks

@elbatane elbatane linked a pull request Apr 29, 2024 that will close this issue
11 tasks
AlexanderSehr pushed a commit that referenced this issue May 6, 2024
## Description
Rerunning the vnet module with multiple subnets over an existing vnet
resource can at times cause a 'another operation is in progress' error.
For this reason the batchSize decorator has been added for the
subsequent subnet child module call to minimise this error.

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes #1519
Closes #1519
-->

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.network.virtual-network](https://github.com/rodney-almeida/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network.yml/badge.svg?branch=rodney-almeida%2F1519)](https://github.com/rodney-almeida/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network.yml)
|

## Type of Change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utlities (Non-module effecting
changes)
- [x] Azure Verified Module updates:
- [x] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [x] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [x] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to day with the contribution guide at
https://aka.ms/avm/contribute/bicep -->

---------

Co-authored-by: Rodney Almeida <[email protected]>
Co-authored-by: ChrisSidebotham-MSFT <[email protected]>
hundredacres pushed a commit to hundredacres/bicep-registry-modules that referenced this issue Jun 19, 2024
## Description
Rerunning the vnet module with multiple subnets over an existing vnet
resource can at times cause a 'another operation is in progress' error.
For this reason the batchSize decorator has been added for the
subsequent subnet child module call to minimise this error.

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes Azure#1519
Closes Azure#1519
-->

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.network.virtual-network](https://github.com/rodney-almeida/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network.yml/badge.svg?branch=rodney-almeida%2F1519)](https://github.com/rodney-almeida/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network.yml)
|

## Type of Change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utlities (Non-module effecting
changes)
- [x] Azure Verified Module updates:
- [x] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [x] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [x] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to day with the contribution guide at
https://aka.ms/avm/contribute/bicep -->

---------

Co-authored-by: Rodney Almeida <[email protected]>
Co-authored-by: ChrisSidebotham-MSFT <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Class: Resource Module 📦 This is a resource module Needs: Attention 👋 Reply has been added to issue, maintainer to review Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants