LXC Guest Agent equivalent?

MertsA

New Member
May 30, 2019
20
11
3
I've got a container that I migrated from a VM. It's running Centos 6 on it, but when trying to shutdown the container from ProxMox it just hangs. I can manually shut it down from within the container just fine. How should this be set up in containers that aren't based off of the normal template images? Is there some equivalent to qemu's guest agent?
 
Can you follow the syslog inside the CT to see what happens on CT shutdown from it's point of view?

It could be that the CT init daemon (PID 1) ignore the signal it gets send to by PVE..
 
For anyone else reading this Mr. Lamprecht was spot on, upstart was ignoring SIGPWR. The fix was as simple as adding /etc/init/shutdown.conf and setting up a task to run shutdown -h on power-status-changed. That particular container started out life as a VM and I migrated it to a container instead of starting with one of the CentOS 6 LXC templates in Proxmox.

https://lists.linuxcontainers.org/pipermail/lxc-devel/2012-May/002475.html
 
  • Like
Reactions: t.lamprecht
Hello,

I will also like to know if there is a LXC Guest Agent equivalent, for the purpose of having the CT IP address on the summary, like with VMs
1637236583836.png
 
Last edited:
For containers that could be achieved without a separate agent, they're being isolated in a network namespace using the host kernel after all.

You could open an enhancement request over at https://bugzilla.proxmox.com/
 
  • Like
Reactions: dhcpy
Hello,

This thread is first google result "LXC guest agent addition"

I was hoping for a one click way to copy my container's dhcp IP addressed

As stated in the bugzilla discussion, this is not currently implemented

As a suggestion, you can obtain this information with lxc-info -n <container name>

Example

Code:
root@proxmox:~# lxc-info -n 1001
Name:           1001
State:          RUNNING
PID:            1719379
IP:             192.168.1.135
IP:             192.168.1.184
Link:           veth1001i0
 TX bytes:      67.30 KiB
 RX bytes:      2.05 MiB
 Total bytes:   2.12 MiB
Link:           veth1001i1
 TX bytes:      10.77 MiB
 RX bytes:      3.06 MiB
 Total bytes:   13.83 MiB

Here is what it currently looks like for Summary and Network of an LXC container

1728349829523.png
1728349836819.png

Here is the latest comments on that discussion

Code:
 Jeff 2023-01-11 21:16:30 CET

Also

lxc-info -n <CONTAINER ID>

works well to get the ip

Comment 8 h0tw1r3 2023-02-03 19:49:20 CET

Looked into implementing this today as it would be a very nice feature for using PVE in a deployment development environment where containers are created and destroyed frequently.

My use case is deployment/testing/development with Vagrant and terraform. I can't use Proxmox with either and use dhcp addressing.

Went down a rabbit hole of updating the vagrant-proxmox plugin, only to be hit by this limitation. Without an API endpoint to retrieve the current active IP address, everything must be static... I don't want to manage IP's.

Another use case. Say I have a bunch of users sharing the same Proxmox VE cluster. They have limited permission to PVE, they create a VM but have no idea what the IP address is, and policy requires them to use DHCP. How do they get the current IP without console access to the container, admin on the PVE cluster, or access to the DHCP server?

Pardon me, but the work around's are simply absurd.

Implementing this in the API opens up integrations to manage containers without caveats and workarounds using two of the most popular tools, Vagrant and Terraform.

Comment 9 Leo Nunner 2023-09-13 10:34:50 CEST

Latest version (v2) is on list: https://lists.proxmox.com/pipermail/pve-devel/2023-June/057556.html

Comment 10 Carol Ouellet 2024-05-27 00:14:23 CEST

I'd like to add some life here and remind us that this is still not implemented.
It would still be a very useful addition for quick checks.

Comment 11 Waleed 2024-07-20 18:32:30 CEST

+1
 
  • Like
Reactions: dhcpy

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!