Skip to content

eht16/kvmctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KvmCtl

About

KvmCtl assists you in administrating KVM virtual machines. It doesn't provide a full management suite to fit all needs, it is just a little helper program to start, stop and check your virtual machines on a host. As a little bonus, it can also list OpenVZ Containers running on the same host. This might be useful since KVM and OpenVZ play quite nicely together on the same host. However, KvmCtl is mainly targeted for KVM virtual machines and so doesn't offer any functionality for OpenVZ Containers other than listing. Use vzctl for containers, it can do almost everything already.

Requirements

  • Qemu-KVM (obviously)
  • Python (>= 2.6, might work on older versions but untested).

Installation

Copy the source directory at a desired location in your filesystem, e.g. /usr/local/kvmctl. Then simply create a symlink to $prefix/bin/kvmctl somewhere in your path. To get KVM virtual machines started at boot time, create a symlink for the included init script in /etc/init.d and use your distribution management tools to integrate it properly into the init system (e.g. update-rc.d for Debian based systems). KvmCtl logs by default to /var/log/kvmctl.log. To get this log file rotated by logrotate, create a symlink for the included logrotate config file in /etc/logrotate.d.

Configuration

To configure KvmCtl, create a new file named kvmctl.local.conf in the etc/ subdirectory. Do not modify the default kvmctl.conf. Instead all custom configuration should go into the new kvmctl.local.conf. All settings in this file override settings in the default configuration file. This way your local modifications, like path names, won't get overriden on updates.

Usage

The tool is meant to be run as root as many of the necessary information can be only be read as root. Running it as user has not been tested however it should work via sudo.

Generally, the tool should be quite easy to use. To get a list of available commands, run:

kvmctl help

The general syntax is:

kvmctl <command> <arguments>

The command is one of those listed by the help command. Arguments is in most cases the name of a virtual machine, e.g.

kvmctl start MyVM1

A few commands like list, startall, stopall don't accept arguments.

Shell command completion

If you are using Bash or Zsh, you can source the appropriate script included in the contrib/ directory to get smart autocompletion of KvmCtl commands and arguments. It works dynamically, e.g. it reads the available commands directly from KvmCtl and also knows about configured virtual machines. Try it and save even more typing :).

(This is heavily inspired by pip - http://www.pip-installer.org)

License

KvmCtl is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the license. A copy of this license can be found in the file COPYING included with the source code of this program.

Ideas, questions, patches and bug reports

Send them to me at enrico(dot)troeger(at)uvena(dot)de.

About

A small KVM managing helper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published