-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change LX init environ to container=lxc-smartos
#415
base: master
Are you sure you want to change the base?
Conversation
I don't supposed you can instead get virt-what to detect |
It would be much better if facter can detect SmartOS zones properly. That being the case, I want to wait to see what happens with puppetlabs/facter#2492 before doing anything with this. It would also be good to fix virt-what upstream so that it can properly detect SmartOS. How does facter behave for native (joyent) brand zones currently? (virt-what currently does not detect joyent brand zones.) |
Agreed; I'm looking into that too. I'll switch this PR to
On a base64 zone, # uname -a
SunOS test 5.11 joyent_20220310T212952Z i86pc i386 i86pc illumos
# facter is_virtual
true
# facter virtual
zone
# facter hypervisors
{
zone => {
brand => "native",
id => 5,
ip_type => "excl",
name => "a8a13f1a-…",
uuid => "a8a13f1a-…"
}
}
# facter os
{
architecture => "i86pc",
family => "Solaris",
hardware => "i86pc",
name => "Solaris",
release => {
full => "5.11",
major => "5",
minor => "11"
}
}
# facter kernelversion
joyent_20220310T212952Z |
I submitted https://listman.redhat.com/archives/virt-tools-list/2022-May/017562.html to |
THANK YOU! I hope the folks up in virt-what are open and accepting of this. Please keep us informed. (Also, this should work for OmniOS's LX as well, and I'll let Andy F, Dominik, and friends know about this.) |
Thanks for the ping @danmcd, and thanks @smokris for doing the work here. There are at least three illumos distributions that have LX zones, so perhaps it would be better to use |
@citrus-it +1 for your proposal. |
Sure, that sounds good to me. I'll update the patches. In the |
Summary
virt-what is a script to identify what type of virtualization is in use.
Running
virt-what
1.20 on an LX zone outputslxc
— not exactly true, but close enough for our purposes.However, running
virt-what
1.21+ on an LX zone outputs nothing (i.e. bare-metal) — very wrong. ❌What changed in
virt-what
That is, previously, if PID 1's environment contained a variable named
container
, it would identify the system as LXC. This test matches SmartOS LX zones sincelxinit.c
setscontainer=zone
.But now it also checks that the value begins with
lxc
, so SmartOS LX zones no longer match.Background
We use Puppet to manage our LX zones, and Puppet's Facter component calls
virt-what
to determine which rules to apply to the zones. A few days ago, CentOS Stream 8 updatedvirt-what
to perform thecontainer=lxc
check. Puppet tries to apply bare-metal configuration to non-bare-metal systems, which wreaks havoc.Fix
I propose changing SmartOS LX environment variable
container=zone
tocontainer=lxc-smartos
.virt-what
(and thus Puppet Facter) regressionvirt-what
, but I still think it would be helpful isvirt-what
returned a better resultsystemd-detect-virt
still returns the samecontainer-other
value (this was the reason SmartOS LX added thecontainer=zone
environment variable in the first place — 1, 2)Test
✅ virt-what-1.20 + SmartOS 20220421T000508Z
❌ virt-what-1.21 + SmartOS 20220421T000508Z
✅ virt-what-1.21 + local build with this MR