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

Allow OS disks up to 4095GB #9202

Merged
merged 1 commit into from
Nov 9, 2020
Merged

Allow OS disks up to 4095GB #9202

merged 1 commit into from
Nov 9, 2020

Conversation

sudomateo
Copy link
Contributor

A virtual machine or virtual machine scale set can have an OS disk size up to 4095GB. Currently, the azurerm provider limits the OS disk size to 2048GB. This pull request raises that value to 4095GB.

Unfortunately, at the time of this writing the Azure API documentation for osDisk.diskSizeGB states the following.

Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

This value cannot be larger than 1023 GB

However, I was able to use the az CLI to create both a virtual machine and a virtual machine scale set with an OS disk up to 4095GB in size.

Here's the az command I used to create the virtual machine.

az vm create --name ${NAME} --resource-group ${RG} --image UbuntuLTS --size Standard_D32as_v4 --admin-username ${USER} --ssh-key-values "${SSH_PUB}" --vnet-name ${VNET} --subnet ${SUBNET} --os-disk-size-gb 4095 --os-disk-caching None

Here's the az command I used to create the virtual machine scale set.

az vmss create --name ${NAME} --resource-group ${RG} --image UbuntuLTS --instance-count 1 --vm-sku Standard_D32as_v4 --admin-username ${USER} --ssh-key-values "${SSH_PUB}" --vnet-name ${VNET} --subnet ${SUBNET} --os-disk-size-gb 4095 --os-disk-caching None

Whenever I attempted to create a virtual machine or a virtual machine scale set with an OS disk over 4095GB in size, I received the following error.

ValidationError: Deployment failed. Correlation ID: redacted. {
  "error": {
    "code": "InvalidParameter",
    "message": "The value 4096 of parameter 'osDisk.diskSizeGB' is out of range. The value must be between '1' and '4095', inclusive.",
    "target": "osDisk.diskSizeGB"
  }
}

@ghost ghost added the size/XS label Nov 7, 2020
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

LGTM _ thanks for this @sudomateo

@tombuildsstuff tombuildsstuff added this to the v2.36.0 milestone Nov 9, 2020
@tombuildsstuff tombuildsstuff merged commit 18ebe07 into hashicorp:master Nov 9, 2020
tombuildsstuff added a commit that referenced this pull request Nov 9, 2020
@ghost
Copy link

ghost commented Nov 12, 2020

This has been released in version 2.36.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.36.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Dec 9, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants