diff --git a/example/resource_virtual_environment_vm.tf b/example/resource_virtual_environment_vm.tf index e06284b35..720cb21eb 100644 --- a/example/resource_virtual_environment_vm.tf +++ b/example/resource_virtual_environment_vm.tf @@ -41,6 +41,10 @@ resource "proxmox_virtual_environment_vm" "example_template" { network_device {} + network_device { + vlan_id = 1024 + } + node_name = data.proxmox_virtual_environment_nodes.example.names[0] operating_system { diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index 52a004e80..dcafac656 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -396,6 +396,7 @@ func (c *VirtualEnvironmentClient) WaitForNetworkInterfacesFromVMAgent(ctx conte if err == nil && data != nil && data.Result != nil { missingIP := false + hasAnyGlobalUnicast := false if waitForIP { for _, nic := range *data.Result { @@ -408,21 +409,15 @@ func (c *VirtualEnvironmentClient) WaitForNetworkInterfacesFromVMAgent(ctx conte break } - hasGlobalUnicast := false for _, addr := range *nic.IPAddresses { if ip := net.ParseIP(addr.Address); ip != nil && ip.IsGlobalUnicast() { - hasGlobalUnicast = true + hasAnyGlobalUnicast = true } } - if !hasGlobalUnicast { - missingIP = true - break - } - } } - if !missingIP { + if hasAnyGlobalUnicast || !missingIP { return data, err } }