[PVE-User] Virtual Machines configs

Germain Maurice germain.maurice at linkfluence.net
Sat May 7 17:41:23 CEST 2011


Hi Elbandi,

I  have a five node cluster, connected to SAN storage (using AoE), and i 
have to keep on each node the all vms config i have over the cluster to 
make them running if a node has to fail.

Here is my way of doing that (executed each minute, maybe too fast)
If a node fails, you just have to copy the vm config file from backup 
directory to the main directory.

/sbin/sync-vms-config.sh :
=============================
#!/bin/bash


VMS_DIR="/etc/qemu-server"
VMS_BACKUP_DIR="/etc/qemu-server/all-vms-cluser-backup"

[[ -d  $VMS_BACKUP_DIR ]] || mkdir $VMS_BACKUP_DIR
[[ -d  $VMS_BACKUP_DIR ]] && rm $VMS_BACKUP_DIR/*


cp -R $VMS_DIR/*.conf $VMS_BACKUP_DIR 2>/dev/null

MY_IP=`pveca -i | cut -d" " -f3`
THE_OTHERS=`pveca -l | tail --lines=+2 | grep -v " $MY_IP " | sed -r 
's/.* (10\.0\.3\.[0-9]*) .*/\1/'`

# DO THE BACKUP OF VMS
for OTHER in $THE_OTHERS
do
     scp -q "$OTHER:$VMS_DIR/*.conf" $VMS_BACKUP_DIR 2>/dev/null
done
=============================


I hope it will help you.



Le 06/05/11 20:42, Elso Andras a écrit :
> Hi!
>
> In a PVE cluster config, are all VM configs saved somewhere? (i mean,
> if a node has HW failure, how can i start the VM in other node?)
>
> Elbandi
> _______________________________________________
> pve-user mailing list
> pve-user at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-user




More information about the pve-user mailing list