Bug #6728
Facter improperly detects openvzve on CloudLinux systems
| Status: | Closed | Start date: | 03/16/2011 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | library | |||
| Target version: | 1.6.2 | |||
| Keywords: | openvz | Affected Facter version: | 1.6.1 | |
| Branch: | https://github.com/barn/facter/tree/ticket/next/6728-facter_improperly_detects_openvzve_on_cloudlinux_systems | |||
| Votes: | 1 |
Description
Facter 1.5.8 uses following algorithm to diagnose OpenVZ VE:
def self.openvz?
FileTest.directory?("/proc/vz")
end
def self.openvz_type
return nil unless self.openvz?
if FileTest.exists?("/proc/vz/version")
result = "openvzhn"
else
result = "openvzve"
end
end
But, since CloudLinux internally based on portions of OpenVZ, then this check will fail and improperly report openvzve on CloudLinux hardware node: Linux localhost.localdomain 2.6.18-294.26.1.el5.lve0.8.18PAE #1 SMP Thu Feb 24 12:58:52 EET 2011 i686 i686 i386 GNU/Linux $ ls -l /proc/vz total 0 $ ls -l /proc/user_beancounters -r———— 1 root root 0 Mar 16 10:35 /proc/user_beancounters
I suggest to check presence of /proc/vz/veinfo in addition to /proc/vz.
Related issues
History
Updated by Ben Hughes about 1 year ago
- Status changed from Unreviewed to Investigating
Is this for the virtual fact?
Is CloudLinux not just a distro running atop of openvz?
Updated by MaxiM Basunov about 1 year ago
Ben Hughes wrote:
Is this for the virtual fact?
is_virtual improperly set to “true”, must be “false” virtual improperly set to “openvzve”, must be “physical”
Is CloudLinux not just a distro running atop of openvz?
No… Portions based on VZ, so /proc/user_beancounters present and directory /proc/vz present. But no VZ tools, no other files in /proc/vz/… So, CloudLinux host is not an VZVE.
CloudLinux position itself as “lightweight virtual environment (LVE)”: – LVE is an isolation technology that increases server density, stability and reliability. LVE limits the amount of resources (CPU, I/O and memory) available to a specific process or customer. It is a lightweight and transparent shell. LVE wraps the accounts on a shared server to give hosting providers control over CPU resources.
So, LVE has no containers in terms of VZ, and it always run on physical host.
Updated by MaxiM Basunov about 1 year ago
Any updates?
Updated by Ben Hughes about 1 year ago
- Status changed from Investigating to Tests Insufficient
Cool.
Thanks for those pointers. I now have a test branch that can tell them apart.
Is parsing /etc/redhat-release the best way to tell if a sysadmin is a Cloudlinux system?
I need to update the unit tests, then go from there.
Updated by Ben Hughes about 1 year ago
- Status changed from Tests Insufficient to In Topic Branch Pending Review
- Branch set to https://github.com/barn/facter/tree/ticket/next/6728-facter_improperly_detects_openvzve_on_cloudlinux_systems
If you’d be so kind as to test it on your systems to see if it works for you, please check out https://github.com/barn/facter/tree/ticket/next/6728-facter_improperly_detects_openvzve_on_cloudlinux_systems
Thanks.
Updated by MaxiM Basunov about 1 year ago
Is parsing /etc/redhat-release the best way to tell if a sysadmin is a Cloudlinux system?
No. System is still “CentOS release 5.5 (Final)” from /etc/redhat-release.
Updated by Ben Hughes about 1 year ago
I didn’t change the operatingsystem value as there’s current a discussion about that in https://projects.puppetlabs.com/issues/6679 and possible breakage people will suffer when changing that value when they rely on it being a certain value, and then changing it under their feet.
That discussion is at https://projects.puppetlabs.com/issues/6792 too.
Updated by MaxiM Basunov about 1 year ago
If you’d be so kind as to test it on your systems to see if it works for you, please check out https://github.com/barn/facter/tree/ticket/next/6728-facter_improperly_detects_openvzve_on_cloudlinux_systems
I just patched one of our CL systems with your patch, and confirm that it is working properly:
# uname -r
2.6.18-294.26.1.el5.lve0.8.18
# facter -p virtual is_virtual
is_virtual => false
virtual => physical
Thank you. Awaiting for release.
Updated by MaxiM Basunov about 1 year ago
I didn’t change the operatingsystem value as there’s current a discussion about that in https://projects.puppetlabs.com/issues/6679 and possible breakage people will suffer when changing that value when they rely on it being a certain value, and then changing it under their feet.
We also point our logic to analyze for words RedHat/CentOS in operatingsystem, so we don’t require for such major changes.
Updated by Ben Hughes about 1 year ago
- Status changed from In Topic Branch Pending Review to Merged - Pending Release
Updated by Ben Hughes about 1 year ago
Great. Thanks for testing it.
I fear it won’t make it in until 1.6.0 as we’re in release candidate stages for 1.5.9.
Updated by Max Martin about 1 year ago
Merged into next branch in commit:8353506ea5705a58ed4bf91283e475751fb5f77c
Updated by Christian Hofstaedtler 12 months ago
Guys, this broke OpenVZ VE detection. /proc/vz/veinfo does not exist in VEs, so virtual will now never return “openvzve”.
Updated by Michael Renner 12 months ago
Please check #2242, Christian outlined a rock-solid solution for solving the OpenVZ detection once and for all.
As for Cloudlinux – using OpenVZ, having a CentOS release tag and expecting that this is detected as something discrete is somewhat amusing. Please don’t ride on side-effects to have your detection work, OpenVZ is already big in this game :/.
Updated by Ben Hughes 12 months ago
- Status changed from Merged - Pending Release to Accepted
Dang. I tested this on my openvz machine, to see it didn’t break it, but clearly not well enough. Thanks for spotting this then.
What openvz platform/distro are you (you general openvz using world) using then please so I can make our testing better.
Updated by Michael Renner 12 months ago
The main distributions would be
RHEL/CentOS through third party kernels and userland tool, for both OpenVZ and Virtuozzo (commercial variant)
and
Debian, ships with kernels and tools which are co-maintained by Debian and OpenVZ upstream developers; supports only OpenVZ
Both Ubuntu Server and SuSE never shipped a release with OpenVZ support to my knowledge, thirdparty support exists, in doubt expect behavior similar to Debian and RHEL respectively.
Updated by Ben Hughes 12 months ago
- Assignee set to Ben Hughes
Updated by Ben Hughes 12 months ago
- Status changed from Accepted to Needs Decision
Right guys, so I’m working on this.
https://github.com/barn/facter/tree/ticket%2F1.5.9%2F6728-facter_improperly_detects_openvzve_on_cloudlinux_systems
Is the latest stab. I’ve tested it locally on my Debian/OpenVZ machine and Cloudlinux machine and it seems to do the right thing. I’m using the /proc/self/status tests too, so that should be more reliable.
There’s commentary at http://groups.google.com/group/puppet-dev/browse_thread/thread/7ce9c79ba9cad92d and if people would be so kind to throw their small denomination coins in to that too, that would be great. Thanks.
Updated by Ben Hughes 12 months ago
- Status changed from Needs Decision to In Topic Branch Pending Review
- Target version set to 1.6.0
Updated by Michael Stahnke 11 months ago
- Target version changed from 1.6.0 to 1.6.x
Updated by Michael Renner 11 months ago
Thanks Ben, this looks good and should cover us for now. We’ll see where all this container business ventures in the future ;)
Updated by James Turnbull 9 months ago
- Category set to library
Updated by Mike Becker 8 months ago
currently openvz systems with 2.6.32 doesn’t have /proc/vz/veinfo left. Probably relying on /proc/user_beancounters would be a good idea
Updated by Ken Barber 8 months ago
- Status changed from In Topic Branch Pending Review to Merged - Pending Release
- Keywords set to openvz
- Affected Facter version set to 1.6.1
Updated by Michael Stahnke 7 months ago
- Status changed from Merged - Pending Release to Closed
- Target version changed from 1.6.x to 1.6.2
Released as part of 1.6.2