Perry Myers
2008-May-23 18:15 UTC
[Ovirt-devel] [PATCH] Fix so libvirt does not start default network interface on developer/bundled
Libvirt by default tries to create a private network for running guests. Because on the bundled/developer install we use dnsmasq ourselves, this conflicts with the default libvirt network. Solution is that the appliance must always be configured (via kickstart) to not start libvirtd. Then when the ovirt install script runs it removes default.xml and starts libvirt up. Signed-off-by: Perry Myers <pmyers at redhat.com> --- wui/scripts/ovirt-wui-install | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/wui/scripts/ovirt-wui-install b/wui/scripts/ovirt-wui-install index 41b4f3d..423bb87 100755 --- a/wui/scripts/ovirt-wui-install +++ b/wui/scripts/ovirt-wui-install @@ -17,6 +17,13 @@ OVIRT_SVCS="ovirt-host-browser ovirt-host-status \ ovirt-taskomatic ovirt-host-keyadd ovirt-mongrel-rails" ENABLE_SVCS="ntpd httpd postgresql libvirtd" +# This checks to see if we're running on a bundled/developer install. +# If we are, set PROD_INST to false +PROD_INST=true +if [ "$(hostname)" == "management.priv.ovirt.org" ]; then + PROD_INST=false +fi + usage() { echo "usage: $0 [-p password]" echo " -p : password to use for database connections, if omitted" @@ -27,13 +34,7 @@ usage() { find_srv() { local dnsreply - # This checks to see if we're running on a bundled/developer install. - # If so, the server queried is localhost instead of using resolv.conf. - if [ "$(hostname)" == "management.priv.ovirt.org" ]; then - local server_flag=@localhost - fi - - dnsreply=$(dig $server_flag +short -t srv _$1._$2.$(dnsdomainname)) + dnsreply=$(dig +short -t srv _$1._$2.$(dnsdomainname)) if [ $? -eq 0 ]; then set _ $dnsreply; shift SRV_HOST=$4; SRV_PORT=$3 @@ -118,6 +119,14 @@ if [ `egrep -c '^mech_list: gssapi' $SASL_FILE` -eq 0 ]; then echo "mech_list: gssapi" >> $SASL_FILE fi +# if we are developer/bundled install, remove default network +# so dnsmasq from libvirt doesn't interfere with the dev/bundled +# dnsmasq +if [[ "$PROD_INST" == "false" ]]; then + rm -fv /etc/libvirt/qemu/networks/autostart/default.xml + rm -fv /etc/libvirt/qemu/networks/default.xml +fi + service postgresql stop > /dev/null 2>&1 service postgresql initdb > /dev/null 2>&1 echo "local all all trust" > /var/lib/pgsql/data/pg_hba.conf -- 1.5.4.5
Daniel P. Berrange
2008-May-23 18:19 UTC
[Ovirt-devel] [PATCH] Fix so libvirt does not start default network interface on developer/bundled
On Fri, May 23, 2008 at 02:15:43PM -0400, Perry Myers wrote:> Libvirt by default tries to create a private network for running guests. > Because on the bundled/developer install we use dnsmasq ourselves, this > conflicts with the default libvirt network. Solution is that the appliance > must always be configured (via kickstart) to not start libvirtd. Then > when the ovirt install script runs it removes default.xml and starts > libvirt up.> +# if we are developer/bundled install, remove default network > +# so dnsmasq from libvirt doesn't interfere with the dev/bundled > +# dnsmasq > +if [[ "$PROD_INST" == "false" ]]; then > + rm -fv /etc/libvirt/qemu/networks/autostart/default.xml > + rm -fv /etc/libvirt/qemu/networks/default.xml > +fiNo, no, no and no. To disable it use virsh virsh destroy default virsh autostart --disable default Dan. -- |: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|