[Ovirt-devel] [PATCH node] Add collectd and libvirt-qpid setup to ovirt-install-node

Perry Myers pmyers at redhat.com
Tue Oct 14 21:22:55 UTC 2008


Daniel P. Berrange wrote:
> On Tue, Oct 14, 2008 at 02:28:33PM -0400, Perry Myers wrote:
>> This patch adds setup for libvirt-qpid and collectd to
>> the ovirt-install-node script so that they will both work
>> in stateful setup.
>>
>> Signed-off-by: Ian Main <imain at redhat.com>
>> Signed-off-by: Perry Myers <pmyers at redhat.com>
>> ---
>>  ovirt-listen-awake/ovirt-install-node   |   28 ++++++++++++++++++++++++----
>>  ovirt-listen-awake/ovirt-uninstall-node |    4 +++-
>>  2 files changed, 27 insertions(+), 5 deletions(-)
>>
>> diff --git a/ovirt-listen-awake/ovirt-install-node b/ovirt-listen-awake/ovirt-install-node
>> index a4a4b6f..95ba4de 100644
>> --- a/ovirt-listen-awake/ovirt-install-node
>> +++ b/ovirt-listen-awake/ovirt-install-node
>> @@ -28,7 +28,7 @@ backup_file() {
>>      dir=$(dirname "$1")
>>      case $dir in /*);; *) die "unexpected non-absolute dir: $dir";; esac
>>      mkdir -p "$OVIRT_BACKUP_DIR/${dir:1}"
>> -    cp -pf "$1" "$OVIRT_BACKUP_DIR/${dir:1}"
>> +    test -f "$1" && cp -pf "$1" "$OVIRT_BACKUP_DIR/${dir:1}"
>>  }
>>  
>>  add_if_not_exist() {
>> @@ -103,12 +103,31 @@ elif [ "$1" = "stateful" ]; then
>>      fi
>>      hostname $PHYS_HOST
>>  
>> +    collectd_conf=/etc/collectd.conf
>> +    backup_file $collectd_conf
>> +    if [ -f $collectd_conf.in ]; then
>> +        sed -e "s/@COLLECTD_SERVER@/$MGMT_HOST/" \
>> +            -e "s/@COLLECTD_PORT@/25826/" $collectd_conf.in \
>> +            > $collectd_conf
>> +    fi
> 
> Anyone fancy writing an augeas lens for collectd ?

I nominate lutter!  :)

>> +
>> +    libvirt_qpid_conf=/etc/sysconfig/libvirt-qpid
> 
> Doesn't augeas know how to edit all sysconfig files ? Be
> better to use that than sed/grep IMHO.

Yes, we should be using that instead.

>> +    backup_file $libvirt_qpid_conf
>> +    if [ -f $libvirt_qpid_conf ]; then
>> +        if grep "^LIBVIRT_QPID_ARGS=" $libvirt_qpid_conf > /dev/null 2>&1 ; then
>> +            sed -i -e "s/^LIBVIRT_QPID_ARGS=.*/LIBVIRT_QPID_ARGS=\"--broker $MGMT_HOST --port 5672\"/" $libvirt_qpid_conf
>> +        else
>> +            echo "LIBVIRT_QPID_ARGS=\"--broker $MGMT_HOST --port 5672\"" >> $libvirt_qpid_conf
>> +        fi
>> +    fi
>> +
>>      backup_file /etc/hosts
>>      add_if_not_exist "192.168.50.1 $PHYS_HOST" /etc/hosts
>>      add_if_not_exist "192.168.50.2 $MGMT_HOST" /etc/hosts
>>  
>>      chkconfig ovirt-listen-awake on
>>      chkconfig collectd on
>> +    chkconfig libvirt-qpid on
> 
> What's our security model for libvirt-qpid / brokers ? Our
> existing libvirtd setup is kerberos secured, so it'd expect
> qpid to at least match that before switching.

We're not switching over to qpid until they have integrated with kerberos. 
  It will be a few weeks.  qpid is on the node/appliance now just as a toy 
for people to start playing with.  It's not tied into Taskomatic or 
otherwise used by oVirt at all at this point.

Once they've secured qpid upstream, then we can swap out the existing 
libvirt remote calls for libvirt qpid calls.

Perry




More information about the ovirt-devel mailing list