2018-05-15 14:12:30 +02:00
|
|
|
# KVM tools
|
|
|
|
|
|
|
|
This repository contain scripts for managing KVM hypervisors used with DRBD and LVM.
|
|
|
|
|
2018-06-21 10:27:56 +02:00
|
|
|
It contains the following scripts.
|
|
|
|
|
|
|
|
- add-vm.sh: create DBRD volumes and virtual machines.
|
|
|
|
- kvmstats.sh: gives informations about defined virtual machines.
|
2018-05-15 14:12:30 +02:00
|
|
|
|
|
|
|
## Install
|
|
|
|
|
2018-06-21 10:27:56 +02:00
|
|
|
Copy the scripts to /usr/local/sbin:
|
2018-05-15 14:12:30 +02:00
|
|
|
|
|
|
|
~~~
|
|
|
|
install -m 0755 add-vm.sh /usr/local/sbin/add-vm
|
2018-06-21 10:27:56 +02:00
|
|
|
install -m 0755 kvmstats.sh /usr/local/sbin/kvmstats
|
2018-05-15 14:12:30 +02:00
|
|
|
~~~
|
|
|
|
|
2018-06-21 10:27:56 +02:00
|
|
|
Edit 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-07-27 11:06:31 +02:00
|
|
|
Script add-vm.sh assume you have two LVM Volume Group named "ssd" and "hdd".
|
|
|
|
|
|
|
|
You can override this by adding a Bash array in /etc/evolinux/add-vm.cnf, eg:
|
|
|
|
|
|
|
|
~~~
|
|
|
|
disks=("VG1" "VG2")
|
|
|
|
~~~
|
|
|
|
|
2018-05-15 14:12:30 +02:00
|
|
|
## Dry-run mode
|
|
|
|
|
2018-06-21 10:27:56 +02:00
|
|
|
You can use the dry-run mode by setting doDryRun var in config file:
|
2018-05-15 14:12:30 +02:00
|
|
|
|
|
|
|
~~~
|
|
|
|
doDryRun=true
|
|
|
|
~~~
|
2018-06-21 10:27:56 +02:00
|
|
|
|
|
|
|
> This is specific to add-vm.
|