m (→Download) |
|||
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
= kvm-admin = | = kvm-admin = | ||
'''What it does?''' | '''What it does?''' | ||
− | It | + | |
− | + | It offer the possibility to manage a qemu guest via commandline. | |
+ | |||
+ | The reason to build was to have a simple tool to manage my own qemu guest. | ||
+ | |||
+ | Just to use it for qemu guest to connect to a bridged network. | ||
+ | |||
+ | = Howto use it = | ||
+ | Examples: | ||
<code> | <code> | ||
− | kvm-admin | + | kvm-admin boot domain_name |
</code> | </code> | ||
− | = | + | <code> |
− | It's add a bridge to a given bridge from | + | kvm-admin status domain_name |
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | kvm-admin status all | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | kvm-admin monitor domain_name | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | kvm-admin show domain_name | ||
+ | </code> | ||
+ | |||
+ | |||
+ | |||
+ | = Features = | ||
+ | It's add a bridge to a given bridge from qemu-kvm domain configuration file. | ||
The bridge(s) have to exists. | The bridge(s) have to exists. | ||
− | There can individual bridges on the system and each | + | There can individual bridges on the system and each qemu-kvm domain can assign to different bridge. |
No need to add many script files and scriptdown files. | No need to add many script files and scriptdown files. | ||
− | This is set | + | This is set automaticly. |
= Configuration File Format = | = Configuration File Format = | ||
− | The | + | The qemu-kvm domain configuration file are placed in the directory 'domains'. |
− | The format is taken 1:1 from the command line | + | The format is taken 1:1 from the command line but separated by new line |
− | To use an qemu-kvm option which | + | To use an qemu-kvm option which doesn't have a parameter you have to use: |
variable = enabled | variable = enabled | ||
− | Global configuration | + | Global configuration variabales which all qemu-kvm domains should effected, |
can write in 'config/kvm.cfg' file. | can write in 'config/kvm.cfg' file. | ||
− | + | Example: | |
− | + | # have to set the path to qemu-kvm or name | |
+ | # the script generate-kvm-option does update the path | ||
+ | qemu-kvm = qemu-system-x86_x84 | ||
+ | |||
+ | daemonize = enabled | ||
localtime = enabled | localtime = enabled | ||
− | Example | + | Example output for a qemu-kvm domain: |
+ | # if name is not set it will use the filename as name | ||
name = my_guest | name = my_guest | ||
smp = 2 | smp = 2 | ||
m = 1024 | m = 1024 | ||
+ | # first drive | ||
+ | drive = file:/path_to_image_or_lvm,[and other options] | ||
+ | # second drive | ||
drive = file:/path_to_image_or_lvm,[and other options] | drive = file:/path_to_image_or_lvm,[and other options] | ||
cdrom = my_installer.iso | cdrom = my_installer.iso | ||
Line 40: | Line 73: | ||
localtime = enabled | localtime = enabled | ||
− | Only one exception | + | Only one exception exists. |
This is only for the '-net tap' option. | This is only for the '-net tap' option. | ||
There have to add an option for the bridge. | There have to add an option for the bridge. | ||
+ | An example for tap option when using '-net nic': | ||
+ | |||
+ | # first network interface | ||
net = nic,[and other options] | net = nic,[and other options] | ||
− | + | net = tap,bridge=br0 | |
− | net = | + | # second network interface |
+ | net = nic,[and other options] | ||
+ | net = tap,bridge=br1 | ||
+ | |||
+ | = Download = | ||
+ | It can be downloaded on the mercurial repository on: | ||
+ | |||
+ | via Webbrowser: | ||
+ | https://hg.kasten-edv.de/kvm-tools (klick on bzip,gzip or zip link) | ||
+ | |||
+ | via mercurial: | ||
+ | hg clone https://hg.kasten-edv.de/kvm-tools --insecure | ||
+ | |||
+ | = Installation = | ||
+ | Please read the README for further information. | ||
+ | |||
+ | = Security= | ||
+ | To run the kvm process under a unprivileged user. | ||
+ | |||
+ | Add an user 'kvm' and add this in to the qemu-kvm domain configuration file. | ||
+ | runas = kvm | ||
+ | |||
+ | For each qemu-kvm domain you can assign an individual user. | ||
+ | |||
+ | When all qemu-kvm domains should run as the user 'kvm' then add this in the global configurations file 'config/kvm.cfg' | ||
+ | runas = kvm | ||
+ | |||
+ | When is set in 'config/kvm.cfg' the qemu-kvm domain configuration file can override it. | ||
+ | |||
+ | = ToDo = | ||
+ | * extend the installer script | ||
+ | * build a init script | ||
+ | * build an installation routine | ||
+ | * add possibility to automatic create and delete guest | ||
+ | |||
+ | = Fixes = | ||
+ | The ordinary fixes :) |
Latest revision as of 09:26, 2 August 2017
Contents
kvm-admin
What it does?
It offer the possibility to manage a qemu guest via commandline.
The reason to build was to have a simple tool to manage my own qemu guest.
Just to use it for qemu guest to connect to a bridged network.
Howto use it
Examples:
kvm-admin boot domain_name
kvm-admin status domain_name
kvm-admin status all
kvm-admin monitor domain_name
kvm-admin show domain_name
Features
It's add a bridge to a given bridge from qemu-kvm domain configuration file.
The bridge(s) have to exists. There can individual bridges on the system and each qemu-kvm domain can assign to different bridge. No need to add many script files and scriptdown files. This is set automaticly.
Configuration File Format
The qemu-kvm domain configuration file are placed in the directory 'domains'. The format is taken 1:1 from the command line but separated by new line
To use an qemu-kvm option which doesn't have a parameter you have to use:
variable = enabled
Global configuration variabales which all qemu-kvm domains should effected, can write in 'config/kvm.cfg' file.
Example:
# have to set the path to qemu-kvm or name # the script generate-kvm-option does update the path qemu-kvm = qemu-system-x86_x84
daemonize = enabled localtime = enabled
Example output for a qemu-kvm domain:
# if name is not set it will use the filename as name name = my_guest smp = 2 m = 1024 # first drive drive = file:/path_to_image_or_lvm,[and other options] # second drive drive = file:/path_to_image_or_lvm,[and other options] cdrom = my_installer.iso daemonize = enabled localtime = enabled
Only one exception exists. This is only for the '-net tap' option. There have to add an option for the bridge.
An example for tap option when using '-net nic':
# first network interface net = nic,[and other options] net = tap,bridge=br0 # second network interface net = nic,[and other options] net = tap,bridge=br1
Download
It can be downloaded on the mercurial repository on:
via Webbrowser:
https://hg.kasten-edv.de/kvm-tools (klick on bzip,gzip or zip link)
via mercurial:
hg clone https://hg.kasten-edv.de/kvm-tools --insecure
Installation
Please read the README for further information.
Security
To run the kvm process under a unprivileged user.
Add an user 'kvm' and add this in to the qemu-kvm domain configuration file.
runas = kvm
For each qemu-kvm domain you can assign an individual user.
When all qemu-kvm domains should run as the user 'kvm' then add this in the global configurations file 'config/kvm.cfg'
runas = kvm
When is set in 'config/kvm.cfg' the qemu-kvm domain configuration file can override it.
ToDo
* extend the installer script * build a init script * build an installation routine * add possibility to automatic create and delete guest
Fixes
The ordinary fixes :)