Code Monkey home page Code Monkey logo

vmango's Introduction

vmango

Build Status

Vmango is a virtual machines management web interface written using Go.

The main goal of project is not to provide a hypervisor configuration tool, because that problem already solved by many configuration management systems like Ansible or Puppet, but provide a convenient way to manage virtual machines on existing hypervisors.

Documentation: https://vmango.org/docs/

Current features:

  • SSH keys management and injection
  • KVM via libvirt
  • Digitalocean-style interface
  • Support for cloud OS images (with cloud-init installed)
  • IP address management
  • Simple API
  • Custom userdata for cloud-init

Hypervisor server requirements:

  • Libvirt 0.10+ (centos6+, ubuntu14.04+, debian8+)
  • Routed network with libvirt managed dhcp server. Bridged networks not supported due to impossibility to determine machine ip address.

Web interface server requirements:

  • Libvirt 1.2.0+ (Ubuntu 14.04+, debian8+, centos7+)

Development

Hypervisor configuration (Ubuntu 14.04/16.04)

sudo apt-get install libvirt-bin qemu-kvm qemu-system dnsmasq-utils
sudo usermod -aG libvirtd [username]
newgrp libvirtd

Define libvirt network

virsh net-define network.xml
virsh net-start vmango
virsh net-autostart vmango

Define libvirt images storage:

sudo mkdir -p /var/lib/libvirt/images/vmango-images
virsh pool-define storage-pool-images.xml
virsh pool-start vmango-images
virsh pool-autostart vmango-images

Install dhcp lease monitor hook (symlink doesn't work due to Apparmor restrictions):

sudo cp qemu-hook-lease-monitor.py /etc/libvirt/hooks/qemu

Download vm images (file names matter!)

wget -O- http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2.xz |unxz - > Centos-7_amd64_qcow2.img
wget -O- https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img  > Ubuntu-16.04_amd64_qcow2.img
sudo chown root. *_qcow2.img
sudo mv Centos-7_amd64_qcow2.img /var/lib/libvirt/images/vmango-images/
sudo mv Ubuntu-16.04_amd64_qcow2.img /var/lib/libvirt/images/vmango-images/
virsh pool-refresh vmango-images

If your processor doesn't support hardware acceleration, change type from "kvm" to "qemu" in the first line of vm.xml.in (or you will get an error during first machine creation):

<domain type='qemu'> 

Dependencies for Ubuntu 14.04+

Install libvirt and kvm

sudo apt-get install libvirt-dev libvirt-bin qemu-kvm virt-manager qemu-system dnsmasq-utils genisoimage
sudo usermod -aG libvirtd [username]
newgrp libvirtd

Install Go 1.7

cd /usr/local
sudo wget https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz
sudo tar xf go1.7.4.linux-amd64.tar.gz

Configure libvirt as described above. Now you can use your own computer as hypervisor.

Dependencies for MacOS

Install Go compiler, libvirt C library and mkisofs util (for configdrive creation)

brew install go
brew install libvirt
brew install dvdrtools

You need a linux hypervisor somewhere in the world, because libvirt doesn't support MacOS.

Development

Compile for development

make EXTRA_ASSETS_FLAGS=-debug

Change libvirt url in config if needed

...
hypervisor {
    ...
    url = "qemu+ssh://user@host/system"
    ...
}
...

Run app

./bin/vmango

View it on http://localhost:8000

Run tests

Unit tests

make test

Libvirt integration tests tests (please, do not run tests on production servers)

VMANGO_TEST_TYPE=ubuntu_file VMANGO_TEST_LIBVIRT_URI=qemu:///system make test TEST_ARGS='-tags integration'

vmango's People

Contributors

aristarhys avatar subuk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.