Skip to content

Commit

Permalink
Merge pull request Azure#494 from jensheerin/Terraform-AVDALZ-updates
Browse files Browse the repository at this point in the history
update to docs
  • Loading branch information
jensheerin authored Sep 29, 2023
2 parents 1f0de0a + 7ee0d24 commit 386f929
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 17 deletions.
24 changes: 23 additions & 1 deletion workload/terraform/example/gamedevwm/packer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,27 @@ Before you can use this Packer configuration, you will need to have the followin

You will also need to have an Azure subscription and have the necessary permissions to create and manage virtual machines.

Prior to running packer build create a resource group name `rg_gmdv_packer`
Prior to running packer build a resource group name must be pre-created. Various options can be used to create a resource group in Azure with automation. These steps outline simple GUI steps via Azure Portal. [Create a Resource Group][rg]

### Customizations

The variables for creating a custom image using Packer are located in 2 files:
| File Name | Description |
| -------------------------------| ----------------------------------------------------------------------------------------------------------------- |
| variables.pkr.hcl | This file contains the variables used in the Packer template for creating the custom image for gaming workloads. |
| variables.auto.pkrvars.hcl | This file has settings for variables for creating a custom image. Modify these to customize. |

Modify the variables.auto.pkrvars.hcl to change the most common options.
The variables include:
- image_offer: The offer of the image to use. Need help finding [available Azure image details](https://learn.microsoft.com/en-us/azure/virtual-machines/windows/cli-ps-findimage#list-images)
- image_publisher: The publisher of the image to use.
- image_sku: The SKU of the image to use.
- image_version: The version of the image to use.
- vm_size: The size of the virtual machine to use. Need help finding [GPU vm sizes](https://learn.microsoft.com/en-us/azure/virtual-machines/sizes-gpu)
- resource_group_name: The name of the resource group to use.
- region: The region where the resource group and virtual machine will be created.

If you need further customizations look at modifying the defaults in the variables.pkr.hcl file.

### Installation

Expand Down Expand Up @@ -125,4 +145,6 @@ Microsoft Support is not yet handling issues for any published tools in this rep
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[Packer.io]: https://www.packer.io
[def]: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal#create-resource-groups
[rg]: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal#create-resource-groups

Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
image_offer = "office-365"
image_publisher = "MicrosoftWindowsDesktop"
image_sku = "win10-22h2-avd-m365-g2"
image_version = "latest"
/*
This HCL code block sets the variables for creating a custom image using Packer. You may modify the values of the variables to suit your needs.
The variables include:
- image_offer: The offer of the image to use.
- image_publisher: The publisher of the image to use.
- image_sku: The SKU of the image to use.
- image_version: The version of the image to use.
- vm_size: The size of the virtual machine to use.
- resource_group_name: The name of the resource group to use.
- region: The region where the resource group and virtual machine will be created.
*/

image_offer = "office-365"
image_publisher = "MicrosoftWindowsDesktop"
image_sku = "win11-22h2-avd-m365"
image_version = "latest"
vm_size = "Standard_NV12ads_A10_v5"
resource_group_name = "gamedev-image-rg"
region = "southcentralus"
40 changes: 28 additions & 12 deletions workload/terraform/example/gamedevwm/packer/variables.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
/*
This file contains the variables used in the Packer template for creating a custom image for gaming workloads.
- image_offer: The offer of the base image used for creating the custom image.
- image_publisher: The publisher of the base image used for creating the custom image.
- image_sku: The SKU of the base image used for creating the custom image.
- image_version: The version of the base image used for creating the custom image.
- artifact_storage_account: The name of the storage account where the custom image will be stored.
- artifact_storage_account_container: The name of the container in the storage account where the custom image will be stored.
- msbuild_path: The path to the MSBuild executable used for building the custom image.
- winrm_username: The username used for WinRM authentication.
- region: The Azure region where the custom image will be created.
- resource_group_name: The name of the resource group where the custom image will be created.
- temp_resource_group_name: The name of the temporary resource group used for creating the custom image.
- temp_compute_name: The name of the temporary compute resource used for creating the custom image.
- vm_size: The size of the virtual machine used for creating the custom image.
- install_log_file: The path to the log file where the installation details will be stored.
- dlink_chocolatey: The download link for the Chocolatey package manager.
- dlink_lgpo_tool: The download link for the LGPO tool used for managing local group policies.
- dlink_winsdk: The download link for the Windows SDK.
- dlinks_gdk: The download links for the GDK (Game Development Kit) used for developing games on Windows.
- dlink_pix: The download link for the PIX (Performance Investigator for Xbox) tool used for profiling and debugging DirectX 12 games.
*/
variable "image_offer" {
type = string
default = "office-365"
type = string
}

variable "image_publisher" {
type = string
default = "MicrosoftWindowsDesktop"
type = string
}

variable "image_sku" {
type = string
default = "win10-22h2-avd-m365-g2"
type = string
}

variable "image_version" {
type = string
default = "latest"
type = string
}

variable "artifact_storage_account" {
Expand All @@ -39,13 +57,11 @@ variable "winrm_username" {
}

variable "region" {
type = string
default = "southcentralus"
type = string
}

variable "resource_group_name" {
type = string
default = "rg_gmdv_packer"
type = string
}

variable "temp_resource_group_name" {
Expand Down

0 comments on commit 386f929

Please sign in to comment.