[Ovirt-devel] [PATCH]: Allow the WUI to manage the hardware it is running on

Chris Lalancette clalance at redhat.com
Fri Sep 5 07:57:06 UTC 2008


    In the rc.local, attempt to contact the host we are running
    on.  If we succeed, great, we can manage it with the rest of the nodes.  If
    we fail, no big deal, it just won't be available.  Note that we can't do
    this in the ovirt-wui-dev initscript because it happens too early in boot
    (we need at least host-browser up for this to have a chance of working).
    
    Signed-off-by: Chris Lalancette <clalance at redhat.com>

diff --git a/wui-appliance/wui-devel.ks b/wui-appliance/wui-devel.ks
index e9ca6cc..02c6baa 100644
--- a/wui-appliance/wui-devel.ks
+++ b/wui-appliance/wui-devel.ks
@@ -25,9 +25,22 @@ set /files/etc/sysconfig/network-scripts/ifcfg-eth1/DNS1 192.168.50.2
 save
 EOF
 
+# the code to contact the host we are running on and make it configure itself
+# note that this has to be done in rc.local (as opposed to ovirt-wui-dev)
+# because when ovirt-wui-dev starts, the host-browser is not yet running
+cat >> /etc/rc.d/rc.local << \EOF
+# Try to contact the host we are running on; if we succeed, we'll use it as
+# one of the managed nodes; if not, no big deal
+exec 3<> /dev/tcp/192.168.50.1/7777
+echo "AWAKE" 1>&3
+exec 3<> /dev/tcp/192.168.50.1/7777
+echo "IDENTIFY" 1>&3
+EOF
+
 # make sure to update the /etc/hosts with the list of all possible DHCP
 # addresses we can hand out; dnsmasq uses this
 sed -i -e 's/management\.priv\.ovirt\.org//' /etc/hosts
+echo "192.168.50.1 physical.priv.ovirt.org" >> /etc/hosts
 echo "192.168.50.2 management.priv.ovirt.org" >> /etc/hosts
 for i in `seq 3 252` ; do
     echo "192.168.50.$i node$i.priv.ovirt.org" >> /etc/hosts




More information about the ovirt-devel mailing list