{ "info": { "author": "Gon\u00e9ri Le Bouder", "author_email": "goneri@lebouder.net", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: System :: Distributed Computing" ], "description": "# \ud83d\uddf2 Ride the Lightning!\ud83d\uddf2\n\n\n[![Build Status](https://travis-ci.org/virt-lightning/virt-lightning.svg?branch=master)](https://travis-ci.org/virt-lightning/virt-lightning)\n[![PyPI version](https://badge.fury.io/py/virt-lightning.svg)](https://badge.fury.io/py/virt-lightning)\n\n![Logo](logo/logo_no_text.png)\n\nVirt-Lightning can quickly deploy a bunch of new VM. It\nalso prepares the Ansible inventory file!\n\nThis is really handy to quickly validate a new Ansible playbook, or a role on a large number of environments.\n\n## example: test an Ansible command on a new env in ONE minute \u26a1\n\nIn a nutshell:\n\n```shell\necho \"- distro: centos-7\" > virt-lightning.yaml\nvl up\nvl ansible_inventory\nansible all -m ping -i inventory\n```\n\nIn the video below, we:\n\n1. use the list of distribution to generate a virt-lightning.yaml file.\n2. we then create a environment based on this file\n3. once the environment is ready, we generate an Ansible inventory file\n4. and we use it to call Ansible's ping module on all the host.\n\n[![demo](https://asciinema.org/a/230671.svg)](https://asciinema.org/a/230671?autoplay=1)\n\n## Pre-requirements\n\n\n\n
Debian\n

\n\nFirst you need to install libvirt and guestfs:\n```shell\nsudo apt install -f libguestfs-tools libvirt-daemon libvirt-daemon-system python3 python3-libvirt python3-pip python3-urwid\nsudo systemctl start --now libvirtd\n```\n\nThe second step is to grant to your user the ability to use libvirt:\n```shell\nsudo usermod -a -G kvm,libvirt,libvirt-qemu $USER\n```\n

\n
\n\n\n
Fedora-29\n

\n\nFirst you need to install libvirt and guestfs:\n```shell\nsudo dnf install -f libguestfs-tools libselinux-python libvirt libvirt-daemon python3 python3-libvirt python3-pip python3-urwid\nsudo systemctl start --now libvirtd\n```\n\nThe second step is to grant to your user the ability to use libvirt:\n```shell\nsudo usermod -a -G qemu,libvirt $USER\n```\n

\n
\n\n\n
Ubuntu-16.04\n

\n\nFirst you need to install libvirt and guestfs:\n```shell\nsudo apt install -f libguestfs-tools libvirt-bin libvirt-daemon python3 python3-libvirt python3-pip python3-urwid\nsudo systemctl start --now libvirtd\n```\n\nThe second step is to grant to your user the ability to use libvirt:\n```shell\nsudo usermod -a -G kvm,libvirtd $USER\n```\n

\n
\n\n\n
Ubuntu-18.04\n

\n\nFirst you need to install libvirt and guestfs:\n```shell\nsudo apt install -f libguestfs-tools libvirt-bin libvirt-daemon python3 python3-libvirt python3-pip python3-urwid\nsudo systemctl start --now libvirtd\n```\n\nThe second step is to grant to your user the ability to use libvirt:\n```shell\nsudo usermod -a -G kvm,libvirt $USER\n```\n

\n
\n\n\n
Ubuntu-18.10\n

\n\nFirst you need to install libvirt and guestfs:\n```shell\nsudo apt install -f libguestfs-tools libvirt-daemon libvirt-daemon-system python3 python3-libvirt python3-pip python3-urwid\nsudo systemctl start --now libvirtd\n```\n\nThe second step is to grant to your user the ability to use libvirt:\n```shell\nsudo usermod -a -G kvm,libvirt $USER\n```\n

\n
\n\n\n\n## Installation\n\n```shell\npip3 install --user --no-deps git+https://github.com/virt-lightning/virt-lightning\n```\n\nThe `--no-deps` argument is only required on Ubuntu (See: https://github.com/pypa/pip/issues/4222).\n\n`virt-lightning` will be installed in ~/.local/bin/. Add it in your `$PATH` if\nit's not already the case. For instance if you use:\n\n```shell\necho \"export PATH=$PATH:~/.local/bin/\" >> ~/.bashrc\nsource ~/.bashrc\n```\n\n# Fetch some images\n\nBefore you start your first VM, you need to fetch the images. To do so,\nyou just need these scripts:\nhttps://github.com/virt-lightning/virt-lightning/tree/master/images\n\n```shell\n$ git clone https://github.com/virt-lightning/virt-lightning\n$ cd virt-lightning/images\n$ ./image centos-7 build\n$ ./image debian-9 build\n(\u2026)\n```\n\nUbuntu requires use *sudo* to build or prepare images.\n\nYou can also use your own images as soon as they embed cloud-init, just copy them in the QCOW2\nformat in /var/lib/virt-lightning/pool/upstream/. It's also a good idea to include qemu-guest-agent,\nvirt-lightning uses it to set the root password and it offers some other benefits.\n\n# Actions\n\n`vl` is an alias for `virt-lightning`, you can us both. In the rest of the document\nwe use the shortest version.\n\n- **vl distro_list**: List the distro images that can be used. Its output is compatible with `vl up`. You can initialize a new configuration with: `vl distro > virt-lightning.yaml`.\n- **vl up**: `virt-lightning` will read the `virt-lightning.yaml` file from the current directory and prepare the associated VM.\n- **vl down**: Destroy all the VM.\n- **vl status**: List the VM, their IP and if they are reachable.\n- **vl ansible_inventory**: Export an inventory in the Ansible format.\n- **vl ssh**: Show up a menu to select a host and open a ssh connection [![vl ssh](https://asciinema.org/a/230675.svg)](https://asciinema.org/a/230675?autoplay=1)\n- **vl console**: Like `vl ssh` but with the serial console of the VM [![vl ssh](https://asciinema.org/a/230677.svg)](https://asciinema.org/a/230677?autoplay=1)\n\n### Configuration from file\n\nYou can create your own configuration file like this and save to config.ini\n\n```\n[main]\nnetwork_name = virt-lightning\nroot_password = root\nstorage_pool = virt-lightning\n```\n\n### ESXi\n\nYou can use `virt-lightning` with ESXi 6.5 and 6.7. You can build your images with the scripts from the `images/extras/` directory:\n\n```shell\ncd images/extras/\nbash esxi-6.5\nbash esxi-6.7\n```\n\nESXi requires a bit more memory than the other systems. You can adjust your `virt-lightning.yaml` file to overwrite the default (768MB). The key is called `memory`:\n\n```yaml\n- distro: esxi-6.5\n memory: 14096\n swap: 0\n- distro: esxi-6.7\n memory: 4096\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/virt-lightning/virt-lightning", "keywords": "", "license": "Apache v2.0", "maintainer": "", "maintainer_email": "", "name": "virt-lightning", "package_url": "https://pypi.org/project/virt-lightning/", "platform": "linux", "project_url": "https://pypi.org/project/virt-lightning/", "project_urls": { "Homepage": "https://github.com/virt-lightning/virt-lightning" }, "release_url": "https://pypi.org/project/virt-lightning/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Deploy your testing VM in a couple of sections", "version": "1.0.0" }, "last_serial": 5899850, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "dd7d53357608d2beb9263e716dc1d06d", "sha256": "cbe823dabee286eceab58ccd69fb34062587ca1d86e9a66b61982e8d91146fb5" }, "downloads": -1, "filename": "virt-lightning-0.1.0.tar.gz", "has_sig": false, "md5_digest": "dd7d53357608d2beb9263e716dc1d06d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 62210, "upload_time": "2019-03-08T20:02:39", "url": "https://files.pythonhosted.org/packages/d8/20/a8097ce3ed4b2e1e736efe11a7b2e413ec6c71fdb0f5468c2e5b2cf4ffe2/virt-lightning-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "5f3afb558d877368371f944c5774a5fc", "sha256": "103b38ec56e0e790b6c8140cb72c34f40a0df57704741723994f380e03ddb73c" }, "downloads": -1, "filename": "virt-lightning-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5f3afb558d877368371f944c5774a5fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67757, "upload_time": "2019-09-28T14:47:00", "url": "https://files.pythonhosted.org/packages/ae/10/9e8a730a4d4e4369376081adf2622c57fe5301831208628e36ba1b793f9e/virt-lightning-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5f3afb558d877368371f944c5774a5fc", "sha256": "103b38ec56e0e790b6c8140cb72c34f40a0df57704741723994f380e03ddb73c" }, "downloads": -1, "filename": "virt-lightning-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5f3afb558d877368371f944c5774a5fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67757, "upload_time": "2019-09-28T14:47:00", "url": "https://files.pythonhosted.org/packages/ae/10/9e8a730a4d4e4369376081adf2622c57fe5301831208628e36ba1b793f9e/virt-lightning-1.0.0.tar.gz" } ] }