Is there a way to detect that my VMs run on proxmox?

eviatars-chkp

New Member
Nov 18, 2024
7
0
1
Hey.
I have 2 Labs: one for Proxmox and second deployed with another hypervisor based on KVM
I have a VMs in each labs.

Is there a way to detect if a VM belongs to the Proxmox datacenter and get the VM’s IP address?

I know I can install qemu-guest-agent on the VMs, but is there another way to check it without using the agent?

During my research, I found that I can use systemd-detect-virt or dmidecode but they both return "kvm" as result (so I can't distinguish between my two datacenters).

thanks
 
Hey,
if the VM is Linux based, have a look at /dev/kmsg
On PVE you should find entries like QEMU Standard PC and QEMU HARDDISK

Or have a look at https://github.com/kernelwernel/VMAware for the detection.

and get the VM’s IP address?
I dont understand this part, I thought you were connected to the vm, which implies you know the IP.
 
Last edited:
well then you could always assign the first 127 IP addresses in the subnet to one set of VMs and the second 127 IP addresses to the other set of VMs. Its a bit of manual effort, but it will get you what you need.
 
  • Like
Reactions: Kingneutron
Is there a way to detect if a VM belongs to the Proxmox datacenter and get the VM’s IP address?
The first part can be solved by just adding the information to the SMBIOS in the VM settings. This can be done manually or via a script.
I don't get the second part. The hypervisor knows the ip addresses if the guest-agent is installed and the VM itself does also now it's own address. If you want to detect the IP of the hypervisor, you can't do that automatically.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!