Am Dienstag, 1. April 2008 17:03 schrieb Gary:
> I am tring to setup HA in two VE's of OpenVZ.
> Inside VE, there are network interfaces: venet0 and venet0:0. venet0:0 has
> the real IP. I tried to use venet0:0 in ha.cf like this: bcast=venet0:0
>
> it does not work.

Hi,

the problem is that a virtual machine cannot change its IP address by its own. 
As far as I understood OpenVZ this always has to be done by the host with 

vzctl set <machine> --ipaddr ....

This os of course a little problem if the virtual machine wants to control it 
cluster IP address. Therefor I modified the IPaddr2 resource agent that it 
communicates with the host to change its own IP address. In function 
add_interface() of the resource agent I added:
echo "101 add 192.168.189.33" | /bin/nc 192.168.189.199 7564

and corresponding:
echo "101 del 192.168.189.33" | /bin/nc 192.168.189.199 7564
in function delete_interface

On the host side (192.168.188.199) I have a server listing on port 7564. The 
program vzip.sh is very simple:
#!/bin/bash
read vps operation ip
echo "on " $vps " do " $operation " " $ip >> /tmp/log.log
CMD="/usr/sbin/vzctl set $vps --ip$operation $ip"
echo $CMD >> /tmp/log.log
$CMD

This program is startet by inetd with the following line in inetd.conf:
vzip    stream  tcp     nowait  root    /root/vzip.sh

and
vzip    tcp/7564

in /etc/services

I know the is a very rude solution and need much improvement to be 
generalized. But it works for me. If there is any interest  by others I could 
improve it further so more people could use it. Please mail me.

Cheers,

-- 
Dr. Michael Schwartzkopff
MultiNET Services GmbH
Addresse: Bretonischer Ring 7; 85630 Grasbrunn; Germany
Tel: +49 - 89 - 45 69 11 0
Fax: +49 - 89 - 45 69 11 21
mob: +49 - 174 - 343 28 75

mail: [EMAIL PROTECTED]
web: www.multinet.de

Sitz der Gesellschaft: 85630 Grasbrunn
Registergericht: Amtsgericht München HRB 114375
Geschäftsführer: Günter Jurgeneit, Hubert Martens

---

PGP Fingerprint: F919 3919 FF12 ED5A 2801 DEA6 AA77 57A4 EDD8 979B
Skype: misch42
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to