OpenVZ /cluster/resources returning incomplete info

Qian Chen

Member
Jul 14, 2015
22
0
21
I have a few Proxmox nodes, yesterday, I upgraded them all to 3.4-11. Today I found one of the node is not showing OpenVZ node correctly in the Proxmox UI. Then I did a bit investigation and found this missing information is from Proxmox API /cluster/resources. Then I tried to run pvesh get /cluster/resources from the node in problem, I got:

Screen Shot 2015-09-26 at 12.07.20 AM.png

Code:
[COLOR=#444444]# pvesh get /cluster/resources[/COLOR]
[COLOR=#444444]200 OK[/COLOR]
[COLOR=#444444][[/COLOR]
[COLOR=#444444]{[/COLOR]
[COLOR=#444444]"id" : "openvz/127",[/COLOR]
[COLOR=#444444]"node" : "pve",[/COLOR]
[COLOR=#444444]"type" : "openvz",[/COLOR]
[COLOR=#444444]"vmid" : 127[/COLOR]
[COLOR=#444444]},[/COLOR]
[COLOR=#444444]{[/COLOR]
[COLOR=#444444]"id" : "openvz/118",[/COLOR]
[COLOR=#444444]"node" : "pve",[/COLOR]
[COLOR=#444444]"type" : "openvz",[/COLOR]
[COLOR=#444444]"vmid" : 118[/COLOR]
[COLOR=#444444]},[/COLOR]
[COLOR=#444444]{[/COLOR]
[COLOR=#444444]"id" : "openvz/206",[/COLOR]
[COLOR=#444444]"node" : "pve",[/COLOR]
[COLOR=#444444]"type" : "openvz",[/COLOR]
[COLOR=#444444]"vmid" : 206[/COLOR]
[COLOR=#444444]},[/COLOR]
[COLOR=#444444]...[/COLOR]
[COLOR=#444444]][/COLOR]

Then I went to a normal node and run the same command, I got this:
Code:
[COLOR=#444444]# pvesh get /cluster/resources[/COLOR]
[COLOR=#444444]200 OK[/COLOR]
[COLOR=#444444][[/COLOR]
[COLOR=#444444]{[/COLOR]
[COLOR=#444444]"cpu" : 0.000220895604811133,[/COLOR]
[COLOR=#444444]"disk" : 774914048,[/COLOR]
[COLOR=#444444]"diskread" : 0,[/COLOR]
[COLOR=#444444]"diskwrite" : 0,[/COLOR]
[COLOR=#444444]"id" : "openvz/124",[/COLOR]
[COLOR=#444444]"maxcpu" : 1,[/COLOR]
[COLOR=#444444]"maxdisk" : 5368709120,[/COLOR]
[COLOR=#444444]"maxmem" : 268435456,[/COLOR]
[COLOR=#444444]"mem" : 42786816,[/COLOR]
[COLOR=#444444]"name" : "hostname1",[/COLOR]
[COLOR=#444444]"netin" : 237953,[/COLOR]
[COLOR=#444444]"netout" : 153381,[/COLOR]
[COLOR=#444444]"node" : "fr000",[/COLOR]
[COLOR=#444444]"status" : "running",[/COLOR]
[COLOR=#444444]"template" : 0,[/COLOR]
[COLOR=#444444]"type" : "openvz",[/COLOR]
[COLOR=#444444]"uptime" : 3809,[/COLOR]
[COLOR=#444444]"vmid" : 124[/COLOR]
[COLOR=#444444]},[/COLOR]
[COLOR=#444444]{[/COLOR]
[COLOR=#444444]"cpu" : 0.000220895608544508,[/COLOR]
[COLOR=#444444]"disk" : 2063126528,[/COLOR]
[COLOR=#444444]"diskread" : 0,[/COLOR]
[COLOR=#444444]"diskwrite" : 0,[/COLOR]
[COLOR=#444444]"id" : "openvz/122",[/COLOR]
[COLOR=#444444]"maxcpu" : 2,[/COLOR]
[COLOR=#444444]"maxdisk" : 42949672960,[/COLOR]
[COLOR=#444444]"maxmem" : 2147483648,[/COLOR]
[COLOR=#444444]"mem" : 634228736,[/COLOR]
[COLOR=#444444]"name" : "hostname2",[/COLOR]
[COLOR=#444444]"netin" : 34106,[/COLOR]
[COLOR=#444444]"netout" : 33882,[/COLOR]
[COLOR=#444444]"node" : "fr000",[/COLOR]
[COLOR=#444444]"status" : "running",[/COLOR]
[COLOR=#444444]"template" : 0,[/COLOR]
[COLOR=#444444]"type" : "openvz",[/COLOR]
[COLOR=#444444]"uptime" : 3827,[/COLOR]
[COLOR=#444444]"vmid" : 122[/COLOR]
[COLOR=#444444]},[/COLOR]
[COLOR=#444444]...[/COLOR]
[COLOR=#444444]][/COLOR]

So apparently the node in question does not return enough information about OpenVZ containers.
 
Last edited:
Thanks for reply. It is running:

# service pvestatd status
running
# service pvestatd start
Starting PVE Status Daemon: pvestatdstart failed - can't aquire lock '/ var / run / pvestatd.pid.lock' - daemon already started (pid = 3383)
(warning).

I even restarted the node server. It still doesn't work. All the vms seem to be running without any problem except that /cluster/resources returns incomplete information for OpenVZ.

I put space in the path because the forum says:
The following errors occurred with your submission


  • You are not allowed to post any kinds of links, images or videos until you post a few times.
 
Apparently the API failed to fetch more details about the OpenVZ containers. So where does the API get the running status info of the OpenVZ containers? From database? Or from files? I believe the OpenVZ running status info is frequently updated as it contains CPU, disk and memory usage info. The node in problem seems to only fetched the very basic container info, like id, node, type and vmid, but it doesn't get CPU, disk or memory usage info.
 
Problem found, but not solved yet. I found one of the container shows:

[FONT=tahoma, arial, verdana, sans-serif]Error unable to parse config line: HOSTNAME="vpn_cn.yoctobox.com" (500)[/FONT]

[FONT=tahoma, arial, verdana, sans-serif]Then I temporarily removed that line from [/FONT]/etc/pve/nodes/pve/openvz/130.conf. All OpenVZ containers were shown correctly. It seems this file is broken.
 
I found the problem, but not resolved yet. I found an error message from the GUI when I select a container:

Error unable to parse config line: HOSTNAME="vpn_cn.yoctobox.com" (500)

Then I temporarily removed that line from
/etc/pve/nodes/pve/openvz/130.conf, then refresh the GUI, all nodes were shown correctly. It seems the problem is on parsing this file.

Whew, duplicate post. When I replied the first time, the forum redirected me to the login page. So I type all things again. But I didn't know the first time the post was successful. I apologize for the duplicate post.
 
Last edited:
Now I can reproduce the problem. It turned out when there is an underscore in the hostname, it guarantees to fail.
 
Problem solved by removing the underscore. Not sure how that underscore ended up in that file.
 

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!