Repository navigation
4.12 add host fail ,using tls connection #3509
Description
ISSUE TYPE
- Other
COMPONENT NAME
INSTALL
CLOUDSTACK VERSION
4.12
CONFIGURATION
advanced networking
OS / ENVIRONMENT
CentOS7.6
SUMMARY
I am an experience user of cloudstack , we built enterprise private cloud in cloudstack two years .
now we test the new 4.12 version for update .
we install management ok.
install agent in hypervisor ok.
but we encounter an issue when add first zone. one of step is add host, 4.12 using tls comucation with agent and manager, but libvirtd connect error , tls can't work ,the host note as "alert" in MGRUI.
we reinstall cloudstack-agent and libvirtd , same error
we configure libvirtd with tcp ,not tls , can add but show unscure ,then click "prevission host key" , restart agent , error show again
we checked the /var/log/message for libvirtd log , no especial info there.
some times , keep "alert" state , about one or two hours later , the first host added ,and show in "UP" ,why? but it turn back "alert" state when restart management.
we checked all tls certificate exists.
the key log when add a host, if no error log then host state turn "UP" :
2019-07-23 01:11:24,309 ERROR [kvm.resource.LibvirtConnection] (Agent-Handler-1:null) (logid:) Connection with libvirtd is broken: invalid connection pointer in virConnectGetVersion
full log when agent first add to zone:
2019-07-23 01:07:30,306 INFO [utils.nio.NioClient] (main:null) (logid:) Connecting to localhost:8250
2019-07-23 01:07:30,306 WARN [utils.nio.NioConnection] (main:null) (logid:) Unable to connect to remote: is there a server running on port 8250
2019-07-23 01:07:35,307 INFO [cloud.agent.Agent] (main:null) (logid:) Connecting to host:localhost
2019-07-23 01:07:35,308 INFO [utils.nio.NioClient] (main:null) (logid:) Connecting to localhost:8250
2019-07-23 01:07:35,313 WARN [utils.nio.NioConnection] (main:null) (logid:) Unable to connect to remote: is there a server running on port 8250
2019-07-23 01:07:38,229 INFO [cloud.agent.Agent] (AgentShutdownThread:null) (logid:) Stopping the agent: Reason = sig.kill
2019-07-23 01:08:50,219 INFO [cloud.agent.AgentShell] (main:null) (logid:) Agent started
2019-07-23 01:08:50,221 INFO [cloud.agent.AgentShell] (main:null) (logid:) Implementation Version is 4.12.0.0
2019-07-23 01:08:50,222 INFO [cloud.agent.AgentShell] (main:null) (logid:) agent.properties found at /etc/cloudstack/agent/agent.properties
2019-07-23 01:08:50,235 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to using properties file for storage
2019-07-23 01:08:50,236 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to the constant time backoff algorithm
2019-07-23 01:08:50,246 INFO [cloud.utils.LogUtils] (main:null) (logid:) log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml
2019-07-23 01:08:50,254 INFO [cloud.agent.AgentShell] (main:null) (logid:) Using default Java settings for IPv6 preference for agent connection
2019-07-23 01:08:50,355 INFO [cloud.agent.Agent] (main:null) (logid:) id is
2019-07-23 01:08:50,357 WARN [cloud.resource.ServerResourceBase] (main:null) (logid:) Nics are not specified in properties file/db, will try to autodiscover
2019-07-23 01:08:50,361 INFO [cloud.resource.ServerResourceBase] (main:null) (logid:) Designating private to be nic cloudbr0
2019-07-23 01:08:50,374 INFO [kvm.resource.LibvirtConnection] (main:null) (logid:) No existing libvirtd connection found. Opening a new one
2019-07-23 01:08:50,529 INFO [org.reflections.Reflections] (main:null) (logid:) Reflections took 26 ms to scan 1 urls, producing 7 keys and 10 values
2019-07-23 01:08:50,541 INFO [kvm.resource.LibvirtComputingResource] (main:null) (logid:) No libvirt.vif.driver specified. Defaults to BridgeVifDriver.
2019-07-23 01:08:50,646 INFO [cloud.agent.Agent] (main:null) (logid:) Agent [id = new : type = LibvirtComputingResource : zone = default : pod = default : workers = 5 : host = localhost : port = 8250
2019-07-23 01:08:50,650 INFO [utils.nio.NioClient] (main:null) (logid:) Connecting to localhost:8250
2019-07-23 01:08:50,651 WARN [utils.nio.NioConnection] (main:null) (logid:) Unable to connect to remote: is there a server running on port 8250
2019-07-23 01:08:55,652 INFO [cloud.agent.Agent] (main:null) (logid:) Connecting to host:localhost
2019-07-23 01:08:55,655 INFO [utils.nio.NioClient] (main:null) (logid:) Connecting to localhost:8250
2019-07-23 01:08:55,656 WARN [utils.nio.NioConnection] (main:null) (logid:) Unable to connect to remote: is there a server running on port 8250
2019-07-23 01:09:00,539 INFO [cloud.agent.Agent] (AgentShutdownThread:null) (logid:) Stopping the agent: Reason = sig.kill
2019-07-23 01:09:00,657 INFO [cloud.agent.Agent] (main:null) (logid:) Connecting to host:localhost
2019-07-23 01:09:00,659 INFO [utils.nio.NioClient] (main:null) (logid:) Connecting to localhost:8250
2019-07-23 01:09:00,660 WARN [utils.nio.NioConnection] (main:null) (logid:) Unable to connect to remote: is there a server running on port 8250
2019-07-23 01:09:07,634 INFO [cloud.agent.AgentShell] (main:null) (logid:) Agent started
2019-07-23 01:09:07,637 INFO [cloud.agent.AgentShell] (main:null) (logid:) Implementation Version is 4.12.0.0
2019-07-23 01:09:07,638 INFO [cloud.agent.AgentShell] (main:null) (logid:) agent.properties found at /etc/cloudstack/agent/agent.properties
2019-07-23 01:09:07,649 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to using properties file for storage
2019-07-23 01:09:07,651 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to the constant time backoff algorithm
2019-07-23 01:09:07,661 INFO [cloud.utils.LogUtils] (main:null) (logid:) log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml
2019-07-23 01:09:07,672 INFO [cloud.agent.AgentShell] (main:null) (logid:) Using default Java settings for IPv6 preference for agent connection
2019-07-23 01:09:07,773 INFO [cloud.agent.Agent] (main:null) (logid:) id is
2019-07-23 01:09:07,774 WARN [cloud.resource.ServerResourceBase] (main:null) (logid:) Nics are not specified in properties file/db, will try to autodiscover
2019-07-23 01:09:07,778 INFO [cloud.resource.ServerResourceBase] (main:null) (logid:) Designating private to be nic cloudbr0
2019-07-23 01:09:07,795 INFO [kvm.resource.LibvirtConnection] (main:null) (logid:) No existing libvirtd connection found. Opening a new one
2019-07-23 01:11:23,438 INFO [cloud.agent.AgentShell] (main:null) (logid:) Agent started
2019-07-23 01:11:23,440 INFO [cloud.agent.AgentShell] (main:null) (logid:) Implementation Version is 4.12.0.0
2019-07-23 01:11:23,440 INFO [cloud.agent.AgentShell] (main:null) (logid:) agent.properties found at /etc/cloudstack/agent/agent.properties
2019-07-23 01:11:23,450 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to using properties file for storage
2019-07-23 01:11:23,451 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to the constant time backoff algorithm
2019-07-23 01:11:23,460 INFO [cloud.utils.LogUtils] (main:null) (logid:) log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml
2019-07-23 01:11:23,470 INFO [cloud.agent.AgentShell] (main:null) (logid:) Using default Java settings for IPv6 preference for agent connection
2019-07-23 01:11:23,562 INFO [cloud.agent.Agent] (main:null) (logid:) id is
2019-07-23 01:11:23,579 INFO [kvm.resource.LibvirtConnection] (main:null) (logid:) No existing libvirtd connection found. Opening a new one
2019-07-23 01:11:23,721 INFO [org.reflections.Reflections] (main:null) (logid:) Reflections took 26 ms to scan 1 urls, producing 7 keys and 10 values
2019-07-23 01:11:23,732 INFO [kvm.resource.LibvirtComputingResource] (main:null) (logid:) No libvirt.vif.driver specified. Defaults to BridgeVifDriver.
2019-07-23 01:11:23,833 INFO [cloud.agent.Agent] (main:null) (logid:) Agent [id = new : type = LibvirtComputingResource : zone = 1 : pod = 1 : workers = 5 : host = 192.168.100.1 : port = 8250
2019-07-23 01:11:23,836 INFO [utils.nio.NioClient] (main:null) (logid:) Connecting to 192.168.100.1:8250
2019-07-23 01:11:23,840 INFO [utils.nio.Link] (main:null) (logid:) Conf file found: /etc/cloudstack/agent/agent.properties
2019-07-23 01:11:24,242 INFO [utils.nio.NioClient] (main:null) (logid:) SSL: Handshake done
2019-07-23 01:11:24,242 INFO [utils.nio.NioClient] (main:null) (logid:) Connected to 192.168.100.1:8250
2019-07-23 01:11:24,305 INFO [kvm.storage.LibvirtStorageAdaptor] (Agent-Handler-1:null) (logid:) Attempting to create storage pool 36380b99-39b5-48e3-9202-6d69a3efabe1 (Filesystem) in libvirt
2019-07-23 01:11:24,309 ERROR [kvm.resource.LibvirtConnection] (Agent-Handler-1:null) (logid:) Connection with libvirtd is broken: invalid connection pointer in virConnectGetVersion
2019-07-23 01:11:24,310 WARN [kvm.storage.LibvirtStorageAdaptor] (Agent-Handler-1:null) (logid:) Storage pool 36380b99-39b5-48e3-9202-6d69a3efabe1 was not found running in libvirt. Need to create it.
2019-07-23 01:11:24,311 INFO [kvm.storage.LibvirtStorageAdaptor] (Agent-Handler-1:null) (logid:) Didn't find an existing storage pool 36380b99-39b5-48e3-9202-6d69a3efabe1 by UUID, checking for pools with duplicate paths
2019-07-23 01:11:24,314 INFO [kvm.storage.LibvirtStorageAdaptor] (Agent-Handler-1:null) (logid:) Trying to fetch storage pool 36380b99-39b5-48e3-9202-6d69a3efabe1 from libvirt
2019-07-23 01:11:35,629 INFO [cloud.serializer.GsonHelper] (Agent-Handler-1:null) (logid:) Default Builder inited.
STEPS TO REPRODUCE
add host ->input ip -> host add
EXPECTED RESULTS
add host
ACTUAL RESULTS
host added , but show alert, can't work, the problem at libvirtd tls connection
Activity
yadvr commentedon Jul 23, 2019
Check firewall rules on the mgmt server and ensure agent can connect to mgmt server on port 8250. Next, ensure while adding kvm host the user/password can ssh from mgmt server to kvm host and can execute sudo. On kvm host while adding the host by default it will configure libvirtd to be tls enabled. This error seems to be libvirtd related: Connection with libvirtd is broken: invalid connection pointer in virConnectGetVersion. Can you try to restart libvirtd and agent?
digitalgust commentedon Jul 23, 2019
all hosts firewalld was disabled.
agent can connect to mgmt 8250 .
ssh from mgmt to agent ok.
restarted and reinstall multiple times.
yadvr commentedon Jul 23, 2019
@digitalgust looks like an issue or configuration issue with libvirtd. Can you try to get the latest or try qemu-ev on centos7? Please check that libvirtd is running, you can try something like virsh list etc.
digitalgust commentedon Jul 23, 2019
libvirtd is running.
this vm is running on the host , i can startup a vm when host02 state is "UP", but if restart agent or manager,the host02 state turn "alert" .
yadvr commentedon Jul 23, 2019
Could be related to this #2904
@digitalgust does agent go into Up state when you restart the kvm agent? (systemctl restart cloudstack-agent ?) Can you test 4.11.3.0?
digitalgust commentedon Jul 23, 2019
now , my host02 state is "alert"
log :
digitalgust commentedon Jul 23, 2019
let me try 4.11.3.0
digitalgust commentedon Jul 25, 2019
test 4.11.3.0, the problem same as 4.12
hypervisor add unreliable ,
i have 2 hosts for hypervisor in my test environment.
add fisrst host , it always shown "alert“, then remove the first host, mgmt note success message, then add the second host, second show "alert" ,!!! the first host turn "UP", but the first host is success deleted a momont ago.
or keep it for serial hours in "alert" state, the host turn "UP".
when host in "alert" state, agent cant't connect to mgmt, but in the host ping mgmt normal, and mgmt
port 8250 is working, the same time , there is another host in "UP" state .
i can abstractly confirm the host's network is connectable .
Puzzling .
this is agent log ,the host in "alert" state
yadvr commentedon Jul 25, 2019
Are you running multiple management server(s) are starting them concurrently @digitalgust ? Can you also share details about your env, like number of secondary and primary storages, networking etc?
I'll test against 4.11.2.0 and 4.11.3.0.
digitalgust commentedon Jul 25, 2019
1 mgmt : centos 7.6 /intel7500U/2G 192.168.100.1 /2nic
1 secondary : centos 7.6 / intel7500U/2G 192.168.100.20 /1nic
2 Hypervisor : centos 7.6/ intel8559U8259U/8G 192.168.100.50,192.168.100.51 /libvirtd 4.5/qemu2.9
2 ceph: centos 7.6 /intel8259U/8G 192.168.100.10,192.168.100.11 ceph 14
cloudstack 4.12 / 4.11.3.0
advance network
KVM
guest CIDR 10.1.1.0/16
manage_network & storage_network on cloudbr0 connect to hardware switch 0
public_newwork & guest_network on cloudbr1 connect to hardware switch 1
public traffic: gateway 10.0.99.254, 255.255.0.0 start ip:10.0.99.100 end ip :10.0.99.199
pod: gateway 192.168.100.254, mask 255.255.255.0 reserve ip : 192.168.100.100-192.168.100.199
vlan : 1000-1009
storage traffic: gateway192.168.100.254, start ip: 192.168.100.10- 192.168.100.19
host : 192.168.100.50
primary storage : nfs or ceph both work 4.12, ceph dont work 4.11.3
secondary storage: nfs work
yadvr commentedon Jul 27, 2019
Thanks @digitalgust I'm unable to reproduce. The issue seems to be with libvirt or qemu, kindly check libvirt/qemu logs.
digitalgust commentedon Jul 29, 2019
I reinstall cloudstack ,it works with these changes :
exchange cloudbr0 /cloudbr1 bridge to physic nic, maybe unrelated that .
uninstall qemu2.9 and reinstall centos7 qemu (1.53) , maybe the problem cause.
after reinstall , agent connect to mgmt quickly.
7 remaining items
andrijapanicsb commentedon Nov 27, 2019
qemu-kvm-ev 2.12.x (latest) is not working with 4.13 and master - SSVMs can not start - but user VMs can start fine.
I also couldn't make it work when downgraded to qemu-kvm-ev 2.10.x
@weizhouapache
wqmeng commentedon Nov 27, 2019
@andrijapanicsb
It should be qemu-kvm,
[root@localhost ~]# qemu-img --version
qemu-img version 1.5.3, Copyright (c) 2004-2008 Fabrice Bellard
usage: qemu-img command [command options]
I install the latest CentOS 7.7, and before install cloudstack 4.13.0, I yum -y upgrade and upgrade all the system. And then install the cloudstack agent from yum after add the repo of http://download.cloudstack.org/centos/$releasever/4.13/
andrijapanicsb commentedon Nov 27, 2019
Actually... I had that identical error with qemu-kvm-ev - I think I created an issue yesterday here...
wqmeng commentedon Nov 28, 2019
I have also tried the cloudstack 4.14.0 in the github, and still get this error.
Should this been configure by some port?Or set TLS or instead use TCP?
Do I miss something?
wqmeng commentedon Nov 28, 2019
And in the server side, shows
But I setup the NIC manually in the agent side.
wqmeng commentedon Dec 10, 2019
Hi,
I think my problem is because by the management traffic is tagged with VLAN_ID, while currently cloudstack do not support management traffic with VLAN_ID, I see that in the Physical Network configuration, select management, the Broadcast Domain Type can only be Native, it may not change to VLAN.
Maybe we can get the management traffic work with a VLAN tagged traffic?
When I change the management traffic go to untagged from my switch, everything get back to work.
I will try to test more.
andrijapanicsb commentedon Dec 10, 2019
That might be the problem, yes.
You can always tag the traffic via the bridge/physical interface itself, and then simply tell ACS to use untagged traffic, while specifying the correct "KVM Traffic Label" which should be the name of your bridge (i.e. cloudbr0 or whatever is the existing name of the bridge) -
Explanation: when ACS is using "unttagged" traffic, it will simply stick any VNET interface to whatever bridge you are using/having existing. (FYI if you use i.e. tagged traffic, then ACS would USUALLY extract the child interface of the bridge that is defined via "KVM traffic label" and then create an VLAN interface on top of this child inteface, then create additional bridge and join this vlan interface and any VNET interfaces to this bridge)
Your fix - what you want to do is the following:
On the lower level, you will have your VLAN interface (i.e. eth0.100) joined to the bridge (i.e. cloudbr0)
Thus, based on the ACS behaviour to use untagged traffic, ACS willl just "stick" the VNET to the bridge (cloudbr0), while the traffic towards your physical network will be tagged by your existing eth0.100 interface.
That's the "proper" way to do it, and achieve VLAN tagging (if required by your underlying switch setup/infra)
shoaibjdev commentedon Dec 27, 2019
It seems CloudStack agent module is still broken, have tried 4.11.x.x, 4.12.x.x and 4.13.x.x
It fails during addition of Host from the UI.
OS: RHEL 7.7 (Maipo)
OS Repo: rhel-7-server-rpms/7Server/x86_64
qemu-kvm: 1.5.3
libvirt: 4.5.0
Tried multiple times with clean Red Hat latest OS installation, subscribed and updated repos still fails at addition of Agent Host with errors below:
Management Server:
2019-12-27 11:49:07,512 WARN [c.c.a.m.AgentManagerImpl] (AgentConnectTaskPool-2:ctx-266bf136) (logid:284f2ed7) Monitor NetworkOrchestrator says there is an error in the connect process for 1 due to Unable to get an answer to the CheckNetworkCommand from agent: 1
Agent:
Connection with libvirtd is broken: invalid connection pointer in virConnectGetVersion
Also noted, there is no issue with KVM/QeMU or libvirt as plain virtual machines just works fine, without any errors in libvirtd/kvm logs. After CloudStack Management server tries to update the configuration for Agent host, it messes up something on the libvirt/qemu/kvm configs which am still not able to figure out.
Reproduce:
Can someone from CloudStack community kindly reproduce this and assist to get the root cause?
andrijapanicsb commentedon Dec 27, 2019
@shoaibjdev you need to post logs, but there is nothing broken per my experience in 4.11+ people are running huge installations. Perhaps it's some environmental issue - that message you shared "invalid connection pointer in virConnectGetVersion" I've seen as well, but my agents were working fine (can't advise why it's there)
Please post agent logs during the time of the setup (on pastebin.com or some external service), so we can see.
And these kind of discussions are more suitable for the mailing list, I guess.
shoaibjdev commentedon Dec 30, 2019
@andrijapanicsb Please find the logs below
https://we.tl/t-wjmJjUQSQT
NOTE: I was not able to upload on pastebin or similar services due to size limitation. So i used wetransfer which retains the file upto 1 week
andrijapanicsb commentedon Dec 30, 2019
@shoaibjdev you have added host with IP 192.168.0.20, but once your host was connecting to the mgmt server, it was connecting from 192.168.0.25 IP address ???
2019-12-30 14:28:47,100 DEBUG [o.a.c.c.p.RootCACustomTrustManager] (pool-7-thread-1:null) (logid:) Client/agent connection from ip=192.168.0.25 has been validated and trusted.
...
Alternative Names:[[7, 192.168.0.20], [7, fe80:0:0:0:20c:29ff:fec9:aa8a], [7, fe80:0:0:0:20c:29ff:fec9:aa94], [7, 192.168.0.25], [7, 192.168.122.1], [2, 192.168.0.20]]
...
You have network misconfiguration in your environment - if adding a host with ip x.y.z.20 make sure that this host is connecting from that IP to the mgmt server - mgmt server has no idea "who" the host with IP x.y.z.25 is...
andrijapanicsb commentedon Dec 30, 2019
(and you've tested using ACS 4.13, not 4.12) - topic closed.
shoaibjdev commentedon Jan 11, 2020
@andrijapanicsb Thank you for the advise, in fact it was environmental issue with the switch, and have been corrected. We managed to setup ACS 4.12 and it works great.
This error should be ignored "invalid connection pointer in virConnectGetVersion", doesn't impact ACS setup.
scrollsyou commentedon Oct 16, 2023
I also encountered this problem, but after checking qemu, I found that the qemu-guest-agent component was missing. Just yum install qemu-guest-agent.