public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Herzig <d.herzig@proxmox.com>
To: Daniel Kral <d.kral@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH qemu-server] api: vmlist: add plugged cpu count to vmlist table
Date: Mon, 13 Jan 2025 10:45:35 +0100	[thread overview]
Message-ID: <87frlnnj28.fsf@proxmox.com> (raw)
In-Reply-To: <20250110170921.204689-1-d.kral@proxmox.com> (Daniel Kral's message of "Fri, 10 Jan 2025 18:09:21 +0100")

I just tested this patch and think it gives very valuable information.

One thing I noticed, more by chance than intentional -- if the host has
a lower cpu-count than the count configured for the VM, the stats will
not be updated. E.g. my pve-host only has 2 cores available and if I
configure 4 cores for the VM, `qm list` will still show 2 cores,
although the VM is actually configured in an unbootable state.

Do you think it's possible to render something like '$NUMBER:
too_many_for_this_host' (or something similar) in this edge case?


Daniel Kral <d.kral@proxmox.com> writes:

> Includes the maximum amount of cpu cores in the vmlist as it
> semantically fits in with the other properties. This allows for a more
> comfortable view of a node's VM configured CPU core counts in general
> and by users of "pvereport" without calculating each core count manually
> with the respective VM's configuration files.
>
> Suggested-by: Hannes Dürr <h.duerr@proxmox.com>
> Signed-off-by: Daniel Kral <d.kral@proxmox.com>
> ---
>  PVE/CLI/qm.pm | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
> index 4214a7ca..389a97d6 100755
> --- a/PVE/CLI/qm.pm
> +++ b/PVE/CLI/qm.pm
> @@ -1124,12 +1124,13 @@ our $cmddef = {
>  	my $vmlist = shift;
>  	exit 0 if (!scalar(@$vmlist));
>  
> -	printf "%10s %-20s %-10s %-10s %12s %-10s\n",
> -	qw(VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID);
> +	printf "%10s %-20s %-10s %-5s %10s %12s %-10s\n",
> +	qw(VMID NAME STATUS CORES MEM(MB) BOOTDISK(GB) PID);
>  
>  	foreach my $rec (sort { $a->{vmid} <=> $b->{vmid} } @$vmlist) {
> -	    printf "%10s %-20s %-10s %-10s %12.2f %-10s\n", $rec->{vmid}, $rec->{name},
> +	    printf "%10s %-20s %-10s %-5s %10s %12.2f %-10s\n", $rec->{vmid}, $rec->{name},
>  	        $rec->{qmpstatus} || $rec->{status},
> +		$rec->{cpus} || 0,
>  	        ($rec->{maxmem} || 0)/(1024*1024),
>  	        ($rec->{maxdisk} || 0)/(1024*1024*1024),
>  	        $rec->{pid} || 0;


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  reply	other threads:[~2025-01-13  9:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10 17:09 Daniel Kral
2025-01-13  9:45 ` Daniel Herzig [this message]
2025-01-17 15:10   ` Daniel Kral
2025-01-17 15:27     ` Thomas Lamprecht
2025-01-17 16:25       ` Daniel Kral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87frlnnj28.fsf@proxmox.com \
    --to=d.herzig@proxmox.com \
    --cc=d.kral@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal