Skip to content

How to get a specific ip address #304

Closed Answered by bpg
clumbo asked this question in Q&A
Apr 17, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey @clumbo! 👋🏼

If you take an example from #211 (comment) and add something like

output "vm_ip" {
  value = proxmox_virtual_environment_vm.ubuntu_vm.ipv4_addresses[1]
}

Then it will print out IP(s) of eth0

Outputs:

vm_ip = tolist([
  "10.x.x.x",
])

(ipv4_addresses[0] is a lo interface)

It worth to mention that you'd need to have qemu-guest-agent installed on your VM and enabled in the template in order to let PVE read the network configuration of the VM.

Alternatively you can use a static IP with the VM.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@clumbo
Comment options

Answer selected by clumbo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants