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

Differencing VHD and size #274

Open
dh2i-sam opened this issue Jul 25, 2024 · 0 comments
Open

Differencing VHD and size #274

dh2i-sam opened this issue Jul 25, 2024 · 0 comments

Comments

@dh2i-sam
Copy link

It looks like the hyperv provider does not allow differencing VHDX images to be created with a size specified.

I have a collection of "golden master" VHDX images that are relatively small, e.g. an Ubuntu image that is 8GB. Using PS scripts, I create VMs with differencing images based on the master images, and the differencing images are typically much larger, 64-128GB. Hyper-V most certainly allows this, at least on Windows Server 2022.

The hyperv provider would be more useful if it allowed this use case.

Terraform Version

Terraform v1.9.3
on windows_amd64
+ provider registry.terraform.io/taliesins/hyperv v1.2.1

Affected Resource(s)

  • hyperv_vhd

Terraform Configuration Files

resource "hyperv_vhd" "web_server_vhd" {
  path = "c:\\web_server\\web_server_g2.vhdx"
  parent_path          = "C:\\Hyper-V\\BASE-JAMMY.vhdx"
  size = 10737418240 #10GB
}

Debug Output

│ Error: Conflicting configuration arguments
│
│   with hyperv_vhd.web_server_vhd,
│   on main.tf line 19, in resource "hyperv_vhd" "web_server_vhd":
│   19:   parent_path          = "C:\\Hyper-V\\BASE-JAMMY.vhdx"
│
│ "parent_path": conflicts with size
╵
╷
│ Error: Conflicting configuration arguments
│
│   with hyperv_vhd.web_server_vhd,
│   on main.tf line 20, in resource "hyperv_vhd" "web_server_vhd":
│   20:   size = 10737418240 #10GB
│
│ "size": conflicts with parent_path

Important Factoids

  • Hyper-V on Windows Server 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant