coreos / bugs

Issue tracker for CoreOS Container Linux
https://coreos.com/os/eol/
147 stars 30 forks source link

XenServer Tools is unable to report CoreOS' VM IP address to parent XenServer #2596

Open sanmigit opened 5 years ago

sanmigit commented 5 years ago

Issue Report

XenServer Tools is unable to report CoreOS' VM IP address to the XenServer host: Permission Denied.

Bug

CoreOS VM's XenServer Tools agent fails to register itself with host XenServer. This means there is no IP address shown in Networking tab, resulting in inability to enable Docker management (along with any other functionality, when a connection from XenServer to VM is required), due to XenServer being unable to connect to host VM.

Container Linux Version

NAME="Container Linux by CoreOS" ID=coreos VERSION=2079.6.0 VERSION_ID=2079.6.0 BUILD_ID=2019-06-11-0821 PRETTY_NAME="Container Linux by CoreOS 2079.6.0 (Rhyolite)" ANSI_COLOR="38;5;75" HOME_URL="https://coreos.com/" BUG_REPORT_URL="https://issues.coreos.com" COREOS_BOARD="amd64-usr"

Environment

Xenserver 7.2 Updates to E017 Container Management 1.0

Expected Behavior

CoreOS boots XenServer Tools agent starts - no errors XenCenter shows 'Virtualization state: Optimized (version 7.2 installed)' in VM's General tab XenCenter shows IP address(es) related to VM in Networking tab XenCenter is able to turn on Docker management via an SSH connection

Actual Behavior

CoreOS boots XenServer Tools agent starts - no errors XenCenter shows 'Virtualization state: Optimized (version 7.1 installed)' in VM's General tab XenCenter missing IP address(es) related to VM in Networking tab XenCenter is not able to turn on Docker management via an SSH connection. Failing due to missing IP address.

Reproduction Steps

1.Boot CoreOS from ISO image with a default cloud-config 2.Open XenCenter, navigate to VM's Networking tab

Other Information

cloud-config hostname: %VMNAMETOHOSTNAME% ssh_authorized_keys:

ajeddeloh commented 5 years ago

Is this new with that release or does it also affect older versions?

sanmigit commented 5 years ago

No idea... I just stumbled on it on a new installation. For what I could google, seems related to #1563 and #2158 which where closed without positive confirmation of the proposed solution...

longdoan commented 4 years ago

I know for sure that it works on CoreOS stable (1465.6.0) (Ladybug), so it must have been re-broken sometime after that. It has the same error in the logs though, so I'm going to suggest that it's a different bug:

[root@xcp01 ~]# xe vm-list name-label=core01 params=name-label,networks name-label ( RW) : core01 networks (MRO): 0/ip: 172.16.1.131

core@core01 ~ $ uname -a Linux core01 4.12.7-coreos #1 SMP Tue Aug 15 23:54:56 UTC 2017 x86_64 Intel(R) Xeon(R) CPU E5645 @ 2.40GHz GenuineIntel GNU/Linux core@core01 ~ $ strace -tt -T -s 1024 -f xenstore read name 01:58:00.387352 execve("/usr/bin/xenstore", ["xenstore", "read", "name"], [/ 24 vars /]) = 0 <0.000197> 01:58:00.387798 brk(0) = 0x82d2d83000 <0.000022> 01:58:00.387916 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f31397a6000 <0.000028> 01:58:00.388023 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) <0.000026> 01:58:00.388121 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 <0.000029> 01:58:00.388220 fstat(3, {st_mode=S_IFREG|0644, st_size=30332, ...}) = 0 <0.000023> 01:58:00.388368 mmap(NULL, 30332, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f313979e000 <0.000027> 01:58:00.388449 close(3) = 0 <0.000022> 01:58:00.388548 open("/lib64/libxenstore.so.3.0", O_RDONLY|O_CLOEXEC) = 3 <0.000033> ... ... 01:58:00.393278 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0 <0.000022> 01:58:00.393404 stat("/var/run/xenstored/socket", 0x7ffdca6d69a0) = -1 ENOENT (No such file or directory) <0.000033> 01:58:00.393515 stat("/proc/xen/xenbus", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0 <0.000029> 01:58:00.393639 open("/proc/xen/xenbus", O_RDWR) = -1 EACCES (Permission denied) <0.000027> 01:58:00.393745 write(2, "xenstore: ", 10xenstore: ) = 10 <0.000031> 01:58:00.393843 write(2, "xs_open", 7xs_open) = 7 <0.000031> 01:58:00.393937 write(2, ": ", 2: ) = 2 <0.000031> 01:58:00.394041 write(2, "Permission denied\n", 18Permission denied ) = 18 <0.000022> 01:58:00.394139 exit_group(1) = ? 01:58:00.394288 +++ exited with 1 +++

longdoan commented 4 years ago

Here are the difference I found, between core01 (works) and core03 (doesn't work):

core@core01 ~ $ cat /etc/lsb-release DISTRIB_ID="Container Linux by CoreOS" DISTRIB_RELEASE=1465.6.0 DISTRIB_CODENAME="Ladybug" DISTRIB_DESCRIPTION="Container Linux by CoreOS 1465.6.0 (Ladybug)" core@core01 ~ $ sudo xenstore list attr eth0 PVAddons core@core01 ~ $


core@core03 ~ $ cat /etc/lsb-release DISTRIB_ID="Container Linux by CoreOS" DISTRIB_RELEASE=2191.5.0 DISTRIB_CODENAME="Rhyolite" DISTRIB_DESCRIPTION="Container Linux by CoreOS 2191.5.0 (Rhyolite)" core@core03 ~ $ sudo xenstore list attr PVAddons core@core03 ~ $


Notice how eth0 is missing from core03's listing.

longdoan commented 4 years ago

A few more diffs... It looks like the newer versions of CoreOS have reveretd back to an older version of xentools.


core@core01 ~ $ grep DESCRIPTION /etc/lsb-release DISTRIB_DESCRIPTION="Container Linux by CoreOS 1465.6.0 (Ladybug)" core@core01 ~ $ sudo -s core01 core # xenstore list attr eth0 PVAddons core01 core # xenstore read attr/eth0/ip 172.16.1.131 core01 core # xenstore list attr/PVAddons MajorVersion MinorVersion MicroVersion BuildVersion Installed core01 core # xenstore read attr/PVAddons/MajorVersion 6 core01 core # xenstore read attr/PVAddons/MinorVersion 5 core01 core # exit


core@core03 ~ $ grep DESCRIPTION /etc/lsb-release DISTRIB_DESCRIPTION="Container Linux by CoreOS 2191.5.0 (Rhyolite)" core@core03 ~ $ sudo -s core03 core # xenstore list attr PVAddons core03 core # xenstore list attr/PVAddons MajorVersion MinorVersion MicroVersion core03 core # xenstore read attr/PVAddons/MajorVersion 6 core03 core # xenstore read attr/PVAddons/MinorVersion 2 core03 core # exit

longdoan commented 4 years ago

Got 2191.5.0 to work, the xe-linux-distribution.service was missing the XE_UPDATE_GUEST_ATTRS environment (see below)


- name: xe-linux-distribution.service
  command: start
  content: |
    [Unit]
    Description=Hypervisor Linux Guest Agent
    After=docker.service

    [Service]
    ExecStartPre=/media/configdrive/agent/xe-linux-distribution /var/cache/xe-linux-distribution
    Environment="XE_UPDATE_GUEST_ATTRS=/media/configdrive/agent/xe-update-guest-attrs"
    ExecStart=/media/configdrive/agent/xe-daemon