terraform-provider-proxmox: v3.0.1-rc2: Stuck on still creating

First of all I would like to thank you for such a great job in creating this provider for Proxmox, it rocks!

With that said I’m currently have one issue stopping me for using it fully. I’m trying to deploy some VMs with v3.0.1-rc2 but the the provider hangs in “Still creating…”.

The VM is created successfully in Proxmox but the terraform script hangs for about 9m10s with the message “Still creating…”, before it eventually stops with this error: Error: cannot find any IP address

I am not using cloud-init and the os_type is set to “Linux 6.x - 2.6 Kernel”. Agent is activated with agent = 1.

After some debugging of the provider it seems that the error stems from the VM not receiving an ipv6 address (which is to be expected since ipv6 is not configured).

I have tried to set skip_ipv6=true but this doesn’t help (the value is ignored). Is this setting only available for cloud-init configurations? If I change hasRequiredIP to the below in heper_qemu.go it works as expected.

func (conn connectionInfo) hasRequiredIP() bool {
	if conn.IPs.IPv4 != "" || conn.IPs.IPv6 != "" {
		return true
	}	
	return true
	// if conn.IPs.IPv4 == "" && !conn.SkipIPv4 || conn.IPs.IPv6 == "" && !conn.SkipIPv6 {
	// 	return false
	// }
	// return true
}

I’m not so well versed with all the details in this provider but why must both ipv4 and ipv6 be mandatory. Is it not enough if one of them is set?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18

Commits related to this issue

Most upvoted comments

I also ran into the issue of Error: cannot find any IP address using v3.01-rc2 when deploying more than one VM using terraform count. The VM’s however got IPv4 and IPv6 just fine and they also get reported via Proxmox UI. No issues seen when running with count=1.

Plan: 12 to add, 0 to change, 0 to destroy.
module.appstack.time_offset.exp_time: Creating...
module.appstack.time_offset.exp_time: Creation complete after 0s [id=2024-05-26T13:34:40Z]
volterra_token.site: Creating...
module.appstack.volterra_k8s_cluster.appstack: Creating...
volterra_token.site: Creation complete after 0s [id=d06cdd5f-2699-4282-bb2e-3622b0fc92cb]
module.appstack.proxmox_cloud_init_disk.asm-ci[1]: Creating...
module.appstack.proxmox_cloud_init_disk.asm-ci[0]: Creating...
module.appstack.proxmox_cloud_init_disk.asm-ci[0]: Creation complete after 0s [id=cephfs:iso/tf-ci-mw-appstack-1-m0.iso]
module.appstack.proxmox_cloud_init_disk.asm-ci[1]: Creation complete after 0s [id=cephfs:iso/tf-ci-mw-appstack-1-m1.iso]
module.appstack.proxmox_vm_qemu.asm-vm[1]: Creating...
module.appstack.proxmox_vm_qemu.asm-vm[0]: Creating...
module.appstack.volterra_k8s_cluster.appstack: Creation complete after 1s [id=0fda4834-0996-4e7c-8e95-34da8caa97fa]
module.appstack.proxmox_vm_qemu.asm-vm[1]: Still creating... [10s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[0]: Still creating... [10s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[0]: Still creating... [20s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[1]: Still creating... [20s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[0]: Still creating... [30s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[1]: Still creating... [30s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[1]: Still creating... [40s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[0]: Still creating... [40s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[0]: Still creating... [50s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[1]: Still creating... [50s elapsed]
module.appstack.proxmox_vm_qemu.asm-vm[0]: Still creating... [1m0s elapsed]
╷
│ Error: cannot find any IP address
│
│   with module.appstack.proxmox_vm_qemu.asm-vm[0],
│   on proxmox/appstack_master_vm.tf line 1, in resource "proxmox_vm_qemu" "asm-vm":
│    1: resource "proxmox_vm_qemu" "asm-vm" {
│
╵
╷
│ Error: cannot find any IP address
│
│   with module.appstack.proxmox_vm_qemu.asm-vm[1],
│   on proxmox/appstack_master_vm.tf line 1, in resource "proxmox_vm_qemu" "asm-vm":
│    1: resource "proxmox_vm_qemu" "asm-vm" {
│

Long story short, when I build and use https://github.com/Telmate/terraform-provider-proxmox/pull/1016, it works:

module.appstack[0].time_offset.exp_time: Creating...
module.appstack[0].time_offset.exp_time: Creation complete after 0s [id=2024-05-26T14:15:57Z]
module.appstack[0].proxmox_cloud_init_disk.asm-ci[1]: Creating...
module.appstack[0].volterra_k8s_cluster.appstack: Creating...
module.appstack[0].proxmox_cloud_init_disk.asm-ci[2]: Creating...
module.appstack[0].proxmox_cloud_init_disk.asm-ci[0]: Creating...
module.appstack[0].volterra_k8s_cluster.appstack: Creation complete after 1s [id=df02092c-dbd4-45b8-bccc-d0ff6886fae4]
module.appstack[0].proxmox_cloud_init_disk.asm-ci[2]: Creation complete after 2s [id=cephfs:iso/tf-ci-mw-appstack-1-m2.iso]
module.appstack[0].proxmox_cloud_init_disk.asm-ci[0]: Creation complete after 2s [id=cephfs:iso/tf-ci-mw-appstack-1-m0.iso]
module.appstack[0].proxmox_cloud_init_disk.asm-ci[1]: Creation complete after 2s [id=cephfs:iso/tf-ci-mw-appstack-1-m1.iso]
module.appstack[0].proxmox_vm_qemu.asm-vm[2]: Creating...
module.appstack[0].proxmox_vm_qemu.asm-vm[1]: Creating...
module.appstack[0].proxmox_vm_qemu.asm-vm[0]: Creating...
module.appstack[0].proxmox_vm_qemu.asm-vm[1]: Creation complete after 10s [id=prox1/qemu/101]
module.appstack[0].proxmox_vm_qemu.asm-vm[0]: Creation complete after 10s [id=prox1/qemu/100]
module.appstack[0].proxmox_vm_qemu.asm-vm[2]: Still creating... [10s elapsed]
module.appstack[0].proxmox_vm_qemu.asm-vm[2]: Still creating... [20s elapsed]
module.appstack[0].proxmox_vm_qemu.asm-vm[2]: Still creating... [30s elapsed]
module.appstack[0].proxmox_vm_qemu.asm-vm[2]: Still creating... [40s elapsed]
module.appstack[0].proxmox_vm_qemu.asm-vm[2]: Creation complete after 44s [id=prox1/qemu/102]
module.appstack[0].volterra_voltstack_site.appstack: Creating...
module.appstack[0].volterra_voltstack_site.appstack: Creation complete after 1s [id=97264239-f830-469a-b44e-a5db6975207b]
module.appstack[0].module.site_wait_for_online.null_resource.check_site_status_token[0]: Creating...
module.appstack[0].volterra_registration_approval.master[1]: Creating...
module.appstack[0].volterra_registration_approval.master[0]: Creating...
module.appstack[0].module.site_wait_for_online.null_resource.check_site_status_token[0]: Provisioning with 'local-exec'...
. . . 

I now understand whats happening here. Before we update the VM we read the current config of the VM, during this read step the error occurs. Because the error occurs during the read step, non of the new settings have been applied. Therefore you cannot influence how this step behaves.

Being unable to obtain an IP should give a warning instead of an error. This was changed everywhere except for: https://github.com/Telmate/terraform-provider-proxmox/blob/be2585614955f7ada0433c9a1fe34e604bb717cd/proxmox/resource_vm_qemu.go#L1886

could you try with #1016