Hostagent Fails to Install Packages During Host Upgrade

Problem

  • During a host upgrade, the pf9-hostagent service fails to install its updated package, throwing the following error in /var/log/pf9/hostagent.log.

pf9_app.py INFO - Updating pf9-hostagent.3.9.0-2453.2b93f79
    session.py ERROR - Updating the pf9 host agent failed
    Traceback (most recent call last):
      File "/opt/pf9/hostagent/lib/python2.7/site-packages/bbslave/session.py", line 423, in update_agent
        agent_app_class, log)
      File "/opt/pf9/hostagent/lib/python2.7/site-packages/pf9app/algorithms.py", line 207, in process_agent_update
        new_agent.update()
      File "/opt/pf9/hostagent/lib/python2.7/site-packages/pf9app/pf9_app.py", line 426, in update
        self.app_db.update_package(local_path)
      File "/opt/pf9/hostagent/lib/python2.7/site-packages/pf9app/pf9_app_db.py", line 329, in update_package
        self.pkgmgr.update_from_file(path)
      File "/opt/pf9/hostagent/lib/python2.7/site-packages/pf9app/pf9_app_db.py", line 117, in update_from_file
        self.install_from_file(pkg_path)
      File "/opt/pf9/hostagent/lib/python2.7/site-packages/pf9app/pf9_app_db.py", line 107, in install_from_file
        raise InstallOperationFailed()
    InstallOperationFailed
  • For other packages, it throws the following error.

  • An attempt to manually install the package fails with the following error.

Environment

  • Platform9 Managed OpenStack - v3.3.0 and Higher

  • Ubuntu 16.04

Cause

  • Even though the libvirt-bin package is installed, it is half-configured, as shown below.

  • The package post-install script to start the libvirt-bin service fails.

  • Systemd reports a failure because the '-d' (daemon) flag was passed to the binary. This isn't compatible with systemd as it forces the libvirtd process to fork, thus reporting the service as failed, even when the forked process is running in the background.

  • The drawback is that the forked process cannot be managed with systemd, and must be killed manually.

Resolution

  1. Remove '-d' option from the parameter libvirtd_opts in /etc/default/libvirt-bin.

  1. Kill the libvirtd daemon with the following command.

  1. Fix the half configured libvirt-bin package.

  1. Restart the libvirt-bin service.

  1. Contact Platform9 Supportarrow-up-right to re-run the host upgrades.

Additional Information

Last updated