-
Notifications
You must be signed in to change notification settings - Fork 543
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
v3.0.1-rc3: IP not found and agent_timeout not being used #1106
Comments
Test without Cloud-init (
Also,
Not sure if that's the correct way to NOT use Cloud-init though. |
Found the commit that most likely broke it. 18095e5#diff-104365919f693375882979581d9f36f5266991eef361948e56c220931fe886ddL1916 |
terraform-provider-proxmox/proxmox/resource_vm_qemu.go Lines 1970 to 1994 in a9a0bad
However, it the log your showed does show the information in it's raw form. terraform-provider-proxmox/proxmox/resource_vm_qemu.go Lines 1965 to 1968 in a9a0bad
Upstream I'm working on re-implementingthe network interfaces to get rid of this regex parsing of the MAC address on L1966. |
@Tinyblargon How do I tell terraform/opentofu to use your branch? I only see |
about |
@arty-hlr when you compile the branch, the compiled binary has to be renamed to |
Hi @Tinyblargon, that didn't work, I had to change the .terraformrc to add a filesystem mirror, unfortunately that's not mentioned anywhere in the docs. I just ran a test with your branch and unfortunately it still doesn't work, here's the relevant part of the output: It seems that looping over |
Checking if i have the correct situation.
The error is telling me that |
@Tinyblargon The same happens with I'm actually not sure why it says |
The code here https://github.com/Telmate/terraform-provider-proxmox/blob/master/proxmox/resource_vm_qemu.go#L1935 seems to indicate that this shouldn't happen when |
@arty-hlr made some changes and tested locally. |
Sorry for the late answer, will do today and let you know |
@Tinyblargon Unfortunately same problem with the latest release (rc6) 😢 the provider couldn't get the IP of one of the VMs even though it was up and showed an IP on proxmox. Here the next test run, I was checking the VMs in proxmox as they were created and all 5 got an IP and displayed it, somehow the provider couldn't find the IP for 3 of them: |
@arty-hlr could you set the |
They have a This is the full terraform file for a windows VM we use, if that helps: terraform {
required_providers {
proxmox = {
source = "telmate/proxmox"
version = "3.0.1-rc6"
}
}
}
resource "proxmox_vm_qemu" "windows-vm" {
name = var.name
target_node = var.proxmox_host
clone = var.template
full_clone = "false"
agent = 1
agent_timeout = 3600
os_type = "cloud-init"
cores = 4
sockets = 1
cpu_type = "host"
bios = "ovmf"
memory = 4096
scsihw = "virtio-scsi-pci"
bootdisk = "scsi0"
pool = var.pool
skip_ipv6 = "true"
disks {
sata {
sata0 {
disk {
size = "128G"
storage = "loc_pve-xxx_r1"
emulatessd = true
discard = true
}
}
}
}
network {
id = 0
model = "virtio"
bridge = var.nic_name
tag = var.vlan_num
}
lifecycle {
ignore_changes = [
network,
]
}
} |
@arty-hlr Could you check if the debug logs show the following errors? It will show the raw data of the |
@Tinyblargon So, I think we're getting closer. This is how it looks like when the IP is found: and this is when the IP is not found: Here's the whole log file: https://gist.github.com/arty-hlr/6c25344a04e9fcfdebcbb02c5a1830f5 For me it looks like the qemu guest agent returns a temporary IP address (169.254.XXX.XXX) which is then not parsed correctly somehow. I'd suggest maybe waiting until an actual private IP is returned by the qemu guest agent? |
@arty-hlr |
@Tinyblargon 169.254.xxx.xxx, yes. When I look at the VM in proxmox in real time, I usually see a second or so with that IP before the actual IP is given by the DHCP server. It could be a "slow" race condition between when the provider checks and when the IP is given? Then maybe checking if the IP is in 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16 could be worth doing? But that implies it's supposed to be a private IP though. Then maybe just ignoring 169.254.xxx.xxx would be better? Just throwing ideas |
@arty-hlr After doing some more research these are |
@Tinyblargon Yes exactly. Do you mean they should already be ignored, or it should be fixed so that they are? From what I can see it is reported by |
@arty-hlr it should be fixed so they are ignored. |
Contrary to the PR #1016 and to what the documentation https://registry.terraform.io/providers/telmate/proxmox/3.0.1-rc3/docs/resources/vm_qemu says,
agent_timeout
is not being used, which results in VMs being created and then the following error:I do use
agent_timeout
in the module:but it's not being shown in the plan output:
The only difference with previous templates I tried to clone is that there is now SSH installed. I am not sure why it cannot find the IP address as it shows it in the GUI. I would expect
agent_timeout
to help, as the error suggests, but it does not do anything unfortunately. It also sometimes work on one VM or the other, pretty randomly as it seems, so doing multipleterraform apply
helps, kinda.Here is the full output with TF_VAR_LOG=DEBUG:
To reproduce:
agent_timeout
The text was updated successfully, but these errors were encountered: