Installing Lago¶
Lago is officially supported and tested on Fedora 24+ and CentOS 7.3 distributions. However, it should be fairly easy to get it running on debian variants.
As Lago requires libvirtd installed and several group permissions,
it cannot be installed solely via pip
. For that reason the
recommended method of installation is using the RPM. The easiest way, is
to use the Install script which we test and verify regularly [2].
pip¶
Install system package dependencies, this may vary according to your distribution:
- CentOS 7.3+
$ yum install -y epel-release centos-release-qemu-ev $ yum install -y libvirt libvirt-devel libguestfs-tools \ libguestfs-devel gcc libffi-devel openssl-devel \ qemu-kvm-ev
- Fedora 24+
$ dnf install -y libvirt libvirt-devel libguestfs-tools \ libguestfs-devel gcc libffi-devel openssl-devel qemu-kvm
- Debian / Ubuntu - TO-DO
- ArchLinux - TO-DO
Install libguestfs Python bindings, as they are not available on PyPI [3]:
$ pip install http://download.libguestfs.org/python/guestfs-1.36.4.tar.gz
Install Lago with pip:
$ pip install lago
Setup permissions(replacing USERNAME accordingly):
$ sudo usermod -a -G qemu,libvirt USERNAME $ sudo usermod -a -G USERNAME qemu $ chmod g+x $HOME
Create a global share for Lago to store templates:
$ sudo mkdir -p /var/lib/lago $ sudo mkdir -p /var/lib/lago/{repos,store,subnets} $ sudo chown -R USERNAME:USERNAME /var/lib/lago
Note: if you don’t want to share the templates between users, have a look at the Configuration section, and change
lease_dir
,template_repos
andtemplate_store
accordingly.Restart libvirt(if you have systemd, otherwise use your distribution specific tool):
$ systemctl restart libvirtd
Log out and login again
Fedora 24+ / CentOS 7.3¶
Install script¶
Download the installation script and make it executable:
$ curl https://raw.githubusercontent.com/lago-project/lago-demo/master/install_scripts/install_lago.sh \ -o install_lago.sh \ && chmod +x install_lago.sh
Run the installation script(replacing
username
with your username):$ sudo ./install_lago.sh --user [username]
Log out and login again.
That’s it! Lago should be installed.
Manual installation¶
Add the following repository to a new file at
/etc/yum.repos.d/lago.repo
:For Fedora:
[lago] baseurl=http://resources.ovirt.org/repos/lago/stable/0.0/rpm/fc$releasever name=Lago enabled=1 gpgcheck=0
For CentOS:
[lago] baseurl=http://resources.ovirt.org/repos/lago/stable/0.0/rpm/el$releasever name=Lago enabled=1 gpgcheck=0
For CentOS only, you need EPEL and centos-release-qemu-ev repositories, those can be installed by running:
$ sudo yum install -y epel-release centos-release-qemu-ev
With the Lago repository configured, run(for Fedora use
dnf
instead):$ sudo yum install -y lago
Setup group permissions:
$ sudo usermod -a -G lago USERNAME $ sudo usermod -a -G qemu USERNAME $ sudo usermod -a -G USERNAME qemu
Add group execution rights to your home directory: [1]
$ chmod g+x $HOME
Restart libvirtd:
$ sudo systemctl enable libvirtd $ sudo systemctl restart libvirtd
Log out and login again.
FAQ¶
Q: After using the install script, how do I fix the permissions for another username?
A: Run:
$ ./install_lago.sh -p --user [new_user]
Q: Can Lago be installed in a Python virtualenv?
Troubleshooting¶
Problem: QEMU throws an error it can’t access files in my home directory.
Solution: Check again that you have setup the permissions described in the Manual Installation section. After doing that, log out and log in again. If QEMU has the proper permissions, the following command should work( replace
some/nested/path
with a directory inside your home directory):$ sudo -u qemu ls $HOME/some/nested/path
[1] | For more information why this step is needed see https://libvirt.org/drvqemu.html, at the bottom of “POSIX users/groups” section. |
[2] | If the installation script does not work for you on the supported distributions, please open an issue at h ttps://github.com/lago-project/lago-demo.git |
[3] | (1, 2) libguestfs Python bindings is unfortunately not available on PyPI, see https://bugzilla.redhat.com/show_bug.cgi?id=1075594 for current status. You may also use the system-wide package, if those are available for your distribution. In that case, if using a virtualenv, ensure you are creating it with ‘–system-site-packages’ option. For Fedora/CentOS the package is named python2-libguestfs, and for Debian python-guestfs. |