----- Original Message ----- From: "Michael Schwartzkopff" <[EMAIL PROTECTED]>
To: "General Linux-HA mailing list" <[email protected]>
Sent: Tuesday, April 01, 2008 3:03 PM
Subject: Re: [Linux-HA] Setup HA on Openvz


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,


How about giving VE capability to change IP like this:
vzctl set <VEID> --capability NET_ADMIN:on

Maybe this will allow VE to change IP by iteself.

_______________________________________________
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