[Ovirt-devel] [PATCH ovirt-appliance] Allow the appliance to manage the hardware it is running on - part 1
Alan Pevec
apevec at redhat.com
Tue Sep 9 00:22:59 UTC 2008
From: Chris Lalancette <clalance at redhat.com>
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>
---
ovirt-appliance.ks | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/ovirt-appliance.ks b/ovirt-appliance.ks
index 4c4c96e..faa0bd4 100644
--- a/ovirt-appliance.ks
+++ b/ovirt-appliance.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
--
1.5.5.1
More information about the ovirt-devel
mailing list