hashicorp / hashicorp/packer-plugin-azure

Ability to specify LUN and Caching for additional Azure data disks on managed image

Open
#19 0 comments 1 reaction 0 assignees View on GitHub
builder/azure enhancement
Dominant language
Go
Stars
63
Forks
103
PR merge metrics
No merged PRs in 30d

Description

_This issue was originally opened by @alexsab1 as hashicorp/packer#6071. It was migrated here as a result of the [Packer plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). The original body of the issue is below._


# Overview

Since version [1.2.2](https://github.com/hashicorp/packer/blob/master/CHANGELOG.md#122-march-26-2018) packer supports building with additional disks.

I tested this new feature by creating a template that creates additional 127GB managed data disk. After I ran the template I found out that packer defaults certain values for data disks:

1. LUN is defaulted to 0. I assume that adding more disks will increment LUN to 1, 2, etc.
2. Caching is set to Read/Write on attached disks.

![image](https://user-images.githubusercontent.com/9371364/37991141-020ee750-31ce-11e8-9835-d4387e592987.png)

# Problem

Once Azure Manager disk is created, it is not possible to change properties of the attached disk in the managed image. For example, [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/image?view=azure-cli-latest) does not offer commands to change property of data disk in managed image. Likewise, Azure Powershell, does not offer cmd-lets to change properties of data disk in managed image. I tired changing Lun via powershell in Azure Cloud Shell and received the following error

![image](https://user-images.githubusercontent.com/9371364/37992013-3fa63d8c-31d0-11e8-980c-daa08acc43ef.png)

1) I need to change LUN from 0 to 1 on a single data disk created with the managed disk using packer version 1.2.2. This is the requirement of the Azure Scale Set infrastructure we run.
2) I also need to set caching to Read-only according to recommendations: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage-performance#disk-caching

# Feature Requested

Enhance packer to allow setting LUN and cache value for data disks before creating managed image.

Contributor guide

Open the contributing guide

Research direction

No files or tests are named; start by locating the Azure managed-image builder code that creates additional data disks and tracing where LUN and caching defaults are assigned. Review the existing configuration and tests around additional disks, then confirm that both values can be supplied before image creation and are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, go
Domain
cloud, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.