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

feat: Added UDTs for disks and ability to give a custom name to a disk - avm/res/compute/virtual-machine #1517

Merged
merged 28 commits into from
Apr 15, 2024

Conversation

johnlokerse
Copy link
Contributor

@johnlokerse johnlokerse commented Apr 3, 2024

Description

This pull request adds UDTs for OS disk and data disk. Also, included the option to give a custom name to either disk.

Pipeline Reference

Pipeline
avm.res.compute.virtual-machine

Type of Change

  • Update to CI Environment or utlities (Non-module effecting changes)
  • Azure Verified Module updates:
    • Bugfix containing backwards compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in version.json:
      • 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.
    • Update to documentation

Checklist

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

@johnlokerse johnlokerse requested review from a team as code owners April 3, 2024 14:36
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels Apr 3, 2024
@johnlokerse
Copy link
Contributor Author

@AlexanderSehr @rahalan

While running tests I got this error which I can't place. It looks good to me, name is optional and it is checked with coalesce and it still expecting the name property. Do you have any idea what this can be?

image

@matebarabas matebarabas added Class: Resource Module 📦 This is a resource module and removed Needs: Triage 🔍 Maintainers need to triage still labels Apr 3, 2024
avm/res/compute/virtual-machine/main.bicep Outdated Show resolved Hide resolved
avm/res/compute/virtual-machine/main.bicep Outdated Show resolved Hide resolved
@johnlokerse
Copy link
Contributor Author

Implemented PR feedback. Running Actions for tests now.

@rahalan Yesterday I had a capacity error for the Nvidia test. What region do you suggest to set when I get this error again?

@rahalan
Copy link
Contributor

rahalan commented Apr 5, 2024

Implemented PR feedback. Running Actions for tests now.

@rahalan Yesterday I had a capacity error for the Nvidia test. What region do you suggest to set when I get this error again?

You can't. Just ignore the test. To get it running you need to ask for a quota of the VM type.

@johnlokerse
Copy link
Contributor Author

johnlokerse commented Apr 5, 2024

Implemented PR feedback. Running Actions for tests now.
@rahalan Yesterday I had a capacity error for the Nvidia test. What region do you suggest to set when I get this error again?

You can't. Just ignore the test. To get it running you need to ask for a quota of the VM type.

Ok will do!

@AlexanderSehr @rahalan How do we deal with key vaults that already exist somewhere in the Azure world? Deployment name could be used with a unique string.

image

@rahalan
Copy link
Contributor

rahalan commented Apr 5, 2024

@johnlokerse because of that e have the TOKEN_NAMEPREFIX. Maybe try a different one.

@johnlokerse
Copy link
Contributor Author

johnlokerse commented Apr 15, 2024

@rahalan @AlexanderSehr

Green workflow (except for Nvidia):
https://github.com/johnlokerse/bicep-registry-modules/actions/runs/8687076991

It didn't include the static validation step because I replaced the value of #_namePrefix_# for testing purposes... builds without the #_namePrefix_# are rejected. So I tried to rerun it with the original value (#_namePrefix_#) and it failed at the deployment of the key vault due to the name that is not globally unique:
https://github.com/johnlokerse/bicep-registry-modules/actions/runs/8687839244

Would you like me to wait until the key vault can be redeployed and I can run all the steps for a green workflow?

@rahalan
Copy link
Contributor

rahalan commented Apr 15, 2024

@johnlokerse regarding the nameprefix: the name prefix needs to be a secret in your GH, see 3.1 https://azure.github.io/Azure-Verified-Modules/contributing/bicep/bicep-contribution-flow/#31-set-up-secrets

@rahalan rahalan merged commit edf3d5d into Azure:main Apr 15, 2024
4 of 5 checks passed
@johnlokerse
Copy link
Contributor Author

@johnlokerse regarding the nameprefix: the name prefix needs to be a secret in your GH, see 3.1 https://azure.github.io/Azure-Verified-Modules/contributing/bicep/bicep-contribution-flow/#31-set-up-secrets

@rahalan Oh right completely forgot about that... will run the tests with updated prefix tomorrow. FYI; Also need to revert the backup service guid

@@ -24,6 +24,10 @@ param password string = newGuid()
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

// Set to fixed location as the RP function returns unsupported locations
// Right now (2024/04) the following locations are supported: centralindia,uksouth,ukwest,japaneast,australiaeast,canadaeast,canadacentral,northeurope,westeurope,eastus,eastus2,westus,westus2,westus3,northcentralus,southcentralus,westcentralus,centralus
param enforcedLocation string = 'westeurope'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahalan we should not use West Europe. Please change in your next PR

@@ -20,6 +20,10 @@ param serviceShort string = 'cvmlinatmg'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

// Set to fixed location as the RP function returns unsupported locations (configurationProfileAssignments)
// Right now (2024/04) the following locations are supported: centralus, eastus, eastus2, southcentralus, westus, westus2, westcentralus, northeurope, westeurope, canadacentral, japaneast, uksouth, australiasoutheast, australiaeast, southeastasia, westus3
param enforcedLocation string = 'westeurope'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahalan we should not use West Europe. Please change in your next PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexanderSehr Are there any guidelines on what region must be used in this situation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexanderSehr In other Bicep templates the enforcedLocation variable is scoped to either eastus or eastasia. So eastus would be the choice here. Is that correct?

@AlexanderSehr
Copy link
Contributor

Hey @johnlokerse, I could help but also take a peak as I was mentioned in a comment (as per my notifications). Commented a couple other things aside the GUID that you already mentioned that I'd suggest to change/fix soon.

@johnlokerse
Copy link
Contributor Author

@AlexanderSehr @rahalan Yes I will pick this up, will be my first thing to do tomorrow!

Didn't expect a merge this quick, so my bad.

@johnlokerse johnlokerse deleted the johnlokerse/issue1436 branch April 16, 2024 05:54
@rahalan
Copy link
Contributor

rahalan commented Apr 16, 2024

@johnlokerse @AlexanderSehr I didn't review good enough, my bad. I will change the GUID back to the correct one in my already open PR

sebassem added a commit to sebassem/bicep-registry-modules that referenced this pull request Apr 17, 2024
…k - `avm/res/compute/virtual-machine` (Azure#1517)

## Description

This pull request adds UDTs for OS disk and data disk. Also, included
the option to give a custom name to either disk.

## Pipeline Reference

| Pipeline |
| -------- |
|
[![avm.res.compute.virtual-machine](https://github.com/johnlokerse/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml/badge.svg?branch=johnlokerse%2Fissue1436)](https://github.com/johnlokerse/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.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)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] 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`.
  - [ ] Update to documentation

## Checklist

- [ ] I'm sure there are no other open Pull Requests for the same
update/change
- [ ] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [ ] 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: Rainer Halanek <61878316+rahalan@users.noreply.github.com>
sebassem added a commit to sebassem/bicep-registry-modules that referenced this pull request Apr 17, 2024
…mit messages in this repository:

1. added readme
2. feat: Added UDTs for disks and ability to give a custom name to a disk - `avm/res/compute/virtual-machine` (Azure#1517)
3. Merge branch 'Azure:main' into avm-ptn-alz-sub-vending
4. fix: Dnsrule bug for virtual Network link name (Azure#1538)
5. fix: prevent updating the workspace repository configuration whenever no value is provided, so an existing configuration is not overwritten. (Azure#1680)
6. fix: WAF reliability and static validation in `avm/res/web/site`  (Azure#1427)
7. fix: Update for default WAF-alignment - `avm/res/cache/redis` (Azure#1621)
8. Merge branch 'Azure:main' into avm-ptn-alz-sub-vending
9. fix: pwsh publish module index (Azure#1683)
10. feat: Added UDTs for disks and ability to give a custom name to a disk - `avm/res/compute/virtual-machine` (Azure#1517)
segraef pushed a commit to segraef/bicep-registry-modules that referenced this pull request Apr 17, 2024
…k - `avm/res/compute/virtual-machine` (Azure#1517)

## Description

This pull request adds UDTs for OS disk and data disk. Also, included
the option to give a custom name to either disk.

## Pipeline Reference

| Pipeline |
| -------- |
|
[![avm.res.compute.virtual-machine](https://github.com/johnlokerse/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml/badge.svg?branch=johnlokerse%2Fissue1436)](https://github.com/johnlokerse/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.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)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] 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`.
  - [ ] Update to documentation

## Checklist

- [ ] I'm sure there are no other open Pull Requests for the same
update/change
- [ ] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [ ] 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: Rainer Halanek <61878316+rahalan@users.noreply.github.com>
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 Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AVM Module Issue]: compute/virtual-machine and name of OSDisk and DataDisk partly hardcoded in main.bicep
4 participants