-
Notifications
You must be signed in to change notification settings - Fork 82
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
"hard_disk_drives" path not being able to read the correct variable value #205
Comments
I am trying to narrow down the scope of the problem, but I am not sure if I am encountering more issues or if the root cause is the same. For now, I am not using the "hyperv_machine_instance" resource and just observing what the "hyperv_vhd" resource can do for me. I replaced all path variables with their values and expected to clone the "Windows Server 2022" template to the "D:/VM/test" directory and create a file called "test.vhdx". However, the execution result was unexpected, and the error message is as follows: │ Error: [ERROR][hyperv][read] path argument is required
│
│ with hyperv_vhd.vm_vhd,
│ on main.tf line 38, in resource "hyperv_vhd" "vm_vhd":
│ 38: resource "hyperv_vhd" "vm_vhd" {
│ During the execution process, I saw that the Windows Server 2022 template was being exported to the "D:/VM/test" directory on the Hyper-V host. However, every time the export reached 100% completion, the directory for the Windows Server 2022 template would disappear. This also caused the error message to mention that it could not read the path for "hyperv_vhd.vm_vhd". If you need me to provide any other details, please let me know. |
I have another question. Is this possible? |
The provider should be able to set Guest OS parameters however the provider would need to be updated for this. In the meantime you could use something like Ansible and Packer to achieve this. Before I started using this provider I was using Ansible to build Hyper-V VM's. Using Hashicorp Packer you could set static IP's in the autounattend.xml file and then use Ansible to connect to and configure the VM |
I have just hit this same issue, was there any work around or progress made |
Hi there,
Thank you for developing this project, which helps me integrate Terraform with Hyper-V.
In my environment, I am cloning a VM template based on your example,
here: https://github.com/taliesins/terraform-provider-hyperv/blob/master/examples/clone-existing-vm/main.tf
But in my environment, I encountered the following error when running the command:
![image](https://user-images.githubusercontent.com/32199735/236157881-4f8e92ab-70ee-4333-8c44-c732b3834c53.png)
It seems like the error is caused by the "hard_disk_drives" path not being able to read the correct variable value of "D:\VM\test\test.vhdx".
Terraform Version
Affected Resource(s)
resource "hyperv_vhd"
resource "hyperv_machine_instance"
Terraform Configuration Files
Debug Output
Expected Behavior
Based on the contents of your tf file, you expect the following results:
Clone the "Windows Server 2022" template to the directory "D:/VM/test"
Create a file called "test.vhdx"
Create a "hyperv_machine_instance" and reference the path to the "hyperv_vhd.vm_vhd.path" in the "hard_disk_drives"
Finally, I should have a VM named "test", which is a clone of the "Windows Server 2022" template.
Actual Behavior
"hard_disk_drives" path not being able to read the correct variable value
Steps to Reproduce
terraform apply
Here are the configurations I have made and my environment information.
Please let me know if there is any other information I can provide.
BTW
BTW, the Requirements section on the project homepage mentions that Terraform version 1.29.x is needed. However, the latest version of Terraform is 1.4.6, so you may be referring to version 0.29.x instead, right?
![image](https://user-images.githubusercontent.com/32199735/235626774-1f9f8200-6730-44b8-9ea6-b45b6ec16839.png)
The text was updated successfully, but these errors were encountered: