2018-05-15 14:12:30 +02:00
|
|
|
# KVM tools
|
|
|
|
|
2018-12-24 22:11:16 +01:00
|
|
|
This repository contains scripts for managing
|
2018-12-26 17:32:02 +01:00
|
|
|
[KVM](https://www.linux-kvm.org/page/Main_Page) hypervisors using
|
|
|
|
[DRBD](http://drbd.org/) and
|
|
|
|
[LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29).
|
2018-05-15 14:12:30 +02:00
|
|
|
|
2018-06-21 10:27:56 +02:00
|
|
|
It contains the following scripts.
|
|
|
|
|
2018-12-24 22:11:16 +01:00
|
|
|
- add-vm: create DRBD volumes and virtual machines.
|
2018-09-12 15:29:11 +02:00
|
|
|
- vm-migrate: migrate a DRBD based virtual machine
|
2018-07-27 11:50:28 +02:00
|
|
|
- kvmstats: gives informations about defined virtual machines.
|
2018-05-15 14:12:30 +02:00
|
|
|
|
2018-12-24 22:11:16 +01:00
|
|
|
## Installation
|
2018-05-15 14:12:30 +02:00
|
|
|
|
2018-06-21 10:27:56 +02:00
|
|
|
Copy the scripts to /usr/local/sbin:
|
2018-05-15 14:12:30 +02:00
|
|
|
|
|
|
|
~~~
|
2018-07-27 11:50:28 +02:00
|
|
|
install -m 0755 add-vm /usr/local/sbin/add-vm
|
|
|
|
install -m 0755 kvmstats /usr/local/sbin/kvmstats
|
2018-05-15 14:12:30 +02:00
|
|
|
~~~
|
|
|
|
|
2018-12-24 22:11:16 +01:00
|
|
|
Edit the configuration in /etc/evolinux/add-vm.cnf:
|
2018-05-15 14:12:30 +02:00
|
|
|
|
|
|
|
~~~
|
|
|
|
masterKVMIP=192.168.0.X
|
|
|
|
slaveKVMIP=192.168.0.Y
|
|
|
|
~~~
|
|
|
|
|
2018-12-24 22:11:16 +01:00
|
|
|
Script add-vm assumes you have two LVM Volume Groups named "ssd"
|
|
|
|
and "hdd".
|
2018-07-27 11:06:31 +02:00
|
|
|
|
2018-12-24 22:11:16 +01:00
|
|
|
You can override this by adding a bash(1) array in
|
|
|
|
/etc/evolinux/add-vm.cnf, eg:
|
2018-07-27 11:06:31 +02:00
|
|
|
|
|
|
|
~~~
|
|
|
|
disks=("VG1" "VG2")
|
|
|
|
~~~
|
|
|
|
|
2018-05-15 14:12:30 +02:00
|
|
|
## Dry-run mode
|
|
|
|
|
2018-12-24 22:11:16 +01:00
|
|
|
You can use the dry-run mode by setting the doDryRun variable in
|
|
|
|
/etc/evolinux/add-vm.cnf::
|
2018-05-15 14:12:30 +02:00
|
|
|
|
|
|
|
~~~
|
|
|
|
doDryRun=true
|
|
|
|
~~~
|
2018-06-21 10:27:56 +02:00
|
|
|
|
|
|
|
> This is specific to add-vm.
|
2018-12-12 18:29:56 +01:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
2018-12-24 22:11:16 +01:00
|
|
|
This is an [Evolix](https://evolix.com) project and is licensed
|
|
|
|
under the GPLv3, see the [LICENSE](LICENSE) file for details.
|