Skip to content

cannot add new host to cluster  #8310

Closed

Description

@shulemmosko
  • Bug Report

Cloudstack-agent

version 4.18.1.0

Im using shapeblue repository.
servers are running latest version of Ubuntu.

Im trying to add a new host but it fails, on the management server there is not error or failure.
in the agent.log I got the following.

2023-12-05 16:03:32,884 INFO [cloud.agent.AgentShell] (main:null) (logid:) Agent started
2023-12-05 16:03:32,888 INFO [cloud.agent.AgentShell] (main:null) (logid:) Implementation Version is 4.18.1.0
2023-12-05 16:03:32,890 INFO [cloud.agent.AgentShell] (main:null) (logid:) agent.properties found at /etc/cloudstack/agent/agent.properties
2023-12-05 16:03:32,942 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to using properties file for storage
2023-12-05 16:03:32,942 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to the constant time backoff algorithm
2023-12-05 16:03:32,994 INFO [cloud.utils.LogUtils] (main:null) (logid:) log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml
2023-12-05 16:03:32,995 INFO [cloud.agent.AgentShell] (main:null) (logid:) Using default Java settings for IPv6 preference for agent connection
2023-12-05 16:03:33,094 INFO [cloud.agent.Agent] (main:null) (logid:) id is
2023-12-05 16:03:33,108 ERROR [kvm.resource.LibvirtComputingResource] (main:null) (logid:) uefi properties file not found due to: Unable to find file uefi.properties.
2023-12-05 16:03:33,165 INFO [kvm.resource.LibvirtComputingResource] (main:null) (logid:) Failed to find passphrase for keystore: cloud.jks
2023-12-05 16:03:33,170 INFO [kvm.resource.LibvirtConnection] (main:null) (logid:) No existing libvirtd connection found. Opening a new one
2023-12-05 16:03:33,299 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent:
com.cloud.utils.exception.CloudRuntimeException: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.configure(LibvirtComputingResource.java:1076)
at com.cloud.agent.Agent.(Agent.java:190)
at com.cloud.agent.AgentShell.launchNewAgent(AgentShell.java:452)
at com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:431)
at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:415)
at com.cloud.agent.AgentShell.start(AgentShell.java:511)
at com.cloud.agent.AgentShell.main(AgentShell.java:541)

EXPECTED RESULTS

the host to be added to the cluster.

ACTUAL RESULTS

in the management GUI when im trying to add the host its not giving an error nor does it give a confirmation.

Activity

  1. boring-cyborg commented on Dec 5, 2023

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  2. rajujith commented on Dec 6, 2023

    @rajujith
    Contributor

    @shulemmosko have you verified all the dependencies for KVM are installed and libvirtd is running? Which distribution and version you are using?

  3. shulemmosko commented on Dec 6, 2023

    @shulemmosko
    Author

    @rajujith

    Yes, as far as I know, all the dependencies are running.

    Ubuntu Focal fully up-to-date
    and using the latest release of Cloudstack 4.18.1.0

    The following line of the log looks to me as the issue, but I'm not sure.
    [kvm.resource.LibvirtComputingResource] (main:null) (logid:) Failed to find passphrase for keystore: cloud.jks

    Thank you!

  4. shulemmosko commented on Dec 7, 2023

    @shulemmosko
    Author

    So for now i ended up downgrading the agent to 4.17.2.0

    so I'm running the management on 4.18.1.0 and agents on 4.17.2.0

    this combination is working fine now.

  5. rajujith commented on Dec 7, 2023

    @rajujith
    Contributor

    @shulemmosko mismatching versions of the management server and agent could give you other issues.

  6. shulemmosko commented on Dec 7, 2023

    @shulemmosko
    Author

    @rajujith the issue is that i cant downgrade the management without restoring the previous database that was running under 4.17

  7. weizhouapache commented on Dec 8, 2023

    @weizhouapache
    Member

    [kvm.resource.LibvirtComputingResource] (main:null) (logid:) Failed to find passphrase for keystore: cloud.jks

    @shulemmosko
    this is just a warning message, no issues found caused by it.

  8. weizhouapache commented on Dec 8, 2023

    @weizhouapache
    Member

    @shulemmosko
    it looks libvirt does not work

    2023-12-05 16:03:33,299 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent:
    com.cloud.utils.exception.CloudRuntimeException: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
    

    can you check if virsh list command works ?

  9. shulemmosko commented on Dec 8, 2023

    @shulemmosko
    Author

    yes virsh list works fine, and im actually running vm's on it.

  10. shulemmosko commented on Dec 8, 2023

    @shulemmosko
    Author

    @weizhouapache @rajujith

    i just tried upgrading one host again to 4.18 and it does not connect. this time I'm not getting the libvirt error

    2023-12-08 14:27:20,667 INFO [cloud.agent.AgentShell] (main:null) (logid:) Agent started
    2023-12-08 14:27:20,671 INFO [cloud.agent.AgentShell] (main:null) (logid:) Implementation Version is 4.18.1.0
    2023-12-08 14:27:20,673 INFO [cloud.agent.AgentShell] (main:null) (logid:) agent.properties found at /etc/cloudstack/agent/agent.properties
    2023-12-08 14:27:20,724 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to using properties file for storage
    2023-12-08 14:27:20,725 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to the constant time backoff algorithm
    2023-12-08 14:27:20,775 INFO [cloud.utils.LogUtils] (main:null) (logid:) log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml
    2023-12-08 14:27:20,776 INFO [cloud.agent.AgentShell] (main:null) (logid:) Using default Java settings for IPv6 preference for agent connection
    2023-12-08 14:27:20,871 INFO [cloud.agent.Agent] (main:null) (logid:) id is 1220
    2023-12-08 14:27:20,885 ERROR [kvm.resource.LibvirtComputingResource] (main:null) (logid:) uefi properties file not found due to: Unable to find file uefi.properties.
    2023-12-08 14:27:20,940 INFO [kvm.resource.LibvirtComputingResource] (main:null) (logid:) Failed to find passphrase for keystore: cloud.jks
    2023-12-08 14:27:20,944 INFO [kvm.resource.LibvirtConnection] (main:null) (logid:) No existing libvirtd connection found. Opening a new one
    2023-12-08 14:27:21,211 INFO [kvm.resource.LibvirtComputingResource] (main:null) (logid:) IO uring driver for Qemu: disabled
    2023-12-08 14:27:21,296 INFO [kvm.storage.KVMStoragePoolManager] (main:null) (logid:) adding storage adaptor for com.cloud.hypervisor.kvm.storage.LinstorStorageAdaptor
    2023-12-08 14:27:21,300 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent:
    com.cloud.utils.exception.CloudRuntimeException: java.lang.reflect.InvocationTargetException
    at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.(KVMStoragePoolManager.java:119)
    at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.configure(LibvirtComputingResource.java:1151)
    at com.cloud.agent.Agent.(Agent.java:190)
    at com.cloud.agent.AgentShell.launchNewAgent(AgentShell.java:452)
    at com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:431)
    at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:415)
    at com.cloud.agent.AgentShell.start(AgentShell.java:511)
    at com.cloud.agent.AgentShell.main(AgentShell.java:541)

    only the "failed to find passphrase for keystore"

  11. shulemmosko commented on Dec 8, 2023

    @shulemmosko
    Author

    @weizhouapache @rajujith

    The Passphrase is in the agent.properties file and the cloud.jks is in /etc/cloudstack/agent/

  12. weizhouapache commented on Dec 8, 2023

    @weizhouapache
    Member

    @weizhouapache @rajujith

    The Passphrase is in the agent.properties file and the cloud.jks is in /etc/cloudstack/agent/

    @shulemmosko
    this is not the root cause, you can ignore it.
    it has been fixed in #7923 in upcoming 4.19, but there is no issue caused by it.

  13. shulemmosko commented on Dec 8, 2023

    @shulemmosko
    Author

    I see, so how can i troubleshoot the connection between the agent and management?

    this is how it looks in the UI.
    image

    Thanks!

  14. weizhouapache commented on Dec 8, 2023

    @weizhouapache
    Member

    @weizhouapache @rajujith

    i just tried upgrading one host again to 4.18 and it does not connect. this time I'm not getting the libvirt error

    2023-12-08 14:27:20,667 INFO [cloud.agent.AgentShell] (main:null) (logid:) Agent started 2023-12-08 14:27:20,671 INFO [cloud.agent.AgentShell] (main:null) (logid:) Implementation Version is 4.18.1.0 2023-12-08 14:27:20,673 INFO [cloud.agent.AgentShell] (main:null) (logid:) agent.properties found at /etc/cloudstack/agent/agent.properties 2023-12-08 14:27:20,724 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to using properties file for storage 2023-12-08 14:27:20,725 INFO [cloud.agent.AgentShell] (main:null) (logid:) Defaulting to the constant time backoff algorithm 2023-12-08 14:27:20,775 INFO [cloud.utils.LogUtils] (main:null) (logid:) log4j configuration found at /etc/cloudstack/agent/log4j-cloud.xml 2023-12-08 14:27:20,776 INFO [cloud.agent.AgentShell] (main:null) (logid:) Using default Java settings for IPv6 preference for agent connection 2023-12-08 14:27:20,871 INFO [cloud.agent.Agent] (main:null) (logid:) id is 1220 2023-12-08 14:27:20,885 ERROR [kvm.resource.LibvirtComputingResource] (main:null) (logid:) uefi properties file not found due to: Unable to find file uefi.properties. 2023-12-08 14:27:20,940 INFO [kvm.resource.LibvirtComputingResource] (main:null) (logid:) Failed to find passphrase for keystore: cloud.jks 2023-12-08 14:27:20,944 INFO [kvm.resource.LibvirtConnection] (main:null) (logid:) No existing libvirtd connection found. Opening a new one 2023-12-08 14:27:21,211 INFO [kvm.resource.LibvirtComputingResource] (main:null) (logid:) IO uring driver for Qemu: disabled 2023-12-08 14:27:21,296 INFO [kvm.storage.KVMStoragePoolManager] (main:null) (logid:) adding storage adaptor for com.cloud.hypervisor.kvm.storage.LinstorStorageAdaptor 2023-12-08 14:27:21,300 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent: com.cloud.utils.exception.CloudRuntimeException: java.lang.reflect.InvocationTargetException at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.(KVMStoragePoolManager.java:119) at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.configure(LibvirtComputingResource.java:1151) at com.cloud.agent.Agent.(Agent.java:190) at com.cloud.agent.AgentShell.launchNewAgent(AgentShell.java:452) at com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:431) at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:415) at com.cloud.agent.AgentShell.start(AgentShell.java:511) at com.cloud.agent.AgentShell.main(AgentShell.java:541)

    only the "failed to find passphrase for keystore"

    @shulemmosko
    can you list the files below

    cd /usr/share/cloudstack-agent/lib/
    ls -l cloud-*
    
  15. shulemmosko commented on Dec 8, 2023

    @shulemmosko
    Author
  16. 18 remaining items

  17. added this to the unplanned milestone on Jan 19, 2024
  18. weizhouapache commented on Feb 6, 2024

    @weizhouapache
    Member

    @rp-
    there are some users facing the issue below

    2023-12-08 14:27:21,296 INFO [kvm.storage.KVMStoragePoolManager] (main:null) (logid:) adding storage adaptor for com.cloud.hypervisor.kvm.storage.LinstorStorageAdaptor
    2023-12-08 14:27:21,300 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent:
    com.cloud.utils.exception.CloudRuntimeException: java.lang.reflect.InvocationTargetException
    at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.(KVMStoragePoolManager.java:119)
    at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.configure(LibvirtComputingResource.java:1151)
    

    which seems to be caused by the change in #6682
    image

    there is no issue before this change.
    the workaround is (1) remove linstor jar ; or (2) create symblink for /usr/bin/hostname

    @rp- can you please have a look ?

  19. rp- commented on Feb 7, 2024

    @rp-
    Contributor

    I'm not sure if there was a specific reason to provide the full path here.
    But it also seems all modern distributions have hostname at /usr/bin/hostname now.
    Anyway I can change it back to "hostname"

  20. weizhouapache commented on Feb 7, 2024

    @weizhouapache
    Member

    I'm not sure if there was a specific reason to provide the full path here. But it also seems all modern distributions have hostname at /usr/bin/hostname now. Anyway I can change it back to "hostname"

    @rp- thanks
    I agree with that most OS have the file, but this issue has been reported by users 2-3 times already.
    it looks the file is missing in some version/release of hostname package.

  21. yadvr commented on Feb 8, 2024

    @yadvr
    Member

    @shulemmosko were you able to consider and try some of the suggestions?

  22. added a commit that references this issue on Feb 9, 2024
  23. weizhouapache commented on Feb 9, 2024

    @weizhouapache
    Member

    fixed by #8633

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions