From nicolas.ochem at alcatel-lucent.com Tue Mar 2 14:58:11 2010 From: nicolas.ochem at alcatel-lucent.com (Ochem, Nicolas (Nicolas)) Date: Tue, 2 Mar 2010 15:58:11 +0100 Subject: [Ovirt-devel] [PATCH] introduce option to always PXE-boot a VM Message-ID: <4B8D2783.60705@alcatel-lucent.com> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 0001-introduce-option-to-always-PXE-boot-a-VM.patch URL: From aclement at linagora.com Tue Mar 2 15:12:55 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 2 Mar 2010 16:12:55 +0100 Subject: [Ovirt-devel] fc12 node partially working Message-ID: <201003021612.56054.aclement@linagora.com> Hi, I finally have a fc12 node partially working. I still have to override the kargs runtime_mode in ovirt-early (I want "ovirt" runtime mode): 368 runtime_mode*) 369 OVIRT_RUNTIME_MODE=${i#runtime_mode=} 370 #runtime_mode=${i#runtime_mode=} 371 ;; And I have to set manually the the broker for qpid : service libvirt-qpid stop (export QPID_TRACE=1) libvirt-qpid --broker "ovirt_url" The problem seems to come from /etc/init.d/ovirt : /etc/krb5.conf, /etc/sysconfig/matahari are missing and /etc/sysconfig/libvirt- qpid is not configured. -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Wed Mar 3 11:22:46 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Wed, 3 Mar 2010 12:22:46 +0100 Subject: [Ovirt-devel] fc12 node partially working In-Reply-To: <201003021612.56054.aclement@linagora.com> References: <201003021612.56054.aclement@linagora.com> Message-ID: <201003031222.46839.aclement@linagora.com> I think I found the source of the missing conf. The find_srv function from ovirt-funtions does not find the server (and the bug is already ack in comments !) The dig command doesn't return anything when I tested it on my node. find_srv() { local dnsreply local domain=$(dnsdomainname 2>/dev/null) if [ "$domain" = "localdomain" ]; then domain="" fi # FIXME dig +search does not seem to work with -t srv # dnsreply=$(dig +short +search -t srv _$1._$2) # This is workaround: local search=$(grep search /etc/resolv.conf) search=${search#search } for d in $domain $search; do dnsreply=$(dig +short -t srv _$1._$2.$d) rc=$? if [ $rc -eq 0 ]; then set _ $dnsreply; shift SRV_HOST=$4; SRV_PORT=$3 return 0 fi done SRV_HOST=; SRV_PORT= return 1 } -- Arthur CLEMENT Linagora Paris From marcr at pic.es Wed Mar 3 16:13:53 2010 From: marcr at pic.es (Marc Rodriguez) Date: Wed, 3 Mar 2010 17:13:53 +0100 Subject: [Ovirt-devel] how to add hardware nodes Message-ID: <115f60e51003030813k171fc58do1946b68672adf4de@mail.gmail.com> hi I install ovirt manager, but I can't add ovirt nodes because the node not are in the web list, Anybody have a recipe to add hardware node ? -- Marc Rodr?guez (marcr at pic.es) Port D'informaci? Citentifica (www.pic.es) Campus UAB edifici D Bellaterra, Barcelona 08193 tel 935813322 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dpierce at redhat.com Wed Mar 3 20:21:32 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Mar 2010 15:21:32 -0500 Subject: [Ovirt-devel] [PATCH node] add noatime mount option to /config /var/log and /data In-Reply-To: <1265384504-27958-1-git-send-email-jboggs@redhat.com> References: <1265384504-27958-1-git-send-email-jboggs@redhat.com> Message-ID: <20100303202132.GF3774@mcpierce-desktop.usersys.redhat.com> On Fri, Feb 05, 2010 at 10:41:44AM -0500, Joey Boggs wrote: > --- > recipe/ovirt-node-image.ks | 2 +- > scripts/ovirt-config-storage | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/recipe/ovirt-node-image.ks b/recipe/ovirt-node-image.ks > index 0e56168..270eb77 100644 > --- a/recipe/ovirt-node-image.ks > +++ b/recipe/ovirt-node-image.ks > @@ -30,7 +30,7 @@ mkdir -p /boot > mkdir -p /config > mkdir -p /data > mkdir -p /liveos > -echo "/dev/HostVG/Config /config ext3 defaults,noauto 0 0" >> /etc/fstab > +echo "/dev/HostVG/Config /config ext3 defaults,noauto,noatime 0 0" >> /etc/fstab > %end > > %post > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index 460588b..2dc508f 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -522,7 +522,7 @@ perform_partitioning() > lvcreate --name Logging --size ${LOGGING_SIZE}M /dev/HostVG > mke2fs -j /dev/HostVG/Logging -L "LOGGING" > tune2fs -c 0 -i 0 /dev/HostVG/Logging > - echo "/dev/HostVG/Logging /var/log ext3 defaults 0 0" >> /etc/fstab > + echo "/dev/HostVG/Logging /var/log ext3 defaults,noatime 0 0" >> /etc/fstab > fi > > local use_data=1 > @@ -539,7 +539,7 @@ perform_partitioning() > if [ "$use_data" = 0 ]; then > mke2fs -j /dev/HostVG/Data -L "DATA" > tune2fs -c 0 -i 0 /dev/HostVG/Data > - echo "/dev/HostVG/Data /data ext3 defaults 0 0" >> /etc/fstab > + echo "/dev/HostVG/Data /data ext3 defaults,noatime 0 0" >> /etc/fstab > echo "/data/images /var/lib/libvirt/images bind bind 0 0" >> /etc/fstab > echo "/data/core /var/log/core bind bind 0 0" >> /etc/fstab > fi > -- > 1.6.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Mar 3 20:23:11 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Mar 2010 15:23:11 -0500 Subject: [Ovirt-devel] [PATCH node] remove ipv4 validation for ntp and rely on actual ntp verification In-Reply-To: <1265905171-31376-1-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> Message-ID: <20100303202311.GG3774@mcpierce-desktop.usersys.redhat.com> On Thu, Feb 11, 2010 at 11:19:27AM -0500, Joey Boggs wrote: > --- > scripts/ovirt-config-networking | 13 ++++++------- > scripts/ovirt-functions | 16 ++++++++++++++++ > 2 files changed, 22 insertions(+), 7 deletions(-) ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Mar 3 20:35:06 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Mar 2010 15:35:06 -0500 Subject: [Ovirt-devel] [PATCH node] update filtering of nics for ovirt-config-networking In-Reply-To: <1265905171-31376-2-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> Message-ID: <20100303203506.GH3774@mcpierce-desktop.usersys.redhat.com> On Thu, Feb 11, 2010 at 11:19:28AM -0500, Joey Boggs wrote: > This updates the filtering model to only display nics that have kernel modules associated with them, which filters out all nonphysical devices. > --- > scripts/ovirt-config-networking | 10 +++++++--- > 1 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking > index 40a2d2c..96e425f 100755 > --- a/scripts/ovirt-config-networking > +++ b/scripts/ovirt-config-networking > @@ -455,7 +455,7 @@ function setup_menu > fi > > # Add virtio NICs that were possibly not detected by hal > - NICS="$NICS $(ifconfig -a | awk '/Ethernet/ {print $1}' | grep -v -E "^br|^bond|^vnet|^virbr|\." | xargs)" > + NICS="$(ifconfig -a | awk '/Ethernet/ {print $1}'|xargs)" > NICS=$(echo $NICS | tr ' ' '\n' | sort -u | xargs) > > PS3="Please select an interface or configuration option: " > @@ -481,6 +481,7 @@ else > printf "***** WARNING *****\n" > printf "\nPhysical Networking Devices (*=PXE boot interface)\n" > printf " %-10s %-12s %-18s\n" "Name" "Driver" "MAC" > + PHY_NICS="" > for nic in $NICS; do > driver=$(basename $(readlink /sys/class/net/$nic/device/driver) 2>/dev/null) > mac=$(cat /sys/class/net/$nic/address) > @@ -489,14 +490,17 @@ else > else > pxe=" " > fi > - printf "%s%-10s %-12s %-18s\n" "$pxe" "$nic" "$driver" "$mac" > + if [ -n "$driver" ]; then > + PHY_NICS="$PHY_NICS $nic" > + printf "%s%-10s %-12s %-18s\n" "$pxe" "$nic" "$driver" "$mac" > + fi > done > > DNS="DNS" > NTP="NTP" > Abort="Abort" > Save="Save And Return To Menu" > - select NIC in $NICS "$DNS" "$NTP" "$Abort" "$Save" > + select NIC in $PHY_NICS "$DNS" "$NTP" "$Abort" "$Save" > do > printf "\n" > case "$NIC" in > -- > 1.6.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Mar 3 20:37:22 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Mar 2010 15:37:22 -0500 Subject: [Ovirt-devel] [PATCH node] remove vlans properly when changing network settings In-Reply-To: <1265905171-31376-4-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> <1265905171-31376-4-git-send-email-jboggs@redhat.com> Message-ID: <20100303203722.GI3774@mcpierce-desktop.usersys.redhat.com> On Thu, Feb 11, 2010 at 11:19:30AM -0500, Joey Boggs wrote: > --- > scripts/ovirt-config-networking | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking > index 96e425f..f1958c0 100755 > --- a/scripts/ovirt-config-networking > +++ b/scripts/ovirt-config-networking > @@ -529,6 +529,13 @@ if ls "$WORKDIR"/augtool-* > /dev/null 2>&1 ; then > log "Configuring network" > > # delete existing scripts > + for vlan in /proc/net/vlan/*; do > + if [[ ! "${vlan}" =~ config ]]; then > + vlan=$(echo $vlan|awk -F "/" {'print $5'}) > + vconfig rem $vlan > + fi > + done > + > for script in /etc/sysconfig/network-scripts/ifcfg-*; do > if [[ ! "${script}" =~ ifcfg-lo ]]; then > ovirt_safe_delete_config $script > -- > 1.6.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Mar 3 20:37:46 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Mar 2010 15:37:46 -0500 Subject: [Ovirt-devel] [PATCH node] restart ntp service after testing added ntp servers In-Reply-To: <1265905171-31376-5-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> <1265905171-31376-4-git-send-email-jboggs@redhat.com> <1265905171-31376-5-git-send-email-jboggs@redhat.com> Message-ID: <20100303203746.GJ3774@mcpierce-desktop.usersys.redhat.com> On Thu, Feb 11, 2010 at 11:19:31AM -0500, Joey Boggs wrote: > --- > scripts/ovirt-functions | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index 48d0e39..fae13e7 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -742,7 +742,7 @@ test_ntp_configuration () { > printf "\n Verified NTP server: $server \n" > fi > done > - > + service ntpd start > } > > # execute a function if called as a script, e.g. > -- > 1.6.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Mar 3 20:38:55 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Mar 2010 15:38:55 -0500 Subject: [Ovirt-devel] [PATCH node] remove secondary gpt header and create drive wiping function In-Reply-To: <1266354881-20129-1-git-send-email-jboggs@redhat.com> References: <1266354881-20129-1-git-send-email-jboggs@redhat.com> Message-ID: <20100303203855.GK3774@mcpierce-desktop.usersys.redhat.com> On Tue, Feb 16, 2010 at 04:14:41PM -0500, Joey Boggs wrote: > --- > scripts/ovirt-config-storage | 6 ++---- > scripts/ovirt-config-uninstall | 1 + > scripts/ovirt-functions | 11 +++++++++++ > 3 files changed, 14 insertions(+), 4 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index 9c3f773..f4f7e1e 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -415,8 +415,7 @@ perform_partitioning() > > if [ "$OVIRT_ISCSI_ENABLED" == "y" ]; then > log "Partitioning drive: $BOOTDRIVE" > - log "Wiping old boot sector" > - dd if=/dev/zero of=$BOOTDRIVE bs=1024K count=1 > + wipe_partitions $BOOTDRIVE > blockdev --rereadpt $BOOTDRIVE > partprobe -s $BOOTDRIVE > log "Creating boot partition" > @@ -434,8 +433,7 @@ perform_partitioning() > log "Starting partitioning of $ROOTDRIVE" > log "Partitioning drive: $ROOTDRIVE" > # FIXME: save a backup copy, just in case? > - log "Wiping old boot sector" > - dd if=/dev/zero of=$ROOTDRIVE bs=1024K count=1 > + wipe_partitions $ROOTDRIVE > blockdev --rereadpt $ROOTDRIVE > partprobe -s $ROOTDRIVE > log "Labeling Drive: $ROOTDRIVE" > diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall > index 820eead..f79d31c 100755 > --- a/scripts/ovirt-config-uninstall > +++ b/scripts/ovirt-config-uninstall > @@ -41,6 +41,7 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" > parted -s $drive "rm 1" > parted -s $drive "rm 2" > parted -s $drive "rm 3" > + wipe_partitions $drive > fi > printf "Finished uninstalling node." > else > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index fae13e7..3959e85 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -745,6 +745,17 @@ test_ntp_configuration () { > service ntpd start > } > > +# Cleans partition tables > +wipe_partitions() { > + local drive=$1 > + log "Wiping old boot sector" > + dd if=/dev/zero of=$drive bs=1024K count=1 > + # zero out the GPT secondary header > + log "Wiping secondary gpt header" > + local disk_kb_count=$(sfdisk -s $drive 2>/dev/null) > + dd if=/dev/zero of=$drive bs=1024 seek=$(($disk_kb_count - 1)) count=1 > +} > + > # execute a function if called as a script, e.g. > # ovirt-functions ovirt_store_config /etc/hosts > > -- > 1.6.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Mar 3 20:39:46 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Mar 2010 15:39:46 -0500 Subject: [Ovirt-devel] [PATCH node] Save configuration defaults during uninstallation In-Reply-To: <1266355499-21018-1-git-send-email-jboggs@redhat.com> References: <1266355499-21018-1-git-send-email-jboggs@redhat.com> Message-ID: <20100303203946.GL3774@mcpierce-desktop.usersys.redhat.com> On Tue, Feb 16, 2010 at 04:24:58PM -0500, Joey Boggs wrote: > For use during reinstallation. > --- > scripts/ovirt-config-uninstall | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall > index f79d31c..7c05258 100755 > --- a/scripts/ovirt-config-uninstall > +++ b/scripts/ovirt-config-uninstall > @@ -32,6 +32,7 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" > log "Uninstalling node" > log "Detaching logging" > unmount_logging > + unmount_config /etc/default/ovirt > log "Removing volume group" > wipe_volume_group "HostVG" > partition=$(findfs LABEL=Root) > -- > 1.6.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Mar 3 20:40:44 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Mar 2010 15:40:44 -0500 Subject: [Ovirt-devel] [PATCH node] store configuration defaults In-Reply-To: <1266355499-21018-2-git-send-email-jboggs@redhat.com> References: <1266355499-21018-1-git-send-email-jboggs@redhat.com> <1266355499-21018-2-git-send-email-jboggs@redhat.com> Message-ID: <20100303204044.GM3774@mcpierce-desktop.usersys.redhat.com> On Tue, Feb 16, 2010 at 04:24:59PM -0500, Joey Boggs wrote: > Store configuration defaults on a automated install > --- > scripts/ovirt-firstboot | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot > index b992909..288c133 100755 > --- a/scripts/ovirt-firstboot > +++ b/scripts/ovirt-firstboot > @@ -58,6 +58,7 @@ start () > mount_live > ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no > disable_firstboot > + ovirt_store_firstboot_config > reboot > return > fi > -- > 1.6.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From pmyers at redhat.com Wed Mar 3 21:44:48 2010 From: pmyers at redhat.com (Perry Myers) Date: Wed, 03 Mar 2010 16:44:48 -0500 Subject: [Ovirt-devel] Thinking about a more generic node... In-Reply-To: <20100223151543.GB2736@mcpierce-desktop.usersys.redhat.com> References: <20100223151543.GB2736@mcpierce-desktop.usersys.redhat.com> Message-ID: <4B8ED850.7090801@redhat.com> On 02/23/2010 10:15 AM, Darryl L. Pierce wrote: > So in working on making the node more generic, I've initially taken on > the startup processes. Right now I have patches that I'm finishing which > will give a more generic way of performing the following functions: > > * AWAKE - notify the management system the node is awake > * READY - notify the management system the node is ready to perform > tasks and run VMS > * OFFLINE - notify the management system the node is going offline > > What are other points we need to consider regarding the node's state and > lifecycle? I'm looking to explore what should be our initial set of > generic APIs that a management system would want to have available on a > node to make use of it. Might want to differentiate between states like: CONFIGURED UNCONFIGURED To differentiate between a node that has local config info vs. one that needs to grab config information. Where does config bundle grabbing fit into this model? AWAKE might need to be bundled with additional state information like a hardware manifest to tell the mgmt server "here's the latest set of hw that I just booted on" OFFLINE might also need to be broken up into: OFFLINE - this state is when the node is going down (hardware power off) STANDBY - idle node, but not powered off. mgmt system could toggle state back. Dunno, just some thoughts... Perry From apevec at redhat.com Thu Mar 4 10:59:16 2010 From: apevec at redhat.com (Alan Pevec) Date: Thu, 4 Mar 2010 11:59:16 +0100 Subject: [Ovirt-devel] [PATCH node] fix network_up Message-ID: <1267700356-4770-1-git-send-email-apevec@redhat.com> previous check reported ok even when DHCP failed --- scripts/ovirt-functions | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 1db89ae..866f963 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -734,7 +734,7 @@ is_valid_ipv4 () { # Check if networking is already up network_up () { - test -n "$(/sbin/ip -o link show up | cut -d: -f2 | grep -v 'lo$')" + ip addr show | grep -q "inet.*scope global" } # execute a function if called as a script, e.g. -- 1.6.0.6 From dpierce at redhat.com Thu Mar 4 14:17:16 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 4 Mar 2010 09:17:16 -0500 Subject: [Ovirt-devel] Thinking about a more generic node... In-Reply-To: <4B8ED850.7090801@redhat.com> References: <20100223151543.GB2736@mcpierce-desktop.usersys.redhat.com> <4B8ED850.7090801@redhat.com> Message-ID: <20100304141716.GP3774@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 03, 2010 at 04:44:48PM -0500, Perry Myers wrote: > On 02/23/2010 10:15 AM, Darryl L. Pierce wrote: > > So in working on making the node more generic, I've initially taken on > > the startup processes. Right now I have patches that I'm finishing which > > will give a more generic way of performing the following functions: > > > > * AWAKE - notify the management system the node is awake > > * READY - notify the management system the node is ready to perform > > tasks and run VMS > > * OFFLINE - notify the management system the node is going offline > > > > What are other points we need to consider regarding the node's state and > > lifecycle? I'm looking to explore what should be our initial set of > > generic APIs that a management system would want to have available on a > > node to make use of it. > > Might want to differentiate between states like: > CONFIGURED > UNCONFIGURED > > To differentiate between a node that has local config info vs. one that > needs to grab config information. Where does config bundle grabbing fit > into this model? Thinking about this, it seems to me a node is always technically unconfigured in that, each time it boots, it is given a networking configuration and applies it. Even a stateful node does this since it really doesn't do a delta of what is setup and what's new. I've also been thinking about whether configuration should be an all-in-one shot or if we should break out configuration updates into separate events. For example, if the admin changes networking setup on the node, then an "update networking" message is fired. Or if a network becomes unavailable then the node fires a "network update" message. But are there any other configuration types we'd want to handle, such as firewall changes or anything else? > AWAKE might need to be bundled with additional state information like a > hardware manifest to tell the mgmt server "here's the latest set of hw > that I just booted on" That sounds like a fine way to streamline the hardware identification portion. Right now we send it as a combination of network configuration/hardware set. But yesterday it was brought up in IRC that it might be a good idea to have a separate way to query the current networking configuration. If we break out the node reporting its network setup to a separate event, then there's no reason not to send the hardware information during wake up. > OFFLINE might also need to be broken up into: > OFFLINE - this state is when the node is going down (hardware power off) > STANDBY - idle node, but not powered off. mgmt system could toggle state > back. That's an interesting idea, having a standby state. If we can have a node do a wake-on-LAN when the management server needs it, then this would be a doable thing. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From apevec at redhat.com Thu Mar 4 21:24:10 2010 From: apevec at redhat.com (Alan Pevec) Date: Thu, 4 Mar 2010 22:24:10 +0100 Subject: [Ovirt-devel] [PATCH node] rootpw boot parameter Message-ID: <1267737850-12275-1-git-send-email-apevec@redhat.com> rootpw= sets a temporary root password, change is forced on first login password is crypted, same as Kickstart option rootpw --iscrypted WARNING: use for debugging only, this is not secure! Signed-off-by: Alan Pevec --- scripts/ovirt-early | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 6e8e5b3..1ab0578 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -247,6 +247,12 @@ start() { # enter emergency shell for fixing configuration issues rescue= + # rootpw= + # sets a temporary root password, change is forced on first login + # password is crypted, same as Kickstart option rootpw --iscrypted + # WARNING: use for debugging only, this is not secure! + rootpw= + # pxelinux format: ip=::: # anaconda format: ip= netmask= gateway= # ipv6=dhcp|auto @@ -365,6 +371,9 @@ start() { rescue) rescue=1 ;; + rootpw=*) + rootpw=${i#rootpw=} + ;; ovirt_overcommit*) i=${i#ovirt_overcommit=} @@ -459,6 +468,19 @@ start() { fi fi + if [ -n "$rootpw" ]; then + log "Setting temporary root password: $rootpw" + unmount_config /etc/passwd /etc/shadow + /usr/sbin/usermod -p $rootpw root + chage -d 0 root + # PAM will force password change at first login + # so make sure we persist it after a successful login + cat >> /root/.bash_profile << EOF +# added by ovirt-early +persist /etc/passwd /etc/shadow +EOF + fi + if [ "$rescue" = 1 ]; then log "Rescue mode requested, starting emergency shell" stop_log -- 1.6.0.6 From mburns at redhat.com Thu Mar 4 22:27:01 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 04 Mar 2010 17:27:01 -0500 Subject: [Ovirt-devel] [PATCH node] rootpw boot parameter In-Reply-To: <1267737850-12275-1-git-send-email-apevec@redhat.com> References: <1267737850-12275-1-git-send-email-apevec@redhat.com> Message-ID: <1267741621.1797.5.camel@localhost.localdomain> On Thu, 2010-03-04 at 22:24 +0100, Alan Pevec wrote: > rootpw= > sets a temporary root password, change is forced on first login > password is crypted, same as Kickstart option rootpw --iscrypted > > WARNING: use for debugging only, this is not secure! > > Signed-off-by: Alan Pevec > --- > scripts/ovirt-early | 22 ++++++++++++++++++++++ > 1 files changed, 22 insertions(+), 0 deletions(-) > > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 6e8e5b3..1ab0578 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -247,6 +247,12 @@ start() { > # enter emergency shell for fixing configuration issues > rescue= > > + # rootpw= > + # sets a temporary root password, change is forced on first login > + # password is crypted, same as Kickstart option rootpw --iscrypted > + # WARNING: use for debugging only, this is not secure! > + rootpw= > + > # pxelinux format: ip=::: > # anaconda format: ip= netmask= gateway= > # ipv6=dhcp|auto > @@ -365,6 +371,9 @@ start() { > rescue) > rescue=1 > ;; > + rootpw=*) > + rootpw=${i#rootpw=} > + ;; > > ovirt_overcommit*) > i=${i#ovirt_overcommit=} > @@ -459,6 +468,19 @@ start() { > fi > fi > > + if [ -n "$rootpw" ]; then > + log "Setting temporary root password: $rootpw" > + unmount_config /etc/passwd /etc/shadow > + /usr/sbin/usermod -p $rootpw root > + chage -d 0 root > + # PAM will force password change at first login > + # so make sure we persist it after a successful login > + cat >> /root/.bash_profile << EOF > +# added by ovirt-early > +persist /etc/passwd /etc/shadow > +EOF > + fi > + > if [ "$rescue" = 1 ]; then > log "Rescue mode requested, starting emergency shell" > stop_log ACK From jboggs at redhat.com Fri Mar 5 14:45:09 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 05 Mar 2010 09:45:09 -0500 Subject: [Ovirt-devel] [PATCH node] add noatime mount option to /config /var/log and /data In-Reply-To: <1265384504-27958-1-git-send-email-jboggs@redhat.com> References: <1265384504-27958-1-git-send-email-jboggs@redhat.com> Message-ID: <4B9118F5.9070004@redhat.com> On 02/05/2010 10:41 AM, Joey Boggs wrote: > --- > recipe/ovirt-node-image.ks | 2 +- > scripts/ovirt-config-storage | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/recipe/ovirt-node-image.ks b/recipe/ovirt-node-image.ks > index 0e56168..270eb77 100644 > --- a/recipe/ovirt-node-image.ks > +++ b/recipe/ovirt-node-image.ks > @@ -30,7 +30,7 @@ mkdir -p /boot > mkdir -p /config > mkdir -p /data > mkdir -p /liveos > -echo "/dev/HostVG/Config /config ext3 defaults,noauto 0 0">> /etc/fstab > +echo "/dev/HostVG/Config /config ext3 defaults,noauto,noatime 0 0">> /etc/fstab > %end > > %post > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index 460588b..2dc508f 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -522,7 +522,7 @@ perform_partitioning() > lvcreate --name Logging --size ${LOGGING_SIZE}M /dev/HostVG > mke2fs -j /dev/HostVG/Logging -L "LOGGING" > tune2fs -c 0 -i 0 /dev/HostVG/Logging > - echo "/dev/HostVG/Logging /var/log ext3 defaults 0 0">> /etc/fstab > + echo "/dev/HostVG/Logging /var/log ext3 defaults,noatime 0 0">> /etc/fstab > fi > > local use_data=1 > @@ -539,7 +539,7 @@ perform_partitioning() > if [ "$use_data" = 0 ]; then > mke2fs -j /dev/HostVG/Data -L "DATA" > tune2fs -c 0 -i 0 /dev/HostVG/Data > - echo "/dev/HostVG/Data /data ext3 defaults 0 0">> /etc/fstab > + echo "/dev/HostVG/Data /data ext3 defaults,noatime 0 0">> /etc/fstab > echo "/data/images /var/lib/libvirt/images bind bind 0 0">> /etc/fstab > echo "/data/core /var/log/core bind bind 0 0">> /etc/fstab > fi > pushed From jboggs at redhat.com Fri Mar 5 14:48:39 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 05 Mar 2010 09:48:39 -0500 Subject: [Ovirt-devel] [PATCH node] remove vlans properly when changing network settings In-Reply-To: <20100303203722.GI3774@mcpierce-desktop.usersys.redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> <1265905171-31376-4-git-send-email-jboggs@redhat.com> <20100303203722.GI3774@mcpierce-desktop.usersys.redhat.com> Message-ID: <4B9119C7.8070508@redhat.com> On 03/03/2010 03:37 PM, Darryl L. Pierce wrote: > On Thu, Feb 11, 2010 at 11:19:30AM -0500, Joey Boggs wrote: > >> --- >> scripts/ovirt-config-networking | 7 +++++++ >> 1 files changed, 7 insertions(+), 0 deletions(-) >> >> diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking >> index 96e425f..f1958c0 100755 >> --- a/scripts/ovirt-config-networking >> +++ b/scripts/ovirt-config-networking >> @@ -529,6 +529,13 @@ if ls "$WORKDIR"/augtool-*> /dev/null 2>&1 ; then >> log "Configuring network" >> >> # delete existing scripts >> + for vlan in /proc/net/vlan/*; do >> + if [[ ! "${vlan}" =~ config ]]; then >> + vlan=$(echo $vlan|awk -F "/" {'print $5'}) >> + vconfig rem $vlan >> + fi >> + done >> + >> for script in /etc/sysconfig/network-scripts/ifcfg-*; do >> if [[ ! "${script}" =~ ifcfg-lo ]]; then >> ovirt_safe_delete_config $script >> -- >> 1.6.6 >> >> _______________________________________________ >> Ovirt-devel mailing list >> Ovirt-devel at redhat.com >> https://www.redhat.com/mailman/listinfo/ovirt-devel >> > ACK. > > pushed From jboggs at redhat.com Fri Mar 5 14:50:58 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 05 Mar 2010 09:50:58 -0500 Subject: [Ovirt-devel] [PATCH node] update filtering of nics for ovirt-config-networking In-Reply-To: <20100303203506.GH3774@mcpierce-desktop.usersys.redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <20100303203506.GH3774@mcpierce-desktop.usersys.redhat.com> Message-ID: <4B911A52.10107@redhat.com> On 03/03/2010 03:35 PM, Darryl L. Pierce wrote: > On Thu, Feb 11, 2010 at 11:19:28AM -0500, Joey Boggs wrote: > >> This updates the filtering model to only display nics that have kernel modules associated with them, which filters out all nonphysical devices. >> --- >> scripts/ovirt-config-networking | 10 +++++++--- >> 1 files changed, 7 insertions(+), 3 deletions(-) >> >> diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking >> index 40a2d2c..96e425f 100755 >> --- a/scripts/ovirt-config-networking >> +++ b/scripts/ovirt-config-networking >> @@ -455,7 +455,7 @@ function setup_menu >> fi >> >> # Add virtio NICs that were possibly not detected by hal >> - NICS="$NICS $(ifconfig -a | awk '/Ethernet/ {print $1}' | grep -v -E "^br|^bond|^vnet|^virbr|\." | xargs)" >> + NICS="$(ifconfig -a | awk '/Ethernet/ {print $1}'|xargs)" >> NICS=$(echo $NICS | tr ' ' '\n' | sort -u | xargs) >> >> PS3="Please select an interface or configuration option: " >> @@ -481,6 +481,7 @@ else >> printf "***** WARNING *****\n" >> printf "\nPhysical Networking Devices (*=PXE boot interface)\n" >> printf " %-10s %-12s %-18s\n" "Name" "Driver" "MAC" >> + PHY_NICS="" >> for nic in $NICS; do >> driver=$(basename $(readlink /sys/class/net/$nic/device/driver) 2>/dev/null) >> mac=$(cat /sys/class/net/$nic/address) >> @@ -489,14 +490,17 @@ else >> else >> pxe=" " >> fi >> - printf "%s%-10s %-12s %-18s\n" "$pxe" "$nic" "$driver" "$mac" >> + if [ -n "$driver" ]; then >> + PHY_NICS="$PHY_NICS $nic" >> + printf "%s%-10s %-12s %-18s\n" "$pxe" "$nic" "$driver" "$mac" >> + fi >> done >> >> DNS="DNS" >> NTP="NTP" >> Abort="Abort" >> Save="Save And Return To Menu" >> - select NIC in $NICS "$DNS" "$NTP" "$Abort" "$Save" >> + select NIC in $PHY_NICS "$DNS" "$NTP" "$Abort" "$Save" >> do >> printf "\n" >> case "$NIC" in >> -- >> 1.6.6 >> >> _______________________________________________ >> Ovirt-devel mailing list >> Ovirt-devel at redhat.com >> https://www.redhat.com/mailman/listinfo/ovirt-devel >> > ACK. > > pushed From jboggs at redhat.com Fri Mar 5 15:02:01 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 05 Mar 2010 10:02:01 -0500 Subject: [Ovirt-devel] [PATCH node] Save configuration defaults during uninstallation In-Reply-To: <20100303203946.GL3774@mcpierce-desktop.usersys.redhat.com> References: <1266355499-21018-1-git-send-email-jboggs@redhat.com> <20100303203946.GL3774@mcpierce-desktop.usersys.redhat.com> Message-ID: <4B911CE9.1010106@redhat.com> On 03/03/2010 03:39 PM, Darryl L. Pierce wrote: > On Tue, Feb 16, 2010 at 04:24:58PM -0500, Joey Boggs wrote: > >> For use during reinstallation. >> --- >> scripts/ovirt-config-uninstall | 1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >> diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall >> index f79d31c..7c05258 100755 >> --- a/scripts/ovirt-config-uninstall >> +++ b/scripts/ovirt-config-uninstall >> @@ -32,6 +32,7 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" >> log "Uninstalling node" >> log "Detaching logging" >> unmount_logging >> + unmount_config /etc/default/ovirt >> log "Removing volume group" >> wipe_volume_group "HostVG" >> partition=$(findfs LABEL=Root) >> -- >> 1.6.6 >> >> _______________________________________________ >> Ovirt-devel mailing list >> Ovirt-devel at redhat.com >> https://www.redhat.com/mailman/listinfo/ovirt-devel >> > ACK. > > pushed From jboggs at redhat.com Fri Mar 5 15:09:37 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 05 Mar 2010 10:09:37 -0500 Subject: [Ovirt-devel] [PATCH node] store configuration defaults In-Reply-To: <20100303204044.GM3774@mcpierce-desktop.usersys.redhat.com> References: <1266355499-21018-1-git-send-email-jboggs@redhat.com> <1266355499-21018-2-git-send-email-jboggs@redhat.com> <20100303204044.GM3774@mcpierce-desktop.usersys.redhat.com> Message-ID: <4B911EB1.3090205@redhat.com> On 03/03/2010 03:40 PM, Darryl L. Pierce wrote: > On Tue, Feb 16, 2010 at 04:24:59PM -0500, Joey Boggs wrote: > >> Store configuration defaults on a automated install >> --- >> scripts/ovirt-firstboot | 1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >> diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot >> index b992909..288c133 100755 >> --- a/scripts/ovirt-firstboot >> +++ b/scripts/ovirt-firstboot >> @@ -58,6 +58,7 @@ start () >> mount_live >> ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no >> disable_firstboot >> + ovirt_store_firstboot_config >> reboot >> return >> fi >> -- >> 1.6.6 >> >> _______________________________________________ >> Ovirt-devel mailing list >> Ovirt-devel at redhat.com >> https://www.redhat.com/mailman/listinfo/ovirt-devel >> > ACK. > > pushed From jboggs at redhat.com Fri Mar 5 15:34:48 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 05 Mar 2010 10:34:48 -0500 Subject: [Ovirt-devel] [PATCH node] restart ntp service after testing added ntp servers In-Reply-To: <20100303203746.GJ3774@mcpierce-desktop.usersys.redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> <1265905171-31376-4-git-send-email-jboggs@redhat.com> <1265905171-31376-5-git-send-email-jboggs@redhat.com> <20100303203746.GJ3774@mcpierce-desktop.usersys.redhat.com> Message-ID: <4B912498.2000105@redhat.com> On 03/03/2010 03:37 PM, Darryl L. Pierce wrote: > + service ntpd start > pushed From jboggs at redhat.com Fri Mar 5 15:36:50 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 05 Mar 2010 10:36:50 -0500 Subject: [Ovirt-devel] outstanding patches Message-ID: <4B912512.4060203@redhat.com> I've got 2 old patches that will probably end up getting lost in the list, can someone ack? [PATCH node] Enables ability to have a common shared root [PATCH node] prevent hostvg and sharedroot from accepting same drive input From dpierce at redhat.com Mon Mar 8 21:02:29 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Mar 2010 16:02:29 -0500 Subject: [Ovirt-devel] ovirt-debug-data In-Reply-To: <201003082113.43573.aclement@linagora.com> References: <18b07f6386b8ffb8ff31886f6c602b09.squirrel@intranet.linagora.com> <20100308195432.GC3668@mcpierce-desktop.usersys.redhat.com> <201003082113.43573.aclement@linagora.com> Message-ID: <20100308210229.GD3668@mcpierce-desktop.usersys.redhat.com> (cc'ing the ovirt-devel mailing list) On Mon, Mar 08, 2010 at 09:13:43PM +0100, Arthur CLEMENT wrote: > I need an non-reachable ip to increase the security (nobody have to log on the > node from this interface). The interface does'nt require an ip, the ethernet > connection is sufficient to be bridged, only vms will get an ip. I already use > unconfigured interface (0.0.0.0) on the server which hosts ovirt and it works > pretty well. Yeah, but it raises a problem with the way the node data payload is processed. This is an edge use case and definitely not one we had thought about when considering how to setup a node's network interfaces, having the NIC on the host have no IP but instead only have the VMs get IP addresses. I think a better way to handle this is to explicitly configure the network interface to have no address. Then what's passed down by the server would be something that explicitly says "don't configure networking on this NIC". I've submitted a patch to the list for handing the missing field name or value which is produced by this particular configuration. It will abort processing the config when it shows up. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From aclement at linagora.com Tue Mar 9 15:25:31 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 9 Mar 2010 16:25:31 +0100 Subject: [Ovirt-devel] Bugs with ovirt-awake Message-ID: <201003091625.32037.aclement@linagora.com> The ovirt-awake script is no more in the path, only in /etc/init.d/ so the ovirt script return a command not found. I did little dirty fix in /etc/init.d/ovirt : diff --git a/scripts/ovirt b/scripts/ovirt index 160c3d3..d9e50a2 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -41,7 +41,7 @@ ovirt_start() { if [ -s $krb5_tab ]; then krb5_tab= fi - ovirt-awake start $SRV_HOST $SRV_PORT $krb5_tab + /etc/init.d/ovirt-awake start $SRV_HOST $SRV_PORT $krb5_tab if [ $? -ne 0 ]; then log "ovirt-awake failed"; return 1 fi It raises an other problem : [...] Mar 08 17:07:52 Starting ovirt Starting ovirt-awake: /etc/init.d/ovirt-awake: line 71: /dev/tcp/"host_addr":12120: No such file or directory /etc/init.d/ovirt-awake: line 73: connect-to-server: command not found /etc/init.d/ovirt-awake: line 49: 3: Bad file descriptor /etc/init.d/ovirt-awake: line 75: [: ==: unary operator expected /etc/init.d/ovirt-awake: line 45: 3: Bad file descriptor /etc/init.d/ovirt-awake: line 97: 3: Bad file descriptor Mar 08 17:07:53 Completed ovirt-awake: RETVAL=0 ^[[60G[^[[0;31mFAILED^[[0;39m]^MMar 08 17:07:53 ovirt-awake failed [...] l 71 : it's a problem with the net redirection in bash my little fix : diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index c6a6902..8983ef1 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -68,7 +68,7 @@ ovirt_startup () { if [[ -n "${mgmthost}" ]] && [[ -n "${mgmtport}" ]]; then # log "Notifying oVirt management server: ${mgmthost}:${mgmtport}" - exec 3<> /dev/tcp/$mgmthost:$mgmtport + exec 3<>/dev/tcp/$mgmthost/$mgmtport connect-to-server receive_text if [ $REPLY == "HELLO?" ]; then - logo "Starting wakeup conversation." + log "Starting wakeup conversation." send_text "HELLO!" receive_text I still have this error : Starting ovirt-awake: /etc/init.d/ovirt-awake: line 73: connect-to-server: command not found The function has been removed by D Pierce : http://www.mail-archive.com/ovirt-devel at redhat.com/msg00445.html -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Tue Mar 9 16:13:25 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 9 Mar 2010 11:13:25 -0500 Subject: [Ovirt-devel] Bugs with ovirt-awake In-Reply-To: <201003091625.32037.aclement@linagora.com> References: <201003091625.32037.aclement@linagora.com> Message-ID: <20100309161325.GG3668@mcpierce-desktop.usersys.redhat.com> On Tue, Mar 09, 2010 at 04:25:31PM +0100, Arthur CLEMENT wrote: > The ovirt-awake script is no more in the path, only in /etc/init.d/ so the > ovirt script return a command not found. > I did little dirty fix in /etc/init.d/ovirt : > > diff --git a/scripts/ovirt b/scripts/ovirt > index 160c3d3..d9e50a2 100755 > --- a/scripts/ovirt > +++ b/scripts/ovirt > @@ -41,7 +41,7 @@ ovirt_start() { > if [ -s $krb5_tab ]; then > krb5_tab= > fi > - ovirt-awake start $SRV_HOST $SRV_PORT $krb5_tab > + /etc/init.d/ovirt-awake start $SRV_HOST $SRV_PORT $krb5_tab > if [ $? -ne 0 ]; then > log "ovirt-awake failed"; return 1 > fi ovirt-awake is no longer a command line tool but instead should be working as a separate service. It's the first one that should run in the chain of ovirt-specific services. Also, it doesn't handle command line arguments any longer but is instead driven by the DNS SRV records for the management server and the contents of the /etc/sysconfig/node-config file. > diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake > index c6a6902..8983ef1 100755 > --- a/scripts/ovirt-awake > +++ b/scripts/ovirt-awake > @@ -68,7 +68,7 @@ ovirt_startup () { > > if [[ -n "${mgmthost}" ]] && [[ -n "${mgmtport}" ]]; then > # log "Notifying oVirt management server: ${mgmthost}:${mgmtport}" > - exec 3<> /dev/tcp/$mgmthost:$mgmtport > + exec 3<>/dev/tcp/$mgmthost/$mgmtport > > connect-to-server > receive_text > if [ $REPLY == "HELLO?" ]; then > - logo "Starting wakeup conversation." > + log "Starting wakeup conversation." > send_text "HELLO!" > receive_text > > > > > I still have this error : > > Starting ovirt-awake: /etc/init.d/ovirt-awake: line 73: connect-to-server: > command not found D'oh! Yeah, that call to connect-to-server should have been removed since it's replaced by the previous line to connection 3 to the TCP socket. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Mar 10 04:18:14 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 9 Mar 2010 23:18:14 -0500 Subject: [Ovirt-devel] [PATCH node] Improve performance of multipath translations Message-ID: <1268194694-28008-1-git-send-email-mburns@redhat.com> Cleanup the translations of /dev/sdX to /dev/mapper and vice-versa. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 24 +++++++++++++++--------- scripts/ovirt-functions | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index aea73f8..cf73aa4 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -38,13 +38,12 @@ swap_min_size=5 get_sd_name() { local id=$1 local device_var=$2 - for device in $(ls /sys/block) - do - if [[ $id = $(cat /sys/block/$device/dev) ]]; then - eval $device_var=$device - return - fi - done + local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1) + + if [ -n "$device_sys" ]; then + eval $device_var=$(basename $(dirname $device_sys)) + return + fi eval $device_var=1 } @@ -83,10 +82,17 @@ translate_multipath_device() { local dev=$1 local mpath_var=$2 + if [[ $dev =~ "/dev/mapper" ]]; then + eval $mpath_var=$dev + return + fi + local basedev=$(basename $dev) - local mpath_device=$(multipath -ll $dev |grep -n . | \ - grep "^1:" |awk '{print $1}' | sed 's/^1:/\/dev\/mapper\//g') + local dm_dev=/dev/$(multipath -ll $dev | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') + + local mpath_device= + get_dm_device $dm_dev $mpath_device if [ -z "$mpath_device" ]; then mpath_device=$dev diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 6839614..5661bee 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -765,6 +765,28 @@ test_ntp_configuration () { } +get_dm_device () +{ + local device=$1 + local return_var=$2 + major=$(stat -c '%t' $(readlink -f $device)) + minor=$(stat -c '%T' $(readlink -f $device)) + local dm_device= + local rc=1 + for dm in /dev/mapper/*; do + if [ $major = $(stat -c '%t' $dm) -a \ + $minor = $(stat -c '%T' $dm) ]; then + local dm_device=$dm + rc=0 + break + fi + done + + eval $return_var=$dm_device + + return $rc +} + # execute a function if called as a script, e.g. # ovirt-functions ovirt_store_config /etc/hosts -- 1.6.6.1 From dpierce at redhat.com Wed Mar 10 13:26:59 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 10 Mar 2010 08:26:59 -0500 Subject: [Ovirt-devel] [PATCH] Fixes how o-process-config handles missing field names or values. Message-ID: <1268227619-13589-1-git-send-email-dpierce@redhat.com> When a name/value pair in the node configuration payload is received and is missing one or the other, the script will now display an error message and exit rather than applying the configuration payload. Resolves: rhbz#571556 Signed-off-by: Darryl L. Pierce --- scripts/ovirt-process-config | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-process-config b/scripts/ovirt-process-config index 6011cd7..8f6a8b6 100755 --- a/scripts/ovirt-process-config +++ b/scripts/ovirt-process-config @@ -9,6 +9,8 @@ ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } + try_h() { printf "Try \`$ME -h' for more information.\n" >&2; exit 1;} try_help() { printf "Usage: \`$ME [config] [module output] [config output]\n" >&2; exit 1;} @@ -55,20 +57,41 @@ networking=$(awk '/^[ \t]*ifcfg=/ { field=values[1] value=values[2] + if(length(field) == 0) { + print "Missing field name." + exit 1 + } + + if(length(value) == 0) { + print "Missing field value." + exit 2 + } + printf("set %s/ifcfg-%s/%s %s\n", ifcfg_dir, iface, field, value) } } }' $CONFIG) +SUCCESS=$? + +if [ SUCCESS != 0 ]; then + case $SUCCESS in + 1) error="missing field name";; + 2) error="missing field value";; + esac + + die "Bad data received: ${error}" +fi + echo "$networking" > $OVIRT_CONFIG_OUTPUT_FILE if [ -f $OVIRT_CONFIG_OUTPUT_FILE ]; then augtool $OVIRT_CONFIG_OUTPUT_FILE \ - && RESULT=0 || RESULT=1 + && RESULT=0 || RESULT=1 # FIXME do not store ifcfg-lo if ls /etc/sysconfig/network-scripts/ifcfg* >/dev/null 2>/dev/null; then - ovirt_store_config /etc/sysconfig/network-scripts/ifcfg* + ovirt_store_config /etc/sysconfig/network-scripts/ifcfg* fi fi -- 1.6.6.1 From aclement at linagora.com Wed Mar 10 15:09:11 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Wed, 10 Mar 2010 16:09:11 +0100 Subject: [Ovirt-devel] [PATCH] ovirt-awake enhancements Message-ID: <201003101609.11994.aclement@linagora.com> >From 7755e3f3e8e9d76d2bd352bfcfb384e61dd67661 Mon Sep 17 00:00:00 2001 From: Arthur CLEMENT Date: Wed, 10 Mar 2010 15:04:40 +0000 Subject: [PATCH] Fix prog name Signed-off-by: Arthur CLEMENT --- scripts/ovirt-awake | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index 46c64b5..bd50ffd 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -32,7 +32,7 @@ . /etc/init.d/functions . /usr/libexec/ovirt-functions -prog=ovirt-early +prog=ovirt-awake NODE_CONFIG=/etc/sysconfig/node-config VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config -- 1.6.6.1 >From 42473d304b890b2e427899e204a4b8fe2e5478df Mon Sep 17 00:00:00 2001 From: Arthur CLEMENT Date: Wed, 10 Mar 2010 14:16:10 +0000 Subject: [PATCH] ovirt-awake runs alone now, fix some typo Signed-off-by: Arthur CLEMENT --- scripts/ovirt-awake | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index edef186..46c64b5 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -68,12 +68,11 @@ ovirt_startup () { if [[ -n "${mgmthost}" ]] && [[ -n "${mgmtport}" ]]; then # log "Notifying oVirt management server: ${mgmthost}:${mgmtport}" - exec 3<> /dev/tcp/$mgmthost:$mgmtport + exec 3<>/dev/tcp/$mgmthost/$mgmtport - connect-to-server receive_text if [ $REPLY == "HELLO?" ]; then - logo "Starting wakeup conversation." + log "Starting wakeup conversation." send_text "HELLO!" receive_text if [ $REPLY == "MODE?" ]; then -- 1.6.6.1 -- Arthur CLEMENT Linagora Paris From jboggs at redhat.com Wed Mar 10 15:14:12 2010 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 10 Mar 2010 10:14:12 -0500 Subject: [Ovirt-devel] [PATCH server] update cobbler pxe profile for dracut based booting Message-ID: <1268234052-7778-1-git-send-email-jboggs@redhat.com> --- installer/modules/ovirt/files/cobbler-import | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/installer/modules/ovirt/files/cobbler-import b/installer/modules/ovirt/files/cobbler-import index 126cfaf..e6a6764 100755 --- a/installer/modules/ovirt/files/cobbler-import +++ b/installer/modules/ovirt/files/cobbler-import @@ -46,7 +46,7 @@ node_dir=/usr/share/ovirt-node-image cobbler distro add --name="oVirt-Node-$node_arch" --arch=$node_arch \ --initrd=$node_dir/tftpboot/initrd0.img --kernel=$node_dir/tftpboot/vmlinuz0 \ - --kopts="rootflags=loop root=/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 console=ttyS0,115200n8" + --kopts="rootflags=loop root=live:/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 console=ttyS0,115200n8" cobbler profile add --name=oVirt-Node-$node_arch --distro=oVirt-Node-$node_arch cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \ -- 1.6.6.1 From jboggs at redhat.com Wed Mar 10 15:27:02 2010 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 10 Mar 2010 10:27:02 -0500 Subject: [Ovirt-devel] [PATCH server] update cobbler pxe profile for dracut based booting In-Reply-To: <1268234052-7778-1-git-send-email-jboggs@redhat.com> References: <1268234052-7778-1-git-send-email-jboggs@redhat.com> Message-ID: <4B97BA46.4040608@redhat.com> On 03/10/2010 10:14 AM, Joey Boggs wrote: > --- > installer/modules/ovirt/files/cobbler-import | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/installer/modules/ovirt/files/cobbler-import b/installer/modules/ovirt/files/cobbler-import > index 126cfaf..e6a6764 100755 > --- a/installer/modules/ovirt/files/cobbler-import > +++ b/installer/modules/ovirt/files/cobbler-import > @@ -46,7 +46,7 @@ node_dir=/usr/share/ovirt-node-image > > cobbler distro add --name="oVirt-Node-$node_arch" --arch=$node_arch \ > --initrd=$node_dir/tftpboot/initrd0.img --kernel=$node_dir/tftpboot/vmlinuz0 \ > - --kopts="rootflags=loop root=/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 console=ttyS0,115200n8" > + --kopts="rootflags=loop root=live:/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 console=ttyS0,115200n8" > > cobbler profile add --name=oVirt-Node-$node_arch --distro=oVirt-Node-$node_arch > cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \ > pushed From dpierce at redhat.com Wed Mar 10 15:32:31 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 10 Mar 2010 10:32:31 -0500 Subject: [Ovirt-devel] [PATCH] ovirt-awake enhancements In-Reply-To: <201003101609.11994.aclement@linagora.com> References: <201003101609.11994.aclement@linagora.com> Message-ID: <20100310153231.GM3668@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 10, 2010 at 04:09:11PM +0100, Arthur CLEMENT wrote: ACK. Both are pushed. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From aclement at linagora.com Wed Mar 10 16:11:12 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Wed, 10 Mar 2010 17:11:12 +0100 Subject: [Ovirt-devel] [PATCH] Set KEYTAB_FILE=/etc/libvirt/krb5.tab in node-config Message-ID: <201003101711.12704.aclement@linagora.com> Yesterday on irc : 18:12 < arthurc> "Mar 09 17:08:01 Retrieving keytab:" :) and my host appears in ovirt (still unavailable but it's better). I defined in ovirt-awake : KEYTAB_FILE=/etc/libvirt/krb5.tab 19:04 < mcpierce> arthurc: kk - the value ought to be moved to /etc/sysconfig/node-config. I'll cut a patch and send it out. Is this ok ? >From c20b0fef9a5a5f525189b5f4ef268fd1ff392265 Mon Sep 17 00:00:00 2001 From: Arthur CLEMENT Date: Wed, 10 Mar 2010 16:00:38 +0000 Subject: [PATCH] Set KEYTAB_FILE=/etc/libvirt/krb5.tab in node-config Signed-off-by: Arthur CLEMENT --- scripts/node-config | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/scripts/node-config b/scripts/node-config index 47d42a1..0fa5735 100644 --- a/scripts/node-config +++ b/scripts/node-config @@ -12,4 +12,6 @@ OVIRT_RUNTIME_MODE="none" OVIRT_MANAGEMENT_SERVER="" # the maangement server port -OVIRT_MANAGEMENT_PORT="" \ No newline at end of file +OVIRT_MANAGEMENT_PORT="" + +# the keytab directory +KEYTAB_FILE=/etc/libvirt/krb5.tab -- 1.6.6.1 -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Wed Mar 10 16:19:34 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Wed, 10 Mar 2010 17:19:34 +0100 Subject: [Ovirt-devel] [PATCH] ovirt-awake runs alone now, doesn't need anymore to be lauch by /etc/init.d/ovirt Message-ID: <201003101719.34916.aclement@linagora.com> >From b3c03b4a7c6b0072012ffc2533c63775fc9eff5f Mon Sep 17 00:00:00 2001 From: Arthur CLEMENT Date: Wed, 10 Mar 2010 16:15:40 +0000 Subject: [PATCH] ovirt-awake runs alone now, doesn't need anymore to be lauch by /etc/init.d/ovirt Signed-off-by: Arthur CLEMENT --- scripts/ovirt | 14 -------------- 1 files changed, 0 insertions(+), 14 deletions(-) diff --git a/scripts/ovirt b/scripts/ovirt index 25b9860..3059d35 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -37,20 +37,6 @@ ovirt_start() { log "skipping Kerberos configuration" fi - find_srv identify tcp - if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then - krb5_tab=/etc/libvirt/krb5.tab - # skip ktab download if we got it from /config - if [ -s $krb5_tab ]; then - krb5_tab= - fi - ovirt-awake start $SRV_HOST $SRV_PORT $krb5_tab - if [ $? -ne 0 ]; then - log "ovirt-awake failed"; return 1 - fi - else - log "skipping ovirt-awake, oVirt identify service not available" - fi find_srv collectd udp if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then -- 1.6.6.1 -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Wed Mar 10 16:19:44 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 10 Mar 2010 11:19:44 -0500 Subject: [Ovirt-devel] [PATCH] Set KEYTAB_FILE=/etc/libvirt/krb5.tab in node-config In-Reply-To: <201003101711.12704.aclement@linagora.com> References: <201003101711.12704.aclement@linagora.com> Message-ID: <20100310161944.GA2867@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 10, 2010 at 05:11:12PM +0100, Arthur CLEMENT wrote: > Yesterday on irc : > > 18:12 < arthurc> "Mar 09 17:08:01 Retrieving keytab:" :) and my host appears > in ovirt (still unavailable but it's better). I defined in ovirt-awake : > KEYTAB_FILE=/etc/libvirt/krb5.tab > 19:04 < mcpierce> arthurc: kk - the value ought to be moved to > /etc/sysconfig/node-config. I'll cut a patch and send it out. > > Is this ok ? > > > >From c20b0fef9a5a5f525189b5f4ef268fd1ff392265 Mon Sep 17 00:00:00 2001 > From: Arthur CLEMENT > Date: Wed, 10 Mar 2010 16:00:38 +0000 > Subject: [PATCH] Set KEYTAB_FILE=/etc/libvirt/krb5.tab in node-config > > > Signed-off-by: Arthur CLEMENT > --- > scripts/node-config | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/scripts/node-config b/scripts/node-config > index 47d42a1..0fa5735 100644 > --- a/scripts/node-config > +++ b/scripts/node-config > @@ -12,4 +12,6 @@ OVIRT_RUNTIME_MODE="none" > OVIRT_MANAGEMENT_SERVER="" > > # the maangement server port > -OVIRT_MANAGEMENT_PORT="" > \ No newline at end of file > +OVIRT_MANAGEMENT_PORT="" > + > +# the keytab directory > +KEYTAB_FILE=/etc/libvirt/krb5.tab > -- > 1.6.6.1 yep, this is the kind of change we need. I'll test it and push it (seems find). -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Mar 10 16:45:33 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 10 Mar 2010 11:45:33 -0500 Subject: [Ovirt-devel] [PATCH] Set KEYTAB_FILE=/etc/libvirt/krb5.tab in node-config In-Reply-To: <201003101711.12704.aclement@linagora.com> References: <201003101711.12704.aclement@linagora.com> Message-ID: <20100310164533.GB2867@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 10, 2010 at 05:11:12PM +0100, Arthur CLEMENT wrote: > Signed-off-by: Arthur CLEMENT > --- > scripts/node-config | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/scripts/node-config b/scripts/node-config > index 47d42a1..0fa5735 100644 > --- a/scripts/node-config > +++ b/scripts/node-config > @@ -12,4 +12,6 @@ OVIRT_RUNTIME_MODE="none" > OVIRT_MANAGEMENT_SERVER="" > > # the maangement server port > -OVIRT_MANAGEMENT_PORT="" > \ No newline at end of file > +OVIRT_MANAGEMENT_PORT="" > + > +# the keytab directory > +KEYTAB_FILE=/etc/libvirt/krb5.tab > -- > 1.6.6.1 ACK and pushed. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From aclement at linagora.com Wed Mar 10 17:31:38 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Wed, 10 Mar 2010 18:31:38 +0100 Subject: [Ovirt-devel] Bugs with ovirt-awake In-Reply-To: <20100309161325.GG3668@mcpierce-desktop.usersys.redhat.com> References: <201003091625.32037.aclement@linagora.com> <20100309161325.GG3668@mcpierce-desktop.usersys.redhat.com> Message-ID: <201003101831.39009.aclement@linagora.com> I have other things to report about ovirt-awake The script doesn't know the runtime mode In my /proc/cmdline I have "runtime_mode=ovirt", but in my ovirt.log : "Node is operating in unmanaged mode" I found that the loading of /etc/sysconfig/node-config overide the karg variable OVIRT_RUNTIME_MODE all the time . I found these lines in ovirt-awake : # load the configuration file [ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" have to be before this : . /usr/libexec/ovirt-functions I don't know where this ovirt-functions script gets OVIRT_RUNTIME_MODE ( from /proc/cmdline I guess ) but I precise I still override the kargs runtime_mode in ovirt-early ($runtime_mode read from karg is not converted in $OVIRT_RUNTIME_MODE ), I doubt there is an influence but I prefer to mention it. my little fix for ovirt-early (this fix have to be fix :) ) runtime mode): 368 runtime_mode*) 369 runtime_mode=${i#runtime_mode=} 370 OVIRT_RUNTIME_MODE=${i#runtime_mode=} 371 ;; I'll perform more tests next week but if you have ant thoughts you're welcome -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Wed Mar 10 19:55:58 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 10 Mar 2010 14:55:58 -0500 Subject: [Ovirt-devel] Bugs with ovirt-awake In-Reply-To: <201003101831.39009.aclement@linagora.com> References: <201003091625.32037.aclement@linagora.com> <20100309161325.GG3668@mcpierce-desktop.usersys.redhat.com> <201003101831.39009.aclement@linagora.com> Message-ID: <20100310195558.GA16512@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 10, 2010 at 06:31:38PM +0100, Arthur CLEMENT wrote: > I have other things to report about ovirt-awake > > The script doesn't know the runtime mode > > In my /proc/cmdline I have "runtime_mode=ovirt", but in my ovirt.log : > "Node is operating in unmanaged mode" > > I found that the loading of /etc/sysconfig/node-config overide the karg variable > OVIRT_RUNTIME_MODE all the time . The command line argument's not getting processed until ovirt-early, which is after the awake process. > I found these lines in ovirt-awake : > # load the configuration file > [ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" > > have to be before this : > > . /usr/libexec/ovirt-functions > > I don't know where this ovirt-functions script gets OVIRT_RUNTIME_MODE ( from > /proc/cmdline I guess ) but I precise I still override the kargs runtime_mode > in ovirt-early ($runtime_mode read from karg is not converted in > $OVIRT_RUNTIME_MODE ), I doubt there is an influence but I prefer to mention > it. > > my little fix for ovirt-early (this fix have to be fix :) ) > runtime mode): > > 368 runtime_mode*) > 369 runtime_mode=${i#runtime_mode=} > 370 OVIRT_RUNTIME_MODE=${i#runtime_mode=} > 371 ;; > > > I'll perform more tests next week but if you have ant thoughts you're welcome I think we should pull the kernel argument portion of ovirt-early out and make THAT run before anything else, including ovirt-awake. That way the kernel arguments are pull out up front before anything else is done. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Mar 10 20:09:30 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 10 Mar 2010 15:09:30 -0500 Subject: [Ovirt-devel] [PATCH node] Include psmisc package Message-ID: <1268251770-14135-1-git-send-email-mburns@redhat.com> This includes the fuser package Signed-off-by: Mike Burns --- recipe/common-blacklist.ks | 2 +- recipe/common-pkgs.ks | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/recipe/common-blacklist.ks b/recipe/common-blacklist.ks index b36efef..7c08c39 100644 --- a/recipe/common-blacklist.ks +++ b/recipe/common-blacklist.ks @@ -15,7 +15,7 @@ RPMS="$RPMS mkinitrd isomd5sum dmraid checkpolicy" # Remove additional RPMs forcefully RPMS="$RPMS gamin pm-utils kbd usermode vbetool ConsoleKit hdparm \ efibootmgr linux-atm-libs fedora-release-notes \ - psmisc cryptsetup-luks pciutils mtools syslinux \ + cryptsetup-luks pciutils mtools syslinux \ wireless-tools radeontool libicu gnupg2 \ fedora-logos" diff --git a/recipe/common-pkgs.ks b/recipe/common-pkgs.ks index 3aafe53..797d07c 100644 --- a/recipe/common-pkgs.ks +++ b/recipe/common-pkgs.ks @@ -32,6 +32,7 @@ sysstat tcpdump pstack pciutils +psmisc numactl file lsof -- 1.6.6.1 From apevec at gmail.com Wed Mar 10 20:18:14 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 10 Mar 2010 21:18:14 +0100 Subject: [Ovirt-devel] [PATCH node] Include psmisc package In-Reply-To: <1268251770-14135-1-git-send-email-mburns@redhat.com> References: <1268251770-14135-1-git-send-email-mburns@redhat.com> Message-ID: <2be7262f1003101218j1c8b80e8s1441fcb5bc4723aa@mail.gmail.com> On Wed, Mar 10, 2010 at 9:09 PM, Mike Burns wrote: > This includes the fuser package reason to include is that fuser is required by init.d/functions __umount_loop() otherwise reboot hangs on /etc due to readonly-root setup ACK From mburns at redhat.com Wed Mar 10 20:24:46 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 10 Mar 2010 15:24:46 -0500 Subject: [Ovirt-devel] [PATCH node] Include psmisc package In-Reply-To: <2be7262f1003101218j1c8b80e8s1441fcb5bc4723aa@mail.gmail.com> References: <1268251770-14135-1-git-send-email-mburns@redhat.com> <2be7262f1003101218j1c8b80e8s1441fcb5bc4723aa@mail.gmail.com> Message-ID: <1268252686.2243.17.camel@mburns-laptop.bos.redhat.com> On Wed, 2010-03-10 at 21:18 +0100, Alan Pevec wrote: > On Wed, Mar 10, 2010 at 9:09 PM, Mike Burns wrote: > > This includes the fuser package > > reason to include is that fuser is required by init.d/functions __umount_loop() > > otherwise reboot hangs on /etc due to readonly-root setup > > ACK > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel Pushed with modified commit message From mburns at redhat.com Wed Mar 10 20:32:29 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 10 Mar 2010 15:32:29 -0500 Subject: [Ovirt-devel] [PATCH node] Fix reboot issue Message-ID: <1268253149-15512-1-git-send-email-mburns@redhat.com> Reboots were not working correctly due the use of "stop" when stopping services. It resulted in the reboot process dying. See https://bugzilla.redhat.com/show_bug.cgi?id=519366 for details. Signed-off-by: Mike Burns --- scripts/ovirt | 2 +- scripts/ovirt-firstboot | 2 +- scripts/ovirt-post | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt b/scripts/ovirt index 3059d35..752564a 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -114,7 +114,7 @@ case "$1" in start ;; stop) - stop + rm -f /var/lock/subsys/ovirt ;; *) echo "Usage: ovirt {start}" diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot index 58847f4..7717a50 100755 --- a/scripts/ovirt-firstboot +++ b/scripts/ovirt-firstboot @@ -98,7 +98,7 @@ case "$1" in start ;; stop) - stop + rm -f /var/lock/subsys/ovirt-firstboot ;; *) echo "Usage: ovirt-firstboot {start}" diff --git a/scripts/ovirt-post b/scripts/ovirt-post index 16af387..f53157a 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -107,7 +107,7 @@ case "$1" in start ;; stop) - stop + rm -f /var/lock/subsys/ovirt-post ;; *) echo "Usage: ovirt-post {start}" -- 1.6.6.1 From apevec at gmail.com Wed Mar 10 20:52:40 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 10 Mar 2010 21:52:40 +0100 Subject: [Ovirt-devel] [PATCH node] Fix reboot issue In-Reply-To: <1268253149-15512-1-git-send-email-mburns@redhat.com> References: <1268253149-15512-1-git-send-email-mburns@redhat.com> Message-ID: <2be7262f1003101252s7dee3197jd888be1be7004d21@mail.gmail.com> On Wed, Mar 10, 2010 at 9:32 PM, Mike Burns wrote: > Reboots were not working correctly due the use of "stop" when > stopping services. ?It resulted in the reboot process dying. issue was that stop() was not defined in those scripts, so stop was actually upstart's initctl stop > See https://bugzilla.redhat.com/show_bug.cgi?id=519366 for details. > > Signed-off-by: Mike Burns > --- > ?scripts/ovirt ? ? ? ? ? | ? ?2 +- > ?scripts/ovirt-firstboot | ? ?2 +- > ?scripts/ovirt-post ? ? ?| ? ?2 +- ACK From mburns at redhat.com Wed Mar 10 21:00:18 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 10 Mar 2010 16:00:18 -0500 Subject: [Ovirt-devel] [PATCH node] Fix reboot issue In-Reply-To: <2be7262f1003101252s7dee3197jd888be1be7004d21@mail.gmail.com> References: <1268253149-15512-1-git-send-email-mburns@redhat.com> <2be7262f1003101252s7dee3197jd888be1be7004d21@mail.gmail.com> Message-ID: <1268254818.2243.18.camel@mburns-laptop.bos.redhat.com> On Wed, 2010-03-10 at 21:52 +0100, Alan Pevec wrote: > On Wed, Mar 10, 2010 at 9:32 PM, Mike Burns wrote: > > Reboots were not working correctly due the use of "stop" when > > stopping services. It resulted in the reboot process dying. > > issue was that stop() was not defined in those scripts, so stop was > actually upstart's initctl stop > > > See https://bugzilla.redhat.com/show_bug.cgi?id=519366 for details. > > > > Signed-off-by: Mike Burns > > --- > > scripts/ovirt | 2 +- > > scripts/ovirt-firstboot | 2 +- > > scripts/ovirt-post | 2 +- > > ACK Pushed From dpierce at redhat.com Thu Mar 11 13:55:04 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Mar 2010 08:55:04 -0500 Subject: [Ovirt-devel] [PATCH] Changes the order of ovirt-early and ovirt-awake. Message-ID: <1268315704-23136-1-git-send-email-dpierce@redhat.com> Now the execution order for the ovirt sysvinit scripts is: ovirt-early -> ovirt-awake -> ovirt -> ovirt-post Signed-off-by: Darryl L. Pierce --- scripts/ovirt | 2 +- scripts/ovirt-awake | 1 + scripts/ovirt-early | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt b/scripts/ovirt index 752564a..d2e338d 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -4,7 +4,7 @@ # ### BEGIN INIT INFO # Provides: ovirt -# Required-Start: ovirt-early +# Required-Start: ovirt-awake # Default-Start: 2 3 4 5 # Description: Performs managed node configuration functions. ### END INIT INFO diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index bd50ffd..e4d5a28 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -22,6 +22,7 @@ # ### BEGIN INIT INFO # Provides: ovirt-awake +# Required-Start: ovirt-early # Default-Start: 2 3 4 5 # Description: Managed node service to alert management servers. ### END INIT INFO diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 1ab0578..d561dc8 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -4,7 +4,6 @@ # ### BEGIN INIT INFO # Provides: ovirt-early -# Required-Start: ovirt-awake # Default-Start: 2 3 4 5 # Dewscription: Managed node early configuration service ### END INIT INFO -- 1.6.6.1 From dpierce at redhat.com Thu Mar 11 14:38:11 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Mar 2010 09:38:11 -0500 Subject: [Ovirt-devel] Bugs with ovirt-awake In-Reply-To: <20100310195558.GA16512@mcpierce-desktop.usersys.redhat.com> References: <201003091625.32037.aclement@linagora.com> <20100309161325.GG3668@mcpierce-desktop.usersys.redhat.com> <201003101831.39009.aclement@linagora.com> <20100310195558.GA16512@mcpierce-desktop.usersys.redhat.com> Message-ID: <20100311143811.GC16512@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 10, 2010 at 02:55:58PM -0500, Darryl L. Pierce wrote: > I think we should pull the kernel argument portion of ovirt-early out and make > THAT run before anything else, including ovirt-awake. That way the > kernel arguments are pull out up front before anything else is done. I've submitted a patch to the list that reorders the sysvinit scripts which should solve the problem here. Can you apply it and try the set and give me an ACK or feedback on it? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Thu Mar 11 18:45:13 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Mar 2010 13:45:13 -0500 Subject: [Ovirt-devel] [PATCH] Changes the start/stop/reload method names for sysvinit scripts. Message-ID: <1268333113-9168-1-git-send-email-dpierce@redhat.com> To avoid possibly invoking similarly named executables, all start, stop and reload methods in the sysvinit scripts have been renamed to start_/stop_/reload_[script name]. Signed-off-by: Darryl L. Pierce --- scripts/ovirt | 17 +++++++++++------ scripts/ovirt-awake | 20 +++++++++++++++++++- scripts/ovirt-early | 16 ++++++++++------ scripts/ovirt-firstboot | 28 ++++++++++++++++++---------- scripts/ovirt-post | 16 ++++++++++------ 5 files changed, 68 insertions(+), 29 deletions(-) diff --git a/scripts/ovirt b/scripts/ovirt index 752564a..ef00f02 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -71,7 +71,7 @@ ovirt_start() { fi } -start() { +start_ovirt () { touch $VAR_SUBSYS_OVIRT case $OVIRT_RUNTIME_MODE in "ovirt") @@ -90,18 +90,24 @@ start() { return $RC } -stop() { +stop_ovirt () { echo -n "Stopping ovirt: " + rm -f $VAR_SUBSYS_OVIRT success } +reload_ovirt () { + stop_ovirt + start_ovirt +} + case "$1" in start) [ -f "$VAR_SUBSYS_OVIRT" ] && exit 0 echo -n "Starting ovirt: " { log "Starting ovirt" - start + start_ovirt log "Completed ovirt" } >> $OVIRT_LOGFILE 2>&1 test $? == 0 && success || failure @@ -110,11 +116,10 @@ case "$1" in status $prog ;; reload) - stop - start + reload_ovirt ;; stop) - rm -f /var/lock/subsys/ovirt + stop_ovirt ;; *) echo "Usage: ovirt {start}" diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index bd50ffd..d5865c5 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -103,7 +103,7 @@ ovirt_startup () { # Override this method to provide support for notifying a management # system that the node has started and will be available after # system initialization -start () { +start_ovirt_awake () { local RC=0 touch $VAR_SUBSYS_NODECONFIG @@ -131,6 +131,16 @@ start () { return $RC } +stop_ovirt_awake () { + echo -n "Stopping ovirt-awake: " + success +} + +reload_ovirt_awake () { + stop_ovirt_awake + start_ovirt_awake +} + case "$1" in start) echo -n "Starting ovirt-awake: " @@ -143,6 +153,14 @@ case "$1" in test $RETVAL == 0 && success || failure ;; + stop) + stop_ovirt_awake + ;; + + reload) + reload_ovirt_awake + ;; + *) echo "Usage: $0 start" RETVAL=2 diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 1ab0578..88070e3 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -172,7 +172,7 @@ configure_management_interface() { esac } -start() { +start_ovirt_early () { touch $VAR_SUBSYS_OVIRT_EARLY # oVirt boot parameters # BOOTIF=link|eth*| (appended by pxelinux) @@ -511,18 +511,23 @@ EOF return 0 } -stop() { +stop_ovirt_early () { echo -n "Stopping ovirt-early: " success } +reload_ovirt_early () { + stop_ovirt_early + start_ovirt_early +} + case "$1" in start) [ -f "$VAR_SUBSYS_NODE_CONFIG" ] && exit 0 echo -n "Starting ovirt-early: " { log "Starting ovirt-early" - start + start_ovirt_early log "Completed ovirt-early" RETVAL=$? } >> $OVIRT_LOGFILE 2>&1 @@ -532,11 +537,10 @@ case "$1" in status $prog ;; reload) - stop - start + reload_ovirt_early ;; stop) - stop + stop_ovirt_early ;; *) echo "Usage: ovirt-early {start}" diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot index 7717a50..89a2c2b 100755 --- a/scripts/ovirt-firstboot +++ b/scripts/ovirt-firstboot @@ -28,18 +28,18 @@ . /usr/libexec/ovirt-functions prog=ovirt-firstboot -lockfile=/var/lock/subsys/$prog +VAR_SUBSYS_OVIRT_FIRSTBOOT=/var/lock/subsys/$prog trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 -start () +start_ovirt_firstboot () { if ! is_firstboot && ! is_auto_install && ! is_upgrade; then return fi - - touch $lockfile + + touch $VAR_SUBSYS_OVIRT_FIRSTBOOT # by default in standalone, disable collectd until server is configured service collectd stop > /dev/null 2>&1 @@ -74,7 +74,17 @@ start () ovirt_store_firstboot_config >> $OVIRT_LOGFILE 2>&1 - rm -f $lockfile + rm -f $VAR_SUBSYS_OVIRT_FIRSTBOOT +} + +stop_ovirt_firstboot () { + echo -n "Stopping ovirt-firstboot: " + success +} + +reload_ovirt_firstboot () { + stop_ovirt_firstboot + start_ovirt_firstboot } case "$1" in @@ -85,7 +95,7 @@ case "$1" in printf "Starting ovirt-firstboot: " - start + start_ovirt_firstboot test $? == 0 && success || failure echo @@ -94,14 +104,12 @@ case "$1" in status $prog ;; reload) - stop - start + reload_ovirt_firstboot ;; stop) - rm -f /var/lock/subsys/ovirt-firstboot + stop_ovirt_firstboot ;; *) echo "Usage: ovirt-firstboot {start}" exit 2 esac - diff --git a/scripts/ovirt-post b/scripts/ovirt-post index f53157a..d0d1d20 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -19,7 +19,7 @@ VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog # load the configuration file [ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" -start() { +start_ovirt_post() { # wait for libvirt to finish initializing local count=0 while true; do @@ -80,11 +80,16 @@ start() { rm -f $VAR_SUBSYS_OVIRT_POST } -stop() { +stop_ovirt_post () { echo -n "Stopping ovirt-post: " success } +reload_ovirt_post () { + stop_ovirt_post + start_ovirt_post +} + case "$1" in start) [ -f "$VAR_SUBSYS_OVIRT_POST" ] && exit 0 @@ -92,7 +97,7 @@ case "$1" in { log "Starting ovirt-post" - start + start_ovirt_post log "Completed ovirt-post" } >> $OVIRT_LOGFILE 2>&1 @@ -103,11 +108,10 @@ case "$1" in status $prog ;; reload) - stop - start + reload_ovirt_post ;; stop) - rm -f /var/lock/subsys/ovirt-post + stop_ovirt_post ;; *) echo "Usage: ovirt-post {start}" -- 1.6.6.1 From mburns at redhat.com Thu Mar 11 19:55:09 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 11 Mar 2010 14:55:09 -0500 Subject: [Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage Message-ID: <1268337309-28388-1-git-send-email-mburns@redhat.com> Code that scanned for dirty storage was accidentally grepping the contents of an entire partition. This led to an apparent hang in situations where partitions were large. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index aea73f8..92d79dd 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -550,7 +550,7 @@ wipe_lvm_on_disk() unmount_logging for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE* 2>/dev/null|sort -u); do if pvs -o pv_name,vg_name --noheadings | \ - grep $vg | grep -v -q $dev* 2>/dev/null; then + grep $vg | egrep -v -q "${dev}p?[0-9]*" 2>/dev/null; then log "The volume group \"$vg\" spans multiple disks." log "This operation cannot complete. Please manullay" log "cleanup the storage using standard linux tools." -- 1.6.6.1 From mburns at redhat.com Thu Mar 11 20:19:48 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 11 Mar 2010 15:19:48 -0500 Subject: [Ovirt-devel] [PATCH] Changes the start/stop/reload method names for sysvinit scripts. In-Reply-To: <1268333113-9168-1-git-send-email-dpierce@redhat.com> References: <1268333113-9168-1-git-send-email-dpierce@redhat.com> Message-ID: <1268338788.19678.7.camel@mburns-laptop.bos.redhat.com> On Thu, 2010-03-11 at 13:45 -0500, Darryl L. Pierce wrote: > To avoid possibly invoking similarly named executables, all start, stop > and reload methods in the sysvinit scripts have been renamed to > start_/stop_/reload_[script name]. > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt | 17 +++++++++++------ > scripts/ovirt-awake | 20 +++++++++++++++++++- > scripts/ovirt-early | 16 ++++++++++------ > scripts/ovirt-firstboot | 28 ++++++++++++++++++---------- > scripts/ovirt-post | 16 ++++++++++------ > 5 files changed, 68 insertions(+), 29 deletions(-) > > diff --git a/scripts/ovirt b/scripts/ovirt > index 752564a..ef00f02 100755 > --- a/scripts/ovirt > +++ b/scripts/ovirt > @@ -71,7 +71,7 @@ ovirt_start() { > fi > } > > -start() { > +start_ovirt () { > touch $VAR_SUBSYS_OVIRT > case $OVIRT_RUNTIME_MODE in > "ovirt") > @@ -90,18 +90,24 @@ start() { > return $RC > } > > -stop() { > +stop_ovirt () { > echo -n "Stopping ovirt: " > + rm -f $VAR_SUBSYS_OVIRT > success > } > > +reload_ovirt () { > + stop_ovirt > + start_ovirt > +} > + > case "$1" in > start) > [ -f "$VAR_SUBSYS_OVIRT" ] && exit 0 > echo -n "Starting ovirt: " > { > log "Starting ovirt" > - start > + start_ovirt > log "Completed ovirt" > } >> $OVIRT_LOGFILE 2>&1 > test $? == 0 && success || failure > @@ -110,11 +116,10 @@ case "$1" in > status $prog > ;; > reload) > - stop > - start > + reload_ovirt > ;; > stop) > - rm -f /var/lock/subsys/ovirt > + stop_ovirt > ;; > *) > echo "Usage: ovirt {start}" > diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake > index bd50ffd..d5865c5 100755 > --- a/scripts/ovirt-awake > +++ b/scripts/ovirt-awake > @@ -103,7 +103,7 @@ ovirt_startup () { > # Override this method to provide support for notifying a management > # system that the node has started and will be available after > # system initialization > -start () { > +start_ovirt_awake () { > local RC=0 > > touch $VAR_SUBSYS_NODECONFIG > @@ -131,6 +131,16 @@ start () { > return $RC > } > > +stop_ovirt_awake () { > + echo -n "Stopping ovirt-awake: " > + success > +} > + > +reload_ovirt_awake () { > + stop_ovirt_awake > + start_ovirt_awake > +} > + > case "$1" in > start) > echo -n "Starting ovirt-awake: " > @@ -143,6 +153,14 @@ case "$1" in > test $RETVAL == 0 && success || failure > ;; > > + stop) > + stop_ovirt_awake > + ;; > + > + reload) > + reload_ovirt_awake > + ;; > + > *) > echo "Usage: $0 start" > RETVAL=2 > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 1ab0578..88070e3 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -172,7 +172,7 @@ configure_management_interface() { > esac > } > > -start() { > +start_ovirt_early () { > touch $VAR_SUBSYS_OVIRT_EARLY > # oVirt boot parameters > # BOOTIF=link|eth*| (appended by pxelinux) > @@ -511,18 +511,23 @@ EOF > return 0 > } > > -stop() { > +stop_ovirt_early () { > echo -n "Stopping ovirt-early: " > success > } > > +reload_ovirt_early () { > + stop_ovirt_early > + start_ovirt_early > +} > + > case "$1" in > start) > [ -f "$VAR_SUBSYS_NODE_CONFIG" ] && exit 0 > echo -n "Starting ovirt-early: " > { > log "Starting ovirt-early" > - start > + start_ovirt_early > log "Completed ovirt-early" > RETVAL=$? > } >> $OVIRT_LOGFILE 2>&1 > @@ -532,11 +537,10 @@ case "$1" in > status $prog > ;; > reload) > - stop > - start > + reload_ovirt_early > ;; > stop) > - stop > + stop_ovirt_early > ;; > *) > echo "Usage: ovirt-early {start}" > diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot > index 7717a50..89a2c2b 100755 > --- a/scripts/ovirt-firstboot > +++ b/scripts/ovirt-firstboot > @@ -28,18 +28,18 @@ > . /usr/libexec/ovirt-functions > > prog=ovirt-firstboot > -lockfile=/var/lock/subsys/$prog > +VAR_SUBSYS_OVIRT_FIRSTBOOT=/var/lock/subsys/$prog > > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > > -start () > +start_ovirt_firstboot () > { > if ! is_firstboot && ! is_auto_install && ! is_upgrade; then > return > fi > - > - touch $lockfile > + > + touch $VAR_SUBSYS_OVIRT_FIRSTBOOT > > # by default in standalone, disable collectd until server is configured > service collectd stop > /dev/null 2>&1 > @@ -74,7 +74,17 @@ start () > > ovirt_store_firstboot_config >> $OVIRT_LOGFILE 2>&1 > > - rm -f $lockfile > + rm -f $VAR_SUBSYS_OVIRT_FIRSTBOOT > +} > + > +stop_ovirt_firstboot () { > + echo -n "Stopping ovirt-firstboot: " > + success > +} > + > +reload_ovirt_firstboot () { > + stop_ovirt_firstboot > + start_ovirt_firstboot > } > > case "$1" in > @@ -85,7 +95,7 @@ case "$1" in > > printf "Starting ovirt-firstboot: " > > - start > + start_ovirt_firstboot > > test $? == 0 && success || failure > echo > @@ -94,14 +104,12 @@ case "$1" in > status $prog > ;; > reload) > - stop > - start > + reload_ovirt_firstboot > ;; > stop) > - rm -f /var/lock/subsys/ovirt-firstboot > + stop_ovirt_firstboot > ;; > *) > echo "Usage: ovirt-firstboot {start}" > exit 2 > esac > - > diff --git a/scripts/ovirt-post b/scripts/ovirt-post > index f53157a..d0d1d20 100755 > --- a/scripts/ovirt-post > +++ b/scripts/ovirt-post > @@ -19,7 +19,7 @@ VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog > # load the configuration file > [ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" > > -start() { > +start_ovirt_post() { > # wait for libvirt to finish initializing > local count=0 > while true; do > @@ -80,11 +80,16 @@ start() { > rm -f $VAR_SUBSYS_OVIRT_POST > } > > -stop() { > +stop_ovirt_post () { > echo -n "Stopping ovirt-post: " > success > } > > +reload_ovirt_post () { > + stop_ovirt_post > + start_ovirt_post > +} > + > case "$1" in > start) > [ -f "$VAR_SUBSYS_OVIRT_POST" ] && exit 0 > @@ -92,7 +97,7 @@ case "$1" in > > { > log "Starting ovirt-post" > - start > + start_ovirt_post > log "Completed ovirt-post" > } >> $OVIRT_LOGFILE 2>&1 > > @@ -103,11 +108,10 @@ case "$1" in > status $prog > ;; > reload) > - stop > - start > + reload_ovirt_post > ;; > stop) > - rm -f /var/lock/subsys/ovirt-post > + stop_ovirt_post > ;; > *) > echo "Usage: ovirt-post {start}" ACK From mburns at redhat.com Thu Mar 11 20:22:38 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 11 Mar 2010 15:22:38 -0500 Subject: [Ovirt-devel] [PATCH node-image] store iso in build directory after autobuild Message-ID: <1268338958-31393-1-git-send-email-mburns@redhat.com> The iso is needed in the build directory for autotest.sh to work when running as part of autobuild. This enhances autobuild.sh to copy it over after the rpms are built. Signed-off-by: Mike Burns --- autobuild.sh | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index fb9de92..aeee7dd 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -42,3 +42,16 @@ if [ -f /usr/bin/rpmbuild ]; then --define "ovirt_local_repo file://$AUTOBUILD_PACKAGE_ROOT/rpm/RPMS" \ -ta --clean *.tar.gz fi + +#Copy iso image back here for autotest + +#get image rpm +RPM=$(ls -t ${AUTOBUILD_PACKAGE_ROOT}/rpm/RPMS/x86_64/ovirt-node-image-[0-9]*x86_64.rpm | head -n1) + +TEMPDIR=$(mktemp -d -p .) +cp $RPM $TEMPDIR +cd $TEMPDIR +rpm2cpio *rpm | pax -r +cp $(find . -name "*iso") ${AUTOBUILD_SOURCE_ROOT}/${AUTOBUILD_MODULE} +cd ${AUTOBUILD_SOURCE_ROOT}/${AUTOBUILD_MODULE} +rm -rf $TEMPDIR -- 1.6.6.1 From dpierce at redhat.com Thu Mar 11 20:32:32 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Mar 2010 15:32:32 -0500 Subject: [Ovirt-devel] [PATCH] Changes the start/stop/reload method names for sysvinit scripts. In-Reply-To: <1268338788.19678.7.camel@mburns-laptop.bos.redhat.com> References: <1268333113-9168-1-git-send-email-dpierce@redhat.com> <1268338788.19678.7.camel@mburns-laptop.bos.redhat.com> Message-ID: <20100311203232.GC5735@mcpierce-desktop.usersys.redhat.com> On Thu, Mar 11, 2010 at 03:19:48PM -0500, Mike Burns wrote: > ACK Thanks. This is now pushed upstream. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Thu Mar 11 20:46:02 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Mar 2010 15:46:02 -0500 Subject: [Ovirt-devel] [PATCH node-image] store iso in build directory after autobuild In-Reply-To: <1268338958-31393-1-git-send-email-mburns@redhat.com> References: <1268338958-31393-1-git-send-email-mburns@redhat.com> Message-ID: <20100311204602.GD5735@mcpierce-desktop.usersys.redhat.com> On Thu, Mar 11, 2010 at 03:22:38PM -0500, Mike Burns wrote: > The iso is needed in the build directory for autotest.sh to work > when running as part of autobuild. This enhances autobuild.sh to > copy it over after the rpms are built. > > Signed-off-by: Mike Burns > --- > autobuild.sh | 13 +++++++++++++ > 1 files changed, 13 insertions(+), 0 deletions(-) > > diff --git a/autobuild.sh b/autobuild.sh > index fb9de92..aeee7dd 100755 > --- a/autobuild.sh > +++ b/autobuild.sh > @@ -42,3 +42,16 @@ if [ -f /usr/bin/rpmbuild ]; then > --define "ovirt_local_repo file://$AUTOBUILD_PACKAGE_ROOT/rpm/RPMS" \ > -ta --clean *.tar.gz > fi > + > +#Copy iso image back here for autotest > + > +#get image rpm > +RPM=$(ls -t ${AUTOBUILD_PACKAGE_ROOT}/rpm/RPMS/x86_64/ovirt-node-image-[0-9]*x86_64.rpm | head -n1) > + > +TEMPDIR=$(mktemp -d -p .) > +cp $RPM $TEMPDIR > +cd $TEMPDIR > +rpm2cpio *rpm | pax -r > +cp $(find . -name "*iso") ${AUTOBUILD_SOURCE_ROOT}/${AUTOBUILD_MODULE} > +cd ${AUTOBUILD_SOURCE_ROOT}/${AUTOBUILD_MODULE} > +rm -rf $TEMPDIR > -- > 1.6.6.1 Looks logical to me. Though shouldn't the test explicity know where, within the temp directory, the ISO is located, rather than using find to locate it? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Thu Mar 11 20:58:07 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 11 Mar 2010 15:58:07 -0500 Subject: [Ovirt-devel] [PATCH node-image] store iso in build directory after autobuild In-Reply-To: <20100311204602.GD5735@mcpierce-desktop.usersys.redhat.com> References: <1268338958-31393-1-git-send-email-mburns@redhat.com> <20100311204602.GD5735@mcpierce-desktop.usersys.redhat.com> Message-ID: <1268341087.19678.18.camel@mburns-laptop.bos.redhat.com> On Thu, 2010-03-11 at 15:46 -0500, Darryl L. Pierce wrote: > On Thu, Mar 11, 2010 at 03:22:38PM -0500, Mike Burns wrote: > > The iso is needed in the build directory for autotest.sh to work > > when running as part of autobuild. This enhances autobuild.sh to > > copy it over after the rpms are built. > > > > Signed-off-by: Mike Burns > > --- > > autobuild.sh | 13 +++++++++++++ > > 1 files changed, 13 insertions(+), 0 deletions(-) > > > > diff --git a/autobuild.sh b/autobuild.sh > > index fb9de92..aeee7dd 100755 > > --- a/autobuild.sh > > +++ b/autobuild.sh > > @@ -42,3 +42,16 @@ if [ -f /usr/bin/rpmbuild ]; then > > --define "ovirt_local_repo file://$AUTOBUILD_PACKAGE_ROOT/rpm/RPMS" \ > > -ta --clean *.tar.gz > > fi > > + > > +#Copy iso image back here for autotest > > + > > +#get image rpm > > +RPM=$(ls -t ${AUTOBUILD_PACKAGE_ROOT}/rpm/RPMS/x86_64/ovirt-node-image-[0-9]*x86_64.rpm | head -n1) > > + > > +TEMPDIR=$(mktemp -d -p .) > > +cp $RPM $TEMPDIR > > +cd $TEMPDIR > > +rpm2cpio *rpm | pax -r > > +cp $(find . -name "*iso") ${AUTOBUILD_SOURCE_ROOT}/${AUTOBUILD_MODULE} > > +cd ${AUTOBUILD_SOURCE_ROOT}/${AUTOBUILD_MODULE} > > +rm -rf $TEMPDIR > > -- > > 1.6.6.1 > > Looks logical to me. Though shouldn't the test explicity know where, > within the temp directory, the ISO is located, rather than using find to > locate it? > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel I'll change find to usr/share/*/*iso and push. I've verified in an autobuild that this works as expected. Mike From jan.mrozek at nalinuxu.cz Fri Mar 12 17:27:56 2010 From: jan.mrozek at nalinuxu.cz (Jan Mrozek) Date: Fri, 12 Mar 2010 18:27:56 +0100 Subject: [Ovirt-devel] missing dependencies in ovirt-build Message-ID: <6524aa501003120927n630d02dag947e01b939ff2e09@mail.gmail.com> Hi, i got this error during build: make[2]: Entering directory `/home/panter/ovirt/node' { test ! -d "ovirt-node-1.0.3" || { find "ovirt-node-1.0.3" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr "ovirt-node-1.0.3"; }; } test -d "ovirt-node-1.0.3" || mkdir "ovirt-node-1.0.3" (cd gptsync && make top_distdir=../ovirt-node-1.0.3 distdir=../ovirt-node-1.0.3/gptsync \ am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir) make[3]: Entering directory `/home/panter/ovirt/node/gptsync' make[3]: Leaving directory `/home/panter/ovirt/node/gptsync' test -n "" \ || find "ovirt-node-1.0.3" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec /bin/sh /home/panter/ovirt/node/install-sh -c -m a+r {} {} \; \ || chmod -R a+r "ovirt-node-1.0.3" tardir=ovirt-node-1.0.3 && tar --format=posix -chf - "$tardir" | GZIP=--best gzip -c >ovirt-node-1.0.3.tar.gz { test ! -d "ovirt-node-1.0.3" || { find "ovirt-node-1.0.3" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr "ovirt-node-1.0.3"; }; } rpmbuild --define "ovirt_cache_dir /home/panter/ovirt-cache" --define "extra_release .$(date --utc +%Y%m%d%H%M%S)git$(git log -1 --pretty=format:%h)" -ta ovirt-node-1.0.3.tar.gz sed: can't read /usr/share/selinux/devel/policyhelp: No such file or directory error: Failed build dependencies: python-devel is needed by ovirt-node-1.0.3-0.fc11.20100312165619gitedf012a.src python-setuptools is needed by ovirt-node-1.0.3-0.fc11.20100312165619gitedf012a.src make[2]: *** [rpms] Error 1 make[2]: Leaving directory `/home/panter/ovirt/node' make[1]: *** [publish] Error 1 make[1]: Leaving directory `/home/panter/ovirt' I suggest add python-devel and python-setuptools to ovirt-build dependencies. panter From mburns at redhat.com Fri Mar 12 17:51:32 2010 From: mburns at redhat.com (Mike Burns) Date: Fri, 12 Mar 2010 12:51:32 -0500 Subject: [Ovirt-devel] [PATCH release] Include python-devel and python-setuptools to ovirt-build dependencies Message-ID: <1268416292-16429-1-git-send-email-mburns@redhat.com> Signed-off-by: Mike Burns --- ovirt-release.spec.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/ovirt-release.spec.in b/ovirt-release.spec.in index bac76b0..225ef1f 100644 --- a/ovirt-release.spec.in +++ b/ovirt-release.spec.in @@ -33,6 +33,7 @@ Requires: wget Requires: publican-ovirt Requires: python-virtinst >= 0.400 Requires: hal-devel selinux-policy-devel hardlink +Requires: python python-devel python-setuptools %description -n ovirt-build Developer makefile and scripts to help automate the building of -- 1.6.6.1 From dpierce at redhat.com Fri Mar 12 18:34:44 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 12 Mar 2010 13:34:44 -0500 Subject: [Ovirt-devel] [PATCH release] Include python-devel and python-setuptools to ovirt-build dependencies In-Reply-To: <1268416292-16429-1-git-send-email-mburns@redhat.com> References: <1268416292-16429-1-git-send-email-mburns@redhat.com> Message-ID: <20100312183444.GL5735@mcpierce-desktop.usersys.redhat.com> On Fri, Mar 12, 2010 at 12:51:32PM -0500, Mike Burns wrote: > > Signed-off-by: Mike Burns > --- > ovirt-release.spec.in | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/ovirt-release.spec.in b/ovirt-release.spec.in > index bac76b0..225ef1f 100644 > --- a/ovirt-release.spec.in > +++ b/ovirt-release.spec.in > @@ -33,6 +33,7 @@ Requires: wget > Requires: publican-ovirt > Requires: python-virtinst >= 0.400 > Requires: hal-devel selinux-policy-devel hardlink > +Requires: python python-devel python-setuptools > > %description -n ovirt-build > Developer makefile and scripts to help automate the building of > -- > 1.6.6.1 ACK and pushed. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Fri Mar 12 18:35:25 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 12 Mar 2010 13:35:25 -0500 Subject: [Ovirt-devel] missing dependencies in ovirt-build In-Reply-To: <6524aa501003120927n630d02dag947e01b939ff2e09@mail.gmail.com> References: <6524aa501003120927n630d02dag947e01b939ff2e09@mail.gmail.com> Message-ID: <20100312183525.GM5735@mcpierce-desktop.usersys.redhat.com> On Fri, Mar 12, 2010 at 06:27:56PM +0100, Jan Mrozek wrote: > Hi, > > i got this error during build: > > > make[2]: Entering directory `/home/panter/ovirt/node' > { test ! -d "ovirt-node-1.0.3" || { find "ovirt-node-1.0.3" -type d ! > -perm -200 -exec chmod u+w {} ';' && rm -fr "ovirt-node-1.0.3"; }; } > test -d "ovirt-node-1.0.3" || mkdir "ovirt-node-1.0.3" > (cd gptsync && make top_distdir=../ovirt-node-1.0.3 > distdir=../ovirt-node-1.0.3/gptsync \ > am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir) > make[3]: Entering directory `/home/panter/ovirt/node/gptsync' > make[3]: Leaving directory `/home/panter/ovirt/node/gptsync' > test -n "" \ > || find "ovirt-node-1.0.3" -type d ! -perm -755 \ > -exec chmod u+rwx,go+rx {} \; -o \ > ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ > ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ > ! -type d ! -perm -444 -exec /bin/sh > /home/panter/ovirt/node/install-sh -c -m a+r {} {} \; \ > || chmod -R a+r "ovirt-node-1.0.3" > tardir=ovirt-node-1.0.3 && tar --format=posix -chf - "$tardir" | > GZIP=--best gzip -c >ovirt-node-1.0.3.tar.gz > { test ! -d "ovirt-node-1.0.3" || { find "ovirt-node-1.0.3" -type d ! > -perm -200 -exec chmod u+w {} ';' && rm -fr "ovirt-node-1.0.3"; }; } > rpmbuild --define "ovirt_cache_dir /home/panter/ovirt-cache" --define > "extra_release .$(date --utc +%Y%m%d%H%M%S)git$(git log -1 > --pretty=format:%h)" -ta ovirt-node-1.0.3.tar.gz > sed: can't read /usr/share/selinux/devel/policyhelp: No such file or directory > error: Failed build dependencies: > python-devel is needed by ovirt-node-1.0.3-0.fc11.20100312165619gitedf012a.src > python-setuptools is needed by > ovirt-node-1.0.3-0.fc11.20100312165619gitedf012a.src > make[2]: *** [rpms] Error 1 > make[2]: Leaving directory `/home/panter/ovirt/node' > make[1]: *** [publish] Error 1 > make[1]: Leaving directory `/home/panter/ovirt' > > > I suggest add python-devel and python-setuptools to ovirt-build dependencies. > > panter > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel There's an updated ovirt-release RPM pushed out that includes this set of dependencies. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Fri Mar 12 18:40:38 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 12 Mar 2010 13:40:38 -0500 Subject: [Ovirt-devel] Proposed messaging interface for the managed node... Message-ID: <20100312184038.GN5735@mcpierce-desktop.usersys.redhat.com> I've been pulling together some ideas for extending the messaging interface for the managed node. I've put together the ideas I've had initially on the following wiki page: http://www.ovirt.org/page/MessagingInterface Questions? Comments? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Mon Mar 15 20:17:37 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 15 Mar 2010 16:17:37 -0400 Subject: [Ovirt-devel] [PATCH] Updated the list of ignored files and fixed whitespace issues. Message-ID: <1268684257-9858-1-git-send-email-dpierce@redhat.com> This patch changes no functionality. It merely adds items to the ignore file, cleans up the formatting for source files and updates the prologs for files to include the name of the file being licensed. Signed-off-by: Darryl L. Pierce --- .gitignore | 12 +++++++++++ AUTHORS | 3 +- ChangeLog | 1 - INSTALL | 1 - Makefile.am | 2 +- matahari.init.in | 5 +-- matahari.spec | 5 +-- src/cpu.cpp | 35 ++++++++++++++++----------------- src/cpu.h | 22 ++++++++++---------- src/hal.cpp | 13 ++++------- src/hal.h | 2 +- src/host.cpp | 56 +++++++++++++++++++++++++++--------------------------- src/host.h | 7 ++--- src/main.cpp | 6 ++-- src/nic.cpp | 54 ++++++++++++++++++++++++++-------------------------- src/nic.h | 27 ++++++++++++------------- 16 files changed, 127 insertions(+), 124 deletions(-) diff --git a/.gitignore b/.gitignore index 30d6b42..ad6d70b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,17 @@ aclocal.m4 autom4te.cache config.h config.h.in +config.log +config.status configure depcomp +.deps +install-sh +missing +stamp-h1 +*.o +*.patch +*~ + +src/matahari +src/qmf diff --git a/AUTHORS b/AUTHORS index 2fac0a7..834b11a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,6 +1,7 @@ Current Maintainer: -Arjun Roy +Arjun Roy +Darryl L. Pierce Contributors: diff --git a/ChangeLog b/ChangeLog index 28d63da..0d3f3e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,4 +20,3 @@ v 0.0.1 Initial version using autotools. Tracks Node, CPU and NIC info. Provides method to physically identify NIC. - diff --git a/INSTALL b/INSTALL index 8b82ade..c9fd2c0 100644 --- a/INSTALL +++ b/INSTALL @@ -288,4 +288,3 @@ operates. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. - diff --git a/Makefile.am b/Makefile.am index 449ac9c..defbd32 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,7 +28,7 @@ matahari.init: matahari.init.in chmod a+x $@-t mv $@-t $@ -EXTRA_DIST = autogen.sh \ +EXTRA_DIST = autogen.sh \ matahari.init.in \ matahari.sysconf diff --git a/matahari.init.in b/matahari.init.in index ceb8c68..1f6be49 100644 --- a/matahari.init.in +++ b/matahari.init.in @@ -63,14 +63,13 @@ case "$1" in ;; force-reload) reload - ;; + ;; condrestart|try-restart) [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" - exit 1 + exit 1 ;; esac exit $RETVAL - diff --git a/matahari.spec b/matahari.spec index 9ccdc18..b1e00bc 100644 --- a/matahari.spec +++ b/matahari.spec @@ -28,10 +28,10 @@ BuildRequires: pcre-devel >= 7.8 matahari provides a QMF Agent that can be used to control and manage various pieces of functionality for an ovirt node, using the AMQP protocol. -The Advanced Message Queuing Protocol (AMQP) is an open standard application +The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol providing reliable transport of messages. -QMF provides a modeling framework layer on top of qpid (which implements +QMF provides a modeling framework layer on top of qpid (which implements AMQP). This interface allows you to manage a host and its various components as a set of objects with properties and methods. @@ -115,4 +115,3 @@ test "x%{buildroot}" != "x" && rm -rf %{buildroot} * Tue Jun 23 2009 Arjun Roy - 0.0.1-1 - Initial rpmspec packaging - diff --git a/src/cpu.cpp b/src/cpu.cpp index 30348b4..453c571 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Red Hat, Inc. +/* cpu.cpp - Copyright (C) 2009 Red Hat, Inc. * Written by Arjun Roy * * This program is free software; you can redistribute it and/or modify @@ -39,9 +39,9 @@ template targetType convert(const std::string& str) if (!(i >> t)) throw invalid_argument("Conversion failure for " + str); return t; -} +} -ostream& operator<<(ostream& output, const CPUWrapper& cpu) +ostream& operator<<(ostream& output, const CPUWrapper& cpu) { output << "Processor" << endl; output << "CPU #: " << cpu.cpunum << endl; @@ -61,7 +61,7 @@ void CPUWrapper::setupQMFObject(ManagementAgent *agent, Manageable *parent) { mgmt_object = new _qmf::CPU(agent, this, parent); agent->addObject(mgmt_object); - syncQMFObject(); + syncQMFObject(); } void CPUWrapper::cleanupQMFObject(void) @@ -85,7 +85,7 @@ void CPUWrapper::syncQMFObject(void) /** * void fillCPUInfo(vector &cpus, ManagementAgent *agent) - * + * * Takes in a vector of CPUWrapper object pointers and populates it with * CPUs found by querying /proc/cpuinfo. NOTE: This method is very sensitive * to the output format of /proc/cpuinfo. @@ -149,7 +149,7 @@ void CPUWrapper::fillCPUInfo(vector &cpus, ManagementAgent *agent) string flags = "unknown"; // Get the cpu # from this line - cpunum = convert(line.substr(results[4], + cpunum = convert(line.substr(results[4], results[5] - results[4])); // And now grab the rest do { @@ -162,13 +162,13 @@ void CPUWrapper::fillCPUInfo(vector &cpus, ManagementAgent *agent) PCRE_NOTEMPTY, // options bitvector results, // Results vector matchArraySize // Vector size - ); + ); if (match == desiredmatches) { - string key = line.substr(results[2], + string key = line.substr(results[2], results[3] - results[2]); - string value = line.substr(results[4], + string value = line.substr(results[4], results[5] - results[4]); if (key == "core id") { @@ -191,11 +191,11 @@ void CPUWrapper::fillCPUInfo(vector &cpus, ManagementAgent *agent) } else if (key == "flags") { flags = value; } - } - } - while (line != ""); + } + } + while (line != ""); - // Got all the data. Add the CPU to our list + // Got all the data. Add the CPU to our list CPUWrapper *cpu = new CPUWrapper(cpunum, coreid, cpucores, @@ -206,12 +206,11 @@ void CPUWrapper::fillCPUInfo(vector &cpus, ManagementAgent *agent) cache, vendor, flags); - cpus.push_back(cpu); - } + cpus.push_back(cpu); + } } - else + else continue; } - cpuinfo.close(); + cpuinfo.close(); } - diff --git a/src/cpu.h b/src/cpu.h index e557314..bb3a9b3 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Red Hat, Inc. +/* cpu.h - Copyright (C) 2009 Red Hat, Inc. * Written by Arjun Roy * * This program is free software; you can redistribute it and/or modify @@ -62,15 +62,15 @@ class CPUWrapper : public Manageable ~CPUWrapper() {} CPUWrapper(int cpunum__, - int corenum__, - int numcores__, - int model__, - int family__, - int cpuid_lvl__, - double speed__, - int cache__, - const string &vendor__, - const string &flags__) { + int corenum__, + int numcores__, + int model__, + int family__, + int cpuid_lvl__, + double speed__, + int cache__, + const string &vendor__, + const string &flags__) { cpunum = cpunum__; corenum = corenum__; numcores = numcores__; @@ -82,7 +82,7 @@ class CPUWrapper : public Manageable vendor = vendor__; flags = flags__; } - + public: // Factory like method diff --git a/src/hal.cpp b/src/hal.cpp index 71fcab8..66c1464 100644 --- a/src/hal.cpp +++ b/src/hal.cpp @@ -1,8 +1,5 @@ -/* hal_support.c -- Interfaces with the HAL libraries. - * - * Copyright (C) 2008 Red Hat, Inc. +/* hal_support.c - Copyright (C) 2008 Red Hat, Inc. * Written by Darryl L. Pierce - * Modified by Arjun Roy * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,7 +45,7 @@ get_hal_ctx(void) fprintf(stderr, "Failed to initial libhal context: %s : %s\n", dbus_error.name, dbus_error.message); - } + } } else { fprintf(stderr, "Unable to connect to system bus: %s : %s\n", dbus_error.name, dbus_error.message); @@ -75,9 +72,9 @@ char* get_uuid(LibHalContext *hal_ctx) int type = libhal_device_get_property_type(hal_ctx, udi, key, &dbus_error); if (type == LIBHAL_PROPERTY_TYPE_STRING) { - value = libhal_device_get_property_string(hal_ctx, - udi, - key, + value = libhal_device_get_property_string(hal_ctx, + udi, + key, &dbus_error); } if (!value) diff --git a/src/hal.h b/src/hal.h index 00390e9..03dd909 100644 --- a/src/hal.h +++ b/src/hal.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Red Hat, Inc. +/* hal.h - Copyright (C) 2009 Red Hat, Inc. * Written by Arjun Roy * * This program is free software; you can redistribute it and/or modify diff --git a/src/host.cpp b/src/host.cpp index a9197e3..0d22211 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Red Hat, Inc. +/* host.cpp - Copyright (C) 2009 Red Hat, Inc. * Written by Arjun Roy * * This program is free software; you can redistribute it and/or modify @@ -49,17 +49,17 @@ ostream& operator<<(ostream &output, const HostWrapper& host) vector cpus = host.cpus; vector nics = host.nics; - for (vector::iterator iter = cpus.begin(); - iter!= cpus.end(); - iter++) { + for (vector::iterator iter = cpus.begin(); + iter!= cpus.end(); + iter++) { output << **iter << endl; } - for (vector::iterator iter = nics.begin(); - iter!= nics.end(); - iter++) { + for (vector::iterator iter = nics.begin(); + iter!= nics.end(); + iter++) { output << **iter << endl; } - + output << "End Node" << endl; return output; } @@ -79,15 +79,15 @@ void HostWrapper::setupQMFObjects(ManagementAgent *agent) syncQMFHostObject(); // Iterate over list and set up CPU objects - for (vector::iterator iter = cpus.begin(); - iter!= cpus.end(); - iter++) { + for (vector::iterator iter = cpus.begin(); + iter!= cpus.end(); + iter++) { (*iter)->setupQMFObject(agent, this); } // Iterate over list and set up NIC objects - for (vector::iterator iter = nics.begin(); - iter!= nics.end(); - iter++) { + for (vector::iterator iter = nics.begin(); + iter!= nics.end(); + iter++) { (*iter)->setupQMFObject(agent, this); } } @@ -108,15 +108,15 @@ void HostWrapper::cleanupQMFObjects(void) mgmt_object->resourceDestroy(); // Iterate over list and clean up CPU objects - for (vector::iterator iter = cpus.begin(); - iter!= cpus.end(); - iter++) { + for (vector::iterator iter = cpus.begin(); + iter!= cpus.end(); + iter++) { (*iter)->cleanupQMFObject(); } // Iterate over list and clean up NIC objects - for (vector::iterator iter = nics.begin(); - iter!= nics.end(); - iter++) { + for (vector::iterator iter = nics.begin(); + iter!= nics.end(); + iter++) { (*iter)->cleanupQMFObject(); } } @@ -142,7 +142,7 @@ void HostWrapper::disposeHostWrapper() hostSingleton->cleanupQMFObjects(); hostSingleton->cleanupMemberObjects(); - + delete hostSingleton; hostSingleton = NULL; } @@ -197,7 +197,7 @@ HostWrapper* HostWrapper::setupHostWrapper(ManagementAgent *agent) host->memory = info.memory; } } - virConnectClose(connection); + virConnectClose(connection); host->beeping = false; } @@ -228,16 +228,16 @@ void HostWrapper::shutdown() system("shutdown -h now"); } -Manageable::status_t -HostWrapper::ManagementMethod(uint32_t methodId, Args& args, string& text) +Manageable::status_t +HostWrapper::ManagementMethod(uint32_t methodId, Args& args, string& text) { switch(methodId) { case _qmf::Host::METHOD_SHUTDOWN: - shutdown(); - return Manageable::STATUS_OK; + shutdown(); + return Manageable::STATUS_OK; case _qmf::Host::METHOD_REBOOT: - reboot(); - return Manageable::STATUS_OK; + reboot(); + return Manageable::STATUS_OK; } return Manageable::STATUS_NOT_IMPLEMENTED; } diff --git a/src/host.h b/src/host.h index c69a4f3..06bdbf0 100644 --- a/src/host.h +++ b/src/host.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Red Hat, Inc. +/* host.h - Copyright (C) 2009 Red Hat, Inc. * Written by Arjun Roy * * This program is free software; you can redistribute it and/or modify @@ -36,7 +36,7 @@ class HostWrapper : public Manageable static HostWrapper *hostSingleton; friend ostream& operator<<(ostream &output, const HostWrapper& host); - + // Host Parameters string uuid; string hostname; @@ -78,7 +78,7 @@ class HostWrapper : public Manageable // QMF Methods ManagementObject* GetManagementObject(void) const { return mgmt_object; } status_t ManagementMethod(uint32_t methodId, Args& args, string& text); - + // Field Accessors const string &getUUID(void) { return uuid; } const string &getHostname(void) { return hostname; } @@ -93,4 +93,3 @@ class HostWrapper : public Manageable // Main Loop void doLoop(void); }; - diff --git a/src/main.cpp b/src/main.cpp index d51c4d9..002a02e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Red Hat, Inc. +/* main.cpp - Copyright (C) 2009 Red Hat, Inc. * Written by Arjun Roy * * This program is free software; you can redistribute it and/or modify @@ -190,7 +190,7 @@ int do_main(int argc, char **argv) } catch (...) { cleanup(); - throw; + throw; } // Main loop @@ -205,7 +205,7 @@ int main(int argc, char** argv) { try { return do_main(argc, argv); - } + } catch(std::exception& e) { cout << "Top Level Exception: " << e.what() << endl; } diff --git a/src/nic.cpp b/src/nic.cpp index ae90151..197f5c7 100644 --- a/src/nic.cpp +++ b/src/nic.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Red Hat, Inc. +/* nic.cpp - Copyright (C) 2009 Red Hat, Inc. * Written by Arjun Roy * * This program is free software; you can redistribute it and/or modify @@ -83,9 +83,9 @@ void NICWrapper::syncQMFObject(void) mgmt_object->set_bandwidth(bandwidth); } -NICWrapper *NICWrapper::getNIC(ManagementAgent *agent, - LibHalContext *hal_ctx, - char *nic_handle) +NICWrapper *NICWrapper::getNIC(ManagementAgent *agent, + LibHalContext *hal_ctx, + char *nic_handle) { // Used to get the data char *macaddr_c; @@ -102,12 +102,12 @@ NICWrapper *NICWrapper::getNIC(ManagementAgent *agent, string netmask; string broadcast; int bandwidth; - + // Grab the MAC Address from libhal macaddr_c = libhal_device_get_property_string(hal_ctx, - nic_handle, - "net.address", - &dbus_error); + nic_handle, + "net.address", + &dbus_error); // Or throw an exception if we could not find it. No cleanup yet. if (!macaddr_c) throw runtime_error("Could not get mac address for NIC"); @@ -143,7 +143,7 @@ NICWrapper *NICWrapper::getNIC(ManagementAgent *agent, } // Get the netmask ret = ioctl(sock, SIOCGIFNETMASK, &ifr); - if(ret == 0 && strcmp("255.255.255.255", + if(ret == 0 && strcmp("255.255.255.255", inet_ntoa(((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr))) { struct sockaddr_in *addr = (struct sockaddr_in *) &ifr.ifr_addr; @@ -205,11 +205,11 @@ NICWrapper *NICWrapper::getNIC(ManagementAgent *agent, macaddr = macaddr_c; interface = interface_c; nic = new NICWrapper(interface, - macaddr, - ipaddr, - netmask, - broadcast, - bandwidth); + macaddr, + ipaddr, + netmask, + broadcast, + bandwidth); // Free resources and return libhal_free_string(interface_c); @@ -218,23 +218,23 @@ NICWrapper *NICWrapper::getNIC(ManagementAgent *agent, } /** - * void fillNICInfo(vector &nics, - * ManagementAgent *agent, + * void fillNICInfo(vector &nics, + * ManagementAgent *agent, * LibHalContext *hal_ctx) * * Takes in a vector of NICWrapper object pointers and populates it with * NICs found in the system found by querying dbus and making other system * calls. */ -void NICWrapper::fillNICInfo(vector &nics, - ManagementAgent *agent, - LibHalContext *hal_ctx) +void NICWrapper::fillNICInfo(vector &nics, + ManagementAgent *agent, + LibHalContext *hal_ctx) { char **net_devices; int num_results, i; - net_devices = libhal_find_device_by_capability(hal_ctx, + net_devices = libhal_find_device_by_capability(hal_ctx, "net.80203", - &num_results, + &num_results, &dbus_error); if (!net_devices) throw runtime_error("Error: Couldn't get NIC devices through libhal."); @@ -277,20 +277,20 @@ int NICWrapper::identifyNIC(int seconds) close(sock); if (ret != 0) - ret = errno; + ret = errno; return ret; } -Manageable::status_t +Manageable::status_t NICWrapper::ManagementMethod(uint32_t methodId, Args& args, string& text) { switch (methodId) { case _qmf::NIC::METHOD_IDENTIFY_NIC: - _qmf::ArgsNICIdentify_nic& ioArgs = (_qmf::ArgsNICIdentify_nic&) args; - int seconds = ioArgs.i_seconds; - ioArgs.o_ret = identifyNIC(seconds); - return STATUS_OK; + _qmf::ArgsNICIdentify_nic& ioArgs = (_qmf::ArgsNICIdentify_nic&) args; + int seconds = ioArgs.i_seconds; + ioArgs.o_ret = identifyNIC(seconds); + return STATUS_OK; } return STATUS_NOT_IMPLEMENTED; diff --git a/src/nic.h b/src/nic.h index ee14072..15f31fb 100644 --- a/src/nic.h +++ b/src/nic.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Red Hat, Inc. +/* nic.h - Copyright (C) 2009 Red Hat, Inc. * Written by Arjun Roy * * This program is free software; you can redistribute it and/or modify @@ -57,11 +57,11 @@ class NICWrapper : public Manageable ~NICWrapper() {} NICWrapper(const string &interfaceName__, - const string &macaddr__, - const string &ipaddr__, - const string &netmask__, - const string &broadcast__, - int bandwidth__) { + const string &macaddr__, + const string &ipaddr__, + const string &netmask__, + const string &broadcast__, + int bandwidth__) { interfaceName = interfaceName__; macaddr = macaddr__; ipaddr = ipaddr__; @@ -69,18 +69,18 @@ class NICWrapper : public Manageable broadcast = broadcast__; bandwidth = bandwidth__; } - - static NICWrapper *getNIC(ManagementAgent *agent, - LibHalContext *hal_ctx, - char *nic_handle); + + static NICWrapper *getNIC(ManagementAgent *agent, + LibHalContext *hal_ctx, + char *nic_handle); int identifyNIC(int seconds); public: // Factory like method - static void fillNICInfo(vector &nics, - ManagementAgent *agent, - LibHalContext *ctx); + static void fillNICInfo(vector &nics, + ManagementAgent *agent, + LibHalContext *ctx); // QMF Methods ManagementObject *GetManagementObject(void) const { return mgmt_object; } @@ -94,4 +94,3 @@ public: const string &getBroadcast(void) { return broadcast; } int getBandwidth(void) { return bandwidth; } }; - -- 1.6.6.1 From jboggs at redhat.com Mon Mar 15 20:19:50 2010 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 15 Mar 2010 16:19:50 -0400 Subject: [Ovirt-devel] [PATCH node] fix reboot hang on /etc Message-ID: <1268684390-16507-1-git-send-email-jboggs@redhat.com> --- recipe/common-pkgs.ks | 1 + recipe/common-post.ks | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/recipe/common-pkgs.ks b/recipe/common-pkgs.ks index 3aafe53..bc96b43 100644 --- a/recipe/common-pkgs.ks +++ b/recipe/common-pkgs.ks @@ -76,3 +76,4 @@ acpid device-mapper-multipath kpartx dracut-network +patch diff --git a/recipe/common-post.ks b/recipe/common-post.ks index 0f09581..f33984c 100644 --- a/recipe/common-post.ks +++ b/recipe/common-post.ks @@ -166,3 +166,18 @@ empty /mnt empty /live empty /boot EOF + +# prevent node from hanging on reboot due to /etc mounts +patch -d /etc/init.d/ -p0 <<\EOF +--- halt.orig 2010-03-15 16:01:13.677585448 -0400 ++++ halt 2010-03-15 16:01:39.798581069 -0400 +@@ -138,7 +138,7 @@ __umount_loop '$3 ~ /^rpc_pipefs$/ || $3 + $"Unmounting pipe file systems (retry): " \ + -f + +-LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/dev/{next} ++LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/etc|^\/dev/{next} + $3 == "tmpfs" || $3 == "proc" {print $2 ; next} + /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next} + {print $2}' /proc/mounts \ +EOF -- 1.6.6.1 From aclement at linagora.com Tue Mar 16 11:10:46 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 16 Mar 2010 12:10:46 +0100 Subject: [Ovirt-devel] [PATCH] Changes the order of ovirt-early and ovirt-awake. In-Reply-To: <1268315704-23136-1-git-send-email-dpierce@redhat.com> References: <1268315704-23136-1-git-send-email-dpierce@redhat.com> Message-ID: <201003161210.46968.aclement@linagora.com> It's working. On Jeudi 11 Mars 2010 14:55:04 Darryl L. Pierce wrote: > Now the execution order for the ovirt sysvinit scripts is: > > ovirt-early -> ovirt-awake -> ovirt -> ovirt-post > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt | 2 +- > scripts/ovirt-awake | 1 + > scripts/ovirt-early | 1 - > 3 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/ovirt b/scripts/ovirt > index 752564a..d2e338d 100755 > --- a/scripts/ovirt > +++ b/scripts/ovirt > @@ -4,7 +4,7 @@ > # > ### BEGIN INIT INFO > # Provides: ovirt > -# Required-Start: ovirt-early > +# Required-Start: ovirt-awake > # Default-Start: 2 3 4 5 > # Description: Performs managed node configuration functions. > ### END INIT INFO > diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake > index bd50ffd..e4d5a28 100755 > --- a/scripts/ovirt-awake > +++ b/scripts/ovirt-awake > @@ -22,6 +22,7 @@ > # > ### BEGIN INIT INFO > # Provides: ovirt-awake > +# Required-Start: ovirt-early > # Default-Start: 2 3 4 5 > # Description: Managed node service to alert management servers. > ### END INIT INFO > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 1ab0578..d561dc8 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -4,7 +4,6 @@ > # > ### BEGIN INIT INFO > # Provides: ovirt-early > -# Required-Start: ovirt-awake > # Default-Start: 2 3 4 5 > # Dewscription: Managed node early configuration service > ### END INIT INFO -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Tue Mar 16 12:05:58 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 16 Mar 2010 08:05:58 -0400 Subject: [Ovirt-devel] [PATCH] Changes the order of ovirt-early and ovirt-awake. In-Reply-To: <201003161210.46968.aclement@linagora.com> References: <1268315704-23136-1-git-send-email-dpierce@redhat.com> <201003161210.46968.aclement@linagora.com> Message-ID: <20100316120558.GD7544@mcpierce-desktop.usersys.redhat.com> On Tue, Mar 16, 2010 at 12:10:46PM +0100, Arthur CLEMENT wrote: > It's working. Awesome. I'll push it today. :) -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From aclement at linagora.com Tue Mar 16 16:46:12 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 16 Mar 2010 17:46:12 +0100 Subject: [Ovirt-devel] [PATCH] ovirt-awake improvements Message-ID: <7f05065855cb273e37a12df27d208901.squirrel@intranet.linagora.com> >From 1ca6e713d0c23279a6800e6dfb4a76ab4250f56f Mon Sep 17 00:00:00 2001 From: Arthur CLEMENT Date: Tue, 16 Mar 2010 16:36:50 +0000 Subject: [PATCH] Function typo fixed. Move the sourcing of NODE_CONFIG forward to not override the $OVIRT_RUNTIME_MODE read from karg Signed-off-by: Arthur CLEMENT --- scripts/ovirt-awake | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index d5865c5..5126a54 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -22,6 +22,7 @@ # ### BEGIN INIT INFO # Provides: ovirt-awake +# Required-Start: ovirt-early # Default-Start: 2 3 4 5 # Description: Managed node service to alert management servers. ### END INIT INFO @@ -30,7 +31,6 @@ # config: /etc/sysconfig/node-config . /etc/init.d/functions -. /usr/libexec/ovirt-functions prog=ovirt-awake NODE_CONFIG=/etc/sysconfig/node-config @@ -39,6 +39,8 @@ VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config # load the configuration file [ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" +. /usr/libexec/ovirt-functions + send_text () { local text=${1} @@ -113,6 +115,7 @@ start_ovirt_awake () { log "Node is operating in unmanaged mode." ;; "ovirt") + log "Node is operating in ovirt mode." ovirt_startup RC=$? ;; @@ -146,7 +149,7 @@ case "$1" in echo -n "Starting ovirt-awake: " [ -f "$VAR_SUBSYS_NODECONFIG" ] && exit 0 { - start + start_ovirt_awake RETVAL=$? log "Completed ovirt-awake: RETVAL=$?" } >> $OVIRT_LOGFILE 2>&1 -- 1.6.6.1 From dpierce at redhat.com Tue Mar 16 16:56:16 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 16 Mar 2010 12:56:16 -0400 Subject: [Ovirt-devel] [PATCH] ovirt-awake improvements In-Reply-To: <7f05065855cb273e37a12df27d208901.squirrel@intranet.linagora.com> References: <7f05065855cb273e37a12df27d208901.squirrel@intranet.linagora.com> Message-ID: <20100316165616.GG7544@mcpierce-desktop.usersys.redhat.com> On Tue, Mar 16, 2010 at 05:46:12PM +0100, Arthur CLEMENT wrote: > >From 1ca6e713d0c23279a6800e6dfb4a76ab4250f56f Mon Sep 17 00:00:00 2001 > From: Arthur CLEMENT > Date: Tue, 16 Mar 2010 16:36:50 +0000 > Subject: [PATCH] Function typo fixed. Move the sourcing of NODE_CONFIG > forward to not override the $OVIRT_RUNTIME_MODE read from karg > > Signed-off-by: Arthur CLEMENT > --- > scripts/ovirt-awake | 7 +++++-- > 1 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake > index d5865c5..5126a54 100755 > --- a/scripts/ovirt-awake > +++ b/scripts/ovirt-awake > @@ -22,6 +22,7 @@ > # > ### BEGIN INIT INFO > # Provides: ovirt-awake > +# Required-Start: ovirt-early This is already provided by a different patch and will cause a collision. > # Default-Start: 2 3 4 5 > # Description: Managed node service to alert management servers. > ### END INIT INFO > @@ -30,7 +31,6 @@ > # config: /etc/sysconfig/node-config > > . /etc/init.d/functions > -. /usr/libexec/ovirt-functions > > prog=ovirt-awake > NODE_CONFIG=/etc/sysconfig/node-config > @@ -39,6 +39,8 @@ VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config > # load the configuration file > [ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" > > +. /usr/libexec/ovirt-functions > + > send_text () { > local text=${1} > > @@ -113,6 +115,7 @@ start_ovirt_awake () { > log "Node is operating in unmanaged mode." > ;; > "ovirt") > + log "Node is operating in ovirt mode." > ovirt_startup > RC=$? > ;; > @@ -146,7 +149,7 @@ case "$1" in > echo -n "Starting ovirt-awake: " > [ -f "$VAR_SUBSYS_NODECONFIG" ] && exit 0 > { > - start > + start_ovirt_awake > RETVAL=$? > log "Completed ovirt-awake: RETVAL=$?" > } >> $OVIRT_LOGFILE 2>&1 > -- > 1.6.6.1 > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel Other than the one comment, ACK. I'll modify it and push the patch out today along with the previous related patch. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Tue Mar 16 17:09:54 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 16 Mar 2010 13:09:54 -0400 Subject: [Ovirt-devel] [PATCH] ovirt-awake improvements In-Reply-To: <20100316165616.GG7544@mcpierce-desktop.usersys.redhat.com> References: <7f05065855cb273e37a12df27d208901.squirrel@intranet.linagora.com> <20100316165616.GG7544@mcpierce-desktop.usersys.redhat.com> Message-ID: <20100316170954.GH7544@mcpierce-desktop.usersys.redhat.com> On Tue, Mar 16, 2010 at 12:56:16PM -0400, Darryl L. Pierce wrote: > Other than the one comment, ACK. I'll modify it and push the patch out > today along with the previous related patch. Both patches are now pushed upstream. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From aclement at linagora.com Tue Mar 16 17:46:21 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 16 Mar 2010 18:46:21 +0100 Subject: [Ovirt-devel] [PATCH] ovirt-awake improvements In-Reply-To: <20100316170954.GH7544@mcpierce-desktop.usersys.redhat.com> References: <7f05065855cb273e37a12df27d208901.squirrel@intranet.linagora.com> <20100316165616.GG7544@mcpierce-desktop.usersys.redhat.com> <20100316170954.GH7544@mcpierce-desktop.usersys.redhat.com> Message-ID: <201003161846.21386.aclement@linagora.com> Thanks ! Sorry for the duplicate, I didn't commit your previous patch before mine. On mardi 16 mars 2010 18:09:54 Darryl L. Pierce wrote: > On Tue, Mar 16, 2010 at 12:56:16PM -0400, Darryl L. Pierce wrote: > > Other than the one comment, ACK. I'll modify it and push the patch out > > today along with the previous related patch. > > Both patches are now pushed upstream. > From dpierce at redhat.com Tue Mar 16 19:35:34 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 16 Mar 2010 15:35:34 -0400 Subject: [Ovirt-devel] [PATCH] Added the new Processors agent. Message-ID: <1268768134-27553-1-git-send-email-dpierce@redhat.com> The Processors agent reports details regarding the processing power for the managed node. Defined the agent within schema.xml. Wrote the wrapper code to create and populate an instance of the agent. The properties for the Processors agent have also been trimmed back to what is readily available via HAL. Signed-off-by: Darryl L. Pierce --- src/Makefile.am | 26 +++++++++------- src/host.cpp | 2 + src/host.h | 3 ++ src/processors.cpp | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/processors.h | 48 +++++++++++++++++++++++++++++ src/schema.xml | 11 +++++++ 6 files changed, 165 insertions(+), 11 deletions(-) create mode 100644 src/processors.cpp create mode 100644 src/processors.h diff --git a/src/Makefile.am b/src/Makefile.am index 8c94fba..ee30443 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,14 +5,16 @@ sbin_PROGRAMS = matahari first = qmf/com/redhat/matahari/Host.cpp generated_file_list = \ - qmf/com/redhat/matahari/CPU.cpp\ - qmf/com/redhat/matahari/NIC.cpp\ - qmf/com/redhat/matahari/Package.cpp\ - qmf/com/redhat/matahari/Host.h\ - qmf/com/redhat/matahari/CPU.h\ - qmf/com/redhat/matahari/NIC.h\ - qmf/com/redhat/matahari/Package.h\ - qmf/com/redhat/matahari/ArgsNICIdentify_nic.h + qmf/com/redhat/matahari/ArgsNICIdentify_nic.h \ + qmf/com/redhat/matahari/CPU.cpp \ + qmf/com/redhat/matahari/CPU.h \ + qmf/com/redhat/matahari/Host.h \ + qmf/com/redhat/matahari/NIC.cpp \ + qmf/com/redhat/matahari/NIC.h \ + qmf/com/redhat/matahari/Package.cpp \ + qmf/com/redhat/matahari/Package.h \ + qmf/com/redhat/matahari/Processors.cpp \ + qmf/com/redhat/matahari/Processors.h nodist_matahari_SOURCES = $(generated_file_list) $(first) @@ -25,11 +27,13 @@ matahari_SOURCES = \ host.h \ main.cpp \ nic.cpp \ - nic.h + nic.h \ + processors.cpp \ + processors.h -$(generated_file_list): $(first) +$(generated_file_list): $(generated_file_list) -$(first): schema.xml +$(first): schema.xml $(generated_file_list) qmf-gen -o ./qmf ./schema.xml BUILT_SOURCES = $(generated_file_list) $(first) diff --git a/src/host.cpp b/src/host.cpp index 0d22211..c81d2f1 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -78,6 +78,8 @@ void HostWrapper::setupQMFObjects(ManagementAgent *agent) agent->addObject(mgmt_object); syncQMFHostObject(); + processors.setup(agent); + // Iterate over list and set up CPU objects for (vector::iterator iter = cpus.begin(); iter!= cpus.end(); diff --git a/src/host.h b/src/host.h index 06bdbf0..148c91f 100644 --- a/src/host.h +++ b/src/host.h @@ -25,6 +25,7 @@ #include "cpu.h" #include "nic.h" +#include "processors.h" using namespace qpid::management; using namespace std; @@ -49,6 +50,8 @@ class HostWrapper : public Manageable vector cpus; vector nics; + ProcessorsAgent processors; + // QMF related fields ManagementAgent *agent; qmf::com::redhat::matahari::Host *mgmt_object; diff --git a/src/processors.cpp b/src/processors.cpp new file mode 100644 index 0000000..d1b1f44 --- /dev/null +++ b/src/processors.cpp @@ -0,0 +1,86 @@ +/* processor.cpp - Copyright (C) 2010 Red Hat, Inc. + * Written by Darryl L. Pierce + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. A copy of the GNU General Public License is + * also available at http://www.gnu.org/copyleft/gpl.html. + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "hal.h" +#include "processors.h" + +#include "qmf/com/redhat/matahari/ArgsProcessorsGet_load_average.h" + +using namespace std; +namespace _qmf = qmf::com::redhat::matahari; + +extern DBusError dbus_error; + +void +ProcessorsAgent::setup(ManagementAgent* agent) +{ + // setup the management object + management_object = new _qmf::Processors(agent, this); + agent->addObject(management_object); + + LibHalContext* context = get_hal_ctx(); + + int num_results; + char** processors = libhal_find_device_by_capability(context,"processor", &num_results, &dbus_error); + + if (!processors) + throw runtime_error("Error: could not query processors via HAL."); + + // populate the managed object's values + management_object->set_model(libhal_device_get_property_string(context, processors[0], "info.product", &dbus_error)); + management_object->set_cores(num_results); +} + +Manageable::status_t +ProcessorsAgent::ManagementMethod(uint32_t id, Args& args, string& text) +{ + switch(id) + { + case _qmf::Processors::METHOD_GET_LOAD_AVERAGE: + _qmf::ArgsProcessorsGet_load_average& loadavg = (_qmf::ArgsProcessorsGet_load_average&) args; + loadavg.o_ret = get_load_average(); + return STATUS_OK; + } + + return STATUS_NOT_IMPLEMENTED; +} + +double +ProcessorsAgent::get_load_average(void) +{ + double result; + ifstream input; + + input.open("/proc/loadavg", ios::in); + input >> result; + input.close(); + + return result; +} diff --git a/src/processors.h b/src/processors.h new file mode 100644 index 0000000..f854f1d --- /dev/null +++ b/src/processors.h @@ -0,0 +1,48 @@ +/* processor.h - Copyright (C) 2010 Red Hat, Inc. + * Written by Darryl L. Pierce + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. A copy of the GNU General Public License is + * also available at http://www.gnu.org/copyleft/gpl.html. + */ + +#include +#include +#include +#include + +#include "qmf/com/redhat/matahari/Processors.h" + +using namespace qpid::management; +using namespace std; + +using qpid::management::Manageable; + +class ProcessorsAgent : public Manageable +{ + private: + qmf::com::redhat::matahari::Processors* management_object; + + public: + ProcessorsAgent() {} + virtual ~ProcessorsAgent() {} + + ManagementObject* GetManagementObject(void) const { return management_object; } + Manageable::status_t ManagementMethod(uint32_t id, Args& args, string& text); + + void setup(ManagementAgent* agent); + + // agent methods + double get_load_average(void); +}; diff --git a/src/schema.xml b/src/schema.xml index 5fb683f..40ab3d0 100644 --- a/src/schema.xml +++ b/src/schema.xml @@ -14,6 +14,17 @@ + + + + + + + + + + + -- 1.6.6.1 From mburns at redhat.com Wed Mar 17 17:01:44 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 13:01:44 -0400 Subject: [Ovirt-devel] [PATCH node] Make autotest.sh executable Message-ID: <1268845304-30268-1-git-send-email-mburns@redhat.com> Otherwise, errors occur when run as part of the autobuild infrastructure. Signed-off-by: Mike Burns --- 0 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 autotest.sh diff --git a/autotest.sh b/autotest.sh old mode 100644 new mode 100755 -- 1.6.6.1 From mburns at redhat.com Wed Mar 17 17:23:48 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 13:23:48 -0400 Subject: [Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage In-Reply-To: <1268337309-28388-1-git-send-email-mburns@redhat.com> References: <1268337309-28388-1-git-send-email-mburns@redhat.com> Message-ID: <1268846628.3659.4.camel@localhost.localdomain> Patch has problems is there are a large number of devices. A re-worked patch should follow shortly. Mike On Thu, 2010-03-11 at 14:55 -0500, Mike Burns wrote: > Code that scanned for dirty storage was accidentally grepping the > contents of an entire partition. This led to an apparent hang in > situations where partitions were large. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-storage | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index aea73f8..92d79dd 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -550,7 +550,7 @@ wipe_lvm_on_disk() > unmount_logging > for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE* 2>/dev/null|sort -u); do > if pvs -o pv_name,vg_name --noheadings | \ > - grep $vg | grep -v -q $dev* 2>/dev/null; then > + grep $vg | egrep -v -q "${dev}p?[0-9]*" 2>/dev/null; then > log "The volume group \"$vg\" spans multiple disks." > log "This operation cannot complete. Please manullay" > log "cleanup the storage using standard linux tools." From mburns at redhat.com Wed Mar 17 17:25:13 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 13:25:13 -0400 Subject: [Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage Message-ID: <1268846713-31638-1-git-send-email-mburns@redhat.com> Code that scanned for dirty storage was accidentally grepping the contents of an entire partition. This led to an apparent hang in situations where partitions were large. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index aea73f8..1e81db0 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -548,9 +548,13 @@ wipe_lvm_on_disk() { local dev=${1-$HOSTVGDRIVE} unmount_logging - for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE* 2>/dev/null|sort -u); do + local part_delim="p" + if [[ "$dev" =~ "/dev/sd" ]]; then + part_delim="" + fi + for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE $HOSTVGDRIVE${dev_delim}[0-9]* 2>/dev/null|sort -u); do if pvs -o pv_name,vg_name --noheadings | \ - grep $vg | grep -v -q $dev* 2>/dev/null; then + grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then log "The volume group \"$vg\" spans multiple disks." log "This operation cannot complete. Please manullay" log "cleanup the storage using standard linux tools." -- 1.6.6.1 From apevec at gmail.com Wed Mar 17 18:03:38 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 17 Mar 2010 19:03:38 +0100 Subject: [Ovirt-devel] [PATCH node] Make autotest.sh executable In-Reply-To: <1268845304-30268-1-git-send-email-mburns@redhat.com> References: <1268845304-30268-1-git-send-email-mburns@redhat.com> Message-ID: <2be7262f1003171103r2d7158dcpdcd057067040202c@mail.gmail.com> > diff --git a/autotest.sh b/autotest.sh > old mode 100644 > new mode 100755 ACK From apevec at gmail.com Wed Mar 17 18:15:32 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 17 Mar 2010 19:15:32 +0100 Subject: [Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage In-Reply-To: <1268846713-31638-1-git-send-email-mburns@redhat.com> References: <1268846713-31638-1-git-send-email-mburns@redhat.com> Message-ID: <2be7262f1003171115t22466711ie7cd399fee854421@mail.gmail.com> ACK This would cleanup HOSTVGDRIVE fine, but what if selected ROOTDRIVE is also "dirty" and has existing LVM PVs from a previous OS installation? From mburns at redhat.com Wed Mar 17 18:24:59 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 14:24:59 -0400 Subject: [Ovirt-devel] [PATCH node] Fix hang when cleaning dirty storage In-Reply-To: <2be7262f1003171115t22466711ie7cd399fee854421@mail.gmail.com> References: <1268846713-31638-1-git-send-email-mburns@redhat.com> <2be7262f1003171115t22466711ie7cd399fee854421@mail.gmail.com> Message-ID: <1268850299.3659.6.camel@localhost.localdomain> On Wed, 2010-03-17 at 19:15 +0100, Alan Pevec wrote: > ACK > This would cleanup HOSTVGDRIVE fine, but what if selected ROOTDRIVE is > also "dirty" and has existing LVM PVs from a previous OS installation? > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel True, I will push this and cut another patch that will clean up ROOTDRIVE as well. Mike From mburns at redhat.com Wed Mar 17 18:29:42 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 14:29:42 -0400 Subject: [Ovirt-devel] [PATCH node] Make autotest.sh executable In-Reply-To: <2be7262f1003171103r2d7158dcpdcd057067040202c@mail.gmail.com> References: <1268845304-30268-1-git-send-email-mburns@redhat.com> <2be7262f1003171103r2d7158dcpdcd057067040202c@mail.gmail.com> Message-ID: <1268850582.3659.7.camel@localhost.localdomain> On Wed, 2010-03-17 at 19:03 +0100, Alan Pevec wrote: > > diff --git a/autotest.sh b/autotest.sh > > old mode 100644 > > new mode 100755 > ACK > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel Pushed From mburns at redhat.com Wed Mar 17 18:37:17 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 14:37:17 -0400 Subject: [Ovirt-devel] [PATCH node] Cleanup ROOTDRIVE when partitioning Message-ID: <1268851037-2644-1-git-send-email-mburns@redhat.com> Previously, we only cleaned up the HOSTVGDRIVE. We should clean up ROOTDRIVE as well to remove any existing PV/VGs. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 1e81db0..4117b7a 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -552,7 +552,7 @@ wipe_lvm_on_disk() if [[ "$dev" =~ "/dev/sd" ]]; then part_delim="" fi - for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE $HOSTVGDRIVE${dev_delim}[0-9]* 2>/dev/null|sort -u); do + for vg in $(pvs -o vg_name --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do if pvs -o pv_name,vg_name --noheadings | \ grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then log "The volume group \"$vg\" spans multiple disks." @@ -593,7 +593,8 @@ perform_partitioning() unmount_config /etc/default/ovirt log "Removing old LVM partitions" - wipe_lvm_on_disk + wipe_lvm_on_disk $HOSTVGDRIVE + wipe_lvm_on_disk $ROOTDRIVE # begin critical section set -e -- 1.6.6.1 From apevec at gmail.com Wed Mar 17 18:58:38 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 17 Mar 2010 19:58:38 +0100 Subject: [Ovirt-devel] [PATCH node] Cleanup ROOTDRIVE when partitioning In-Reply-To: <1268851037-2644-1-git-send-email-mburns@redhat.com> References: <1268851037-2644-1-git-send-email-mburns@redhat.com> Message-ID: <2be7262f1003171158i13f15536i2ec3ce23a51c7afc@mail.gmail.com> ACK From mburns at redhat.com Wed Mar 17 19:01:10 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 15:01:10 -0400 Subject: [Ovirt-devel] [PATCH node] Cleanup ROOTDRIVE when partitioning In-Reply-To: <2be7262f1003171158i13f15536i2ec3ce23a51c7afc@mail.gmail.com> References: <1268851037-2644-1-git-send-email-mburns@redhat.com> <2be7262f1003171158i13f15536i2ec3ce23a51c7afc@mail.gmail.com> Message-ID: <1268852470.3659.8.camel@localhost.localdomain> On Wed, 2010-03-17 at 19:58 +0100, Alan Pevec wrote: > ACK Pushed. From mburns at redhat.com Wed Mar 17 19:53:31 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 15:53:31 -0400 Subject: [Ovirt-devel] [PATCH][node REPOST] Improve performance of multipath translations Message-ID: <1268855611-11265-1-git-send-email-mburns@redhat.com> Cleanup the translations of /dev/sdX to /dev/mapper and vice-versa. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 59 +++++++++++++++++++++++++---------------- scripts/ovirt-functions | 22 +++++++++++++++ 2 files changed, 58 insertions(+), 23 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 6525847..539f58c 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -38,13 +38,12 @@ swap_min_size=5 get_sd_name() { local id=$1 local device_var=$2 - for device in $(ls /sys/block) - do - if [[ $id = $(cat /sys/block/$device/dev) ]]; then - eval $device_var=$device - return - fi - done + local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1) + + if [ -n "$device_sys" ]; then + eval $device_var=$(basename $(dirname $device_sys)) + return + fi eval $device_var=1 } @@ -83,10 +82,23 @@ translate_multipath_device() { local dev=$1 local mpath_var=$2 + if [ -z "$dev" ]; then + if [ -n "$mpath_var" ]; then + eval $mpath_var= + fi + return + fi + if [[ "$dev" =~ "/dev/mapper" ]]; then + eval $mpath_var=$dev + return + fi + local basedev=$(basename $dev) - local mpath_device=$(multipath -ll $dev |grep -n . | \ - grep "^1:" |awk '{print $1}' | sed 's/^1:/\/dev\/mapper\//g') + local dm_dev=/dev/$(multipath -ll $dev | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') + + local mpath_device= + get_dm_device $dm_dev $mpath_device if [ -z "$mpath_device" ]; then mpath_device=$dev @@ -152,12 +164,12 @@ check_partition_sizes() printf "\n" if [ "$OVIRT_ISCSI_ENABLED" == "y" ]; then - get_drive_size $BOOTDRIVE BOOTDRIVESPACE + get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE drive_list="BOOT" BOOT_NEED_SIZE=$BOOT_SIZE else - get_drive_size $ROOTDRIVE ROOTDRIVESPACE - get_drive_size $HOSTVGDRIVE HOSTVGDRIVESPACE + get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE + get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE ROOT_NEED_SIZE=$(echo "scale=0; $ROOT_SIZE * 2"| bc -l) HOSTVG_NEED_SIZE=$(echo "scale=0;" \ "$SWAP_SIZE + $CONFIG_SIZE + $LOGGING_SIZE + $min_data_size" | bc -l) @@ -224,12 +236,13 @@ manual_input() while true; do read -rp "Enter disk device path: " manual_device if [ -z "$device" ]; then + echo "Aborting." return 1 fi - translate_multipath_device $manual_device manual_device - eval $return_var="$manual_device" + translate_multipath_device "$manual_device" manual_device if [ -n "$manual_device" ]; then if [ -b "$(readlink -f $device)" ]; then + eval $return_var="$manual_device" return 0 fi else @@ -321,7 +334,7 @@ get_dev_name() # There are two or more; make the user choose. # display description for each disk for d in $devices; do - get_drive_size $d >&2 + get_drive_size "$d" >&2 done local choices="$devices Abort" select device in $choices "Manual Selection" @@ -340,12 +353,12 @@ do_configure() if [ "$OVIRT_ISCSI_ENABLED" == "y" ]; then printf "\n\nPlease select the disk to use for the Boot partition.\n\n" BOOTDRIVE=$(get_dev_name) || return 0 - get_drive_size $BOOTDRIVE BOOTDRIVESPACE + get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE echo $BOOTDRIVE else printf "\n\nPlease select the disk to use for the Root.\n\n" ROOTDRIVE=$(get_dev_name) || return 0 - get_drive_size $ROOTDRIVE ROOTDRIVESPACE + get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE printf "\n\nPlease select the disk to use for the HostVG.\n\n" HOSTVGDRIVE=$(get_dev_name) || return 0 @@ -367,7 +380,7 @@ do_configure() done fi $skipped && printf "Installation cannot proceed with existing HostVG.\n" && return 0 - get_drive_size $HOSTVGDRIVE HOSTVGDRIVESPACE + get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE echo $HOSTVGDRIVESPACE fi printf "\n\nPlease configure storage partitions.\n\n" @@ -482,8 +495,8 @@ do_review() The selected disk will be repartitioned as follows: ================================================ - Root Drive: $(get_drive_size $ROOTDRIVE) - HostVG Drive: $(get_drive_size $HOSTVGDRIVE) + Root Drive: $(get_drive_size "$ROOTDRIVE") + HostVG Drive: $(get_drive_size "$HOSTVGDRIVE") Swap partition size: $SWAP_SIZE MB Installation partition size: $ROOT_SIZE * 2 MB Configuration partition size: $CONFIG_SIZE MB @@ -496,7 +509,7 @@ EOF The selected disk will be repartitioned as follows: ================================================ - Boot Drive: $(get_drive_size $BOOTDRIVE) + Boot Drive: $(get_drive_size "$BOOTDRIVE") Boot partition size: $BOOT_SIZE EOF @@ -917,10 +930,10 @@ DATA_SIZE=${OVIRT_VOL_DATA_SIZE:-$default_data_size} if [ -n "$OVIRT_INIT" ]; then # if present, use the drive selected with 'ovirt_init' boot parameter # setting these the same until kernel cmdline argument implemented - translate_multipath_device $OVIRT_INIT DRIVE + translate_multipath_device "$OVIRT_INIT" DRIVE ROOTDRIVE=$DRIVE HOSTVGDRIVE=$DRIVE - get_drive_size $ROOTDRIVE ROOTDRIVESPACE + get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE fi # if the node is Fedora then use GPT, otherwise use MBR diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 6839614..5661bee 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -765,6 +765,28 @@ test_ntp_configuration () { } +get_dm_device () +{ + local device=$1 + local return_var=$2 + major=$(stat -c '%t' $(readlink -f $device)) + minor=$(stat -c '%T' $(readlink -f $device)) + local dm_device= + local rc=1 + for dm in /dev/mapper/*; do + if [ $major = $(stat -c '%t' $dm) -a \ + $minor = $(stat -c '%T' $dm) ]; then + local dm_device=$dm + rc=0 + break + fi + done + + eval $return_var=$dm_device + + return $rc +} + # execute a function if called as a script, e.g. # ovirt-functions ovirt_store_config /etc/hosts -- 1.6.6.1 From mburns at redhat.com Wed Mar 17 20:30:42 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 16:30:42 -0400 Subject: [Ovirt-devel] [PATCH node] fix reboot hang on /etc In-Reply-To: <1268684390-16507-1-git-send-email-jboggs@redhat.com> References: <1268684390-16507-1-git-send-email-jboggs@redhat.com> Message-ID: <1268857842.3659.9.camel@localhost.localdomain> On Mon, 2010-03-15 at 16:19 -0400, Joey Boggs wrote: > --- > recipe/common-pkgs.ks | 1 + > recipe/common-post.ks | 15 +++++++++++++++ > 2 files changed, 16 insertions(+), 0 deletions(-) > > diff --git a/recipe/common-pkgs.ks b/recipe/common-pkgs.ks > index 3aafe53..bc96b43 100644 > --- a/recipe/common-pkgs.ks > +++ b/recipe/common-pkgs.ks > @@ -76,3 +76,4 @@ acpid > device-mapper-multipath > kpartx > dracut-network > +patch > diff --git a/recipe/common-post.ks b/recipe/common-post.ks > index 0f09581..f33984c 100644 > --- a/recipe/common-post.ks > +++ b/recipe/common-post.ks > @@ -166,3 +166,18 @@ empty /mnt > empty /live > empty /boot > EOF > + > +# prevent node from hanging on reboot due to /etc mounts > +patch -d /etc/init.d/ -p0 <<\EOF > +--- halt.orig 2010-03-15 16:01:13.677585448 -0400 > ++++ halt 2010-03-15 16:01:39.798581069 -0400 > +@@ -138,7 +138,7 @@ __umount_loop '$3 ~ /^rpc_pipefs$/ || $3 > + $"Unmounting pipe file systems (retry): " \ > + -f > + > +-LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/dev/{next} > ++LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/etc|^\/dev/{next} > + $3 == "tmpfs" || $3 == "proc" {print $2 ; next} > + /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next} > + {print $2}' /proc/mounts \ > +EOF ACK From apevec at gmail.com Wed Mar 17 20:35:15 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 17 Mar 2010 21:35:15 +0100 Subject: [Ovirt-devel] [PATCH][node REPOST] Improve performance of multipath translations In-Reply-To: <1268855611-11265-1-git-send-email-mburns@redhat.com> References: <1268855611-11265-1-git-send-email-mburns@redhat.com> Message-ID: <2be7262f1003171335w4c36488fx7e12be2d24e29225@mail.gmail.com> ACK From mburns at redhat.com Wed Mar 17 20:39:44 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 17 Mar 2010 16:39:44 -0400 Subject: [Ovirt-devel] [PATCH][node REPOST] Improve performance of multipath translations In-Reply-To: <2be7262f1003171335w4c36488fx7e12be2d24e29225@mail.gmail.com> References: <1268855611-11265-1-git-send-email-mburns@redhat.com> <2be7262f1003171335w4c36488fx7e12be2d24e29225@mail.gmail.com> Message-ID: <1268858384.3659.10.camel@localhost.localdomain> On Wed, 2010-03-17 at 21:35 +0100, Alan Pevec wrote: > ACK Pushed From apevec at redhat.com Thu Mar 18 15:20:11 2010 From: apevec at redhat.com (Alan Pevec) Date: Thu, 18 Mar 2010 16:20:11 +0100 Subject: [Ovirt-devel] [PATCH node] add F-13 repository Message-ID: <1268925611-31392-1-git-send-email-apevec@redhat.com> http://fedoraproject.org/wiki/No_Frozen_Rawhide_Implementation --- recipe/Makefile.am | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/recipe/Makefile.am b/recipe/Makefile.am index f77ba2b..0bd139f 100644 --- a/recipe/Makefile.am +++ b/recipe/Makefile.am @@ -1,5 +1,6 @@ FEDORA_MIRROR = http://mirrors.fedoraproject.org/mirrorlist -CUR_RAWHIDE = 13 +CUR_RAWHIDE = 14 +CUR_DEVEL = 13 CUR_PREVIEW = 12 PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) @@ -27,12 +28,13 @@ repos.ks: ( \ if [ 0$(FEDORA) == 0$(CUR_RAWHIDE) ]; then \ FEDORA_REPO=rawhide ;\ - FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/development/$(ARCH)/os,--mirrorlist=$(FEDORA_MIRROR)?repo=rawhide&arch=$(ARCH))" ;\ - OVIRT_DISTRO=development ;\ + FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/development/rawhide/$(ARCH)/os,--mirrorlist=$(FEDORA_MIRROR)?repo=rawhide&arch=$(ARCH))" ;\ + elif [ 0$(FEDORA) == 0$(CUR_DEVEL) ]; then \ + FEDORA_REPO=f$(FEDORA) ;\ + FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/development/$(FEDORA)/$(ARCH)/os,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=$(ARCH))" ;\ else \ FEDORA_REPO=f$(FEDORA) ;\ FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/${ARCH}/os,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=$(ARCH))" ;\ - OVIRT_DISTRO=$(FEDORA) ;\ UPDATE_REPO_LINE="repo --name=$${FEDORA_REPO}-updates $(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/updates/$(FEDORA)/${ARCH},--mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-f$(FEDORA)&arch=$(ARCH))\n" ;\ if [ 0$(FEDORA) == 0$(CUR_PREVIEW) ]; then \ UPDATE_REPO_LINE="$${UPDATE_REPO_LINE}repo --name=preview --baseurl=$(PREVIEW_URL)\n" ;\ -- 1.6.0.6 From mburns at redhat.com Thu Mar 18 15:56:46 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 18 Mar 2010 11:56:46 -0400 Subject: [Ovirt-devel] [PATCH node] add F-13 repository In-Reply-To: <1268925611-31392-1-git-send-email-apevec@redhat.com> References: <1268925611-31392-1-git-send-email-apevec@redhat.com> Message-ID: <1268927806.3659.12.camel@localhost.localdomain> ACK From mburns at redhat.com Thu Mar 18 19:54:26 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 18 Mar 2010 15:54:26 -0400 Subject: [Ovirt-devel] [PATCH node] fix reboot hang on /etc In-Reply-To: <1268857842.3659.9.camel@localhost.localdomain> References: <1268684390-16507-1-git-send-email-jboggs@redhat.com> <1268857842.3659.9.camel@localhost.localdomain> Message-ID: <1268942066.3659.13.camel@localhost.localdomain> On Wed, 2010-03-17 at 16:30 -0400, Mike Burns wrote: > On Mon, 2010-03-15 at 16:19 -0400, Joey Boggs wrote: > > --- > > recipe/common-pkgs.ks | 1 + > > recipe/common-post.ks | 15 +++++++++++++++ > > 2 files changed, 16 insertions(+), 0 deletions(-) > > > > diff --git a/recipe/common-pkgs.ks b/recipe/common-pkgs.ks > > index 3aafe53..bc96b43 100644 > > --- a/recipe/common-pkgs.ks > > +++ b/recipe/common-pkgs.ks > > @@ -76,3 +76,4 @@ acpid > > device-mapper-multipath > > kpartx > > dracut-network > > +patch > > diff --git a/recipe/common-post.ks b/recipe/common-post.ks > > index 0f09581..f33984c 100644 > > --- a/recipe/common-post.ks > > +++ b/recipe/common-post.ks > > @@ -166,3 +166,18 @@ empty /mnt > > empty /live > > empty /boot > > EOF > > + > > +# prevent node from hanging on reboot due to /etc mounts > > +patch -d /etc/init.d/ -p0 <<\EOF > > +--- halt.orig 2010-03-15 16:01:13.677585448 -0400 > > ++++ halt 2010-03-15 16:01:39.798581069 -0400 > > +@@ -138,7 +138,7 @@ __umount_loop '$3 ~ /^rpc_pipefs$/ || $3 > > + $"Unmounting pipe file systems (retry): " \ > > + -f > > + > > +-LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/dev/{next} > > ++LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/etc|^\/dev/{next} > > + $3 == "tmpfs" || $3 == "proc" {print $2 ; next} > > + /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next} > > + {print $2}' /proc/mounts \ > > +EOF > > ACK Pushing this after fixing 4 whitespace errors > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel From mburns at redhat.com Thu Mar 18 19:59:34 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 18 Mar 2010 15:59:34 -0400 Subject: [Ovirt-devel] [PATCH node] cleanup a couple small issues Message-ID: <1268942374-9938-1-git-send-email-mburns@redhat.com> One instance of a variable being passed instead of a string and another instance of a tweak in a regular expression that doesn't work on F13. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 34e84e5..4f3f174 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -96,7 +96,7 @@ translate_multipath_device() { local dm_dev=/dev/$(multipath -ll $dev | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') local mpath_device= - get_dm_device $dm_dev $mpath_device + get_dm_device $dm_dev mpath_device if [ -z "$mpath_device" ]; then mpath_device=$dev @@ -580,7 +580,7 @@ wipe_lvm_on_disk() reread_partitions() { local drive=$1 - if [[ $drive =~ "^/dev/mapper" ]]; then + if [[ $drive =~ "/dev/mapper" ]]; then kpartx -a -p p $drive else blockdev --rereadpt $drive -- 1.6.6.1 From mburns at redhat.com Thu Mar 18 21:57:45 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 18 Mar 2010 17:57:45 -0400 Subject: [Ovirt-devel] [PATCH node] fix network_up In-Reply-To: <1267700356-4770-1-git-send-email-apevec@redhat.com> References: <1267700356-4770-1-git-send-email-apevec@redhat.com> Message-ID: <1268949465.3659.20.camel@localhost.localdomain> ACK rebased and pushed From mburns at redhat.com Thu Mar 18 22:16:11 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 18 Mar 2010 18:16:11 -0400 Subject: [Ovirt-devel] [PATCH] Adds the qemu log to the autotest output. In-Reply-To: <1263315308-19239-1-git-send-email-dpierce@redhat.com> References: <1263315308-19239-1-git-send-email-dpierce@redhat.com> Message-ID: <1268950571.14144.11.camel@localhost.localdomain> On Tue, 2010-01-12 at 11:55 -0500, Darryl L. Pierce wrote: > When an autotest finishes running, then the output for the qemu logfile > in /var/log/libvirt/qemu/ is added to the output. > > Signed-off-by: Darryl L. Pierce > --- > autotest.sh | 14 +++++++++++++- > 1 files changed, 13 insertions(+), 1 deletions(-) > > diff --git a/autotest.sh b/autotest.sh > index 7503be0..5ccdbbb 100755 > --- a/autotest.sh > +++ b/autotest.sh > @@ -41,8 +41,9 @@ > > ME=$(basename "$0") > WORKDIR=$(mktemp -d) > + > warn() { printf '%s: %s\n' "$ME" "$*" >&2; } > -die() { warn "$*"; exit 1; } > +die() { warn "$*"; show_libvirt_log; exit 1; } Won't this fail without a parameter to show_libvirt_log? > debug() { if $debugging; then log "[DEBUG] %s" "$*"; fi } > > trap '__st=$?; cleanup_after_testing; exit $__st' 1 2 3 13 15 > @@ -69,6 +70,15 @@ Usage: $ME [-n test_name] [LOGFILE] > EOF > } > > +# $1 - the nodename > +show_libvirt_log () { > + local logfile=/var/log/libvirt/qemu/$1.log + local logfile=/var/log/libvirt/qemu/${1-$nodename}.log if [ ! -e $logfile ]; then return fi > + > + printf "\n[${logfile}]\n" > + sudo cat $logfile > + printf "[${logfile}]\n\n" > +} > + > # $1 - the test function to call > execute_test () { > local testname=$1 > @@ -404,6 +414,8 @@ destroy_node () { > sudo virsh undefine $nodename > /dev/null 2>&1 > fi > fi > + > + show_libvirt_log $nodename > fi > } > From dpierce at redhat.com Mon Mar 22 15:39:28 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 22 Mar 2010 11:39:28 -0400 Subject: [Ovirt-devel] Small change and resend... Message-ID: <1269272369-27968-1-git-send-email-dpierce@redhat.com> This patch includes one small change: the Processors::get_load_average() method is now const since it does not change the object's state. From dpierce at redhat.com Mon Mar 22 15:39:29 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 22 Mar 2010 11:39:29 -0400 Subject: [Ovirt-devel] [PATCH] Added the new Processors agent. In-Reply-To: <1269272369-27968-1-git-send-email-dpierce@redhat.com> References: <1269272369-27968-1-git-send-email-dpierce@redhat.com> Message-ID: <1269272369-27968-2-git-send-email-dpierce@redhat.com> The Processors agent reports details regarding the processing power for the managed node. Defined the agent within schema.xml. Wrote the wrapper code to create and populate an instance of the agent. The properties for the Processors agent have also been trimmed back to what is readily available via HAL. Signed-off-by: Darryl L. Pierce --- src/Makefile.am | 26 +++++++++------- src/host.cpp | 2 + src/host.h | 3 ++ src/processors.cpp | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/processors.h | 48 +++++++++++++++++++++++++++++ src/schema.xml | 11 +++++++ 6 files changed, 165 insertions(+), 11 deletions(-) create mode 100644 src/processors.cpp create mode 100644 src/processors.h diff --git a/src/Makefile.am b/src/Makefile.am index 8c94fba..ee30443 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,14 +5,16 @@ sbin_PROGRAMS = matahari first = qmf/com/redhat/matahari/Host.cpp generated_file_list = \ - qmf/com/redhat/matahari/CPU.cpp\ - qmf/com/redhat/matahari/NIC.cpp\ - qmf/com/redhat/matahari/Package.cpp\ - qmf/com/redhat/matahari/Host.h\ - qmf/com/redhat/matahari/CPU.h\ - qmf/com/redhat/matahari/NIC.h\ - qmf/com/redhat/matahari/Package.h\ - qmf/com/redhat/matahari/ArgsNICIdentify_nic.h + qmf/com/redhat/matahari/ArgsNICIdentify_nic.h \ + qmf/com/redhat/matahari/CPU.cpp \ + qmf/com/redhat/matahari/CPU.h \ + qmf/com/redhat/matahari/Host.h \ + qmf/com/redhat/matahari/NIC.cpp \ + qmf/com/redhat/matahari/NIC.h \ + qmf/com/redhat/matahari/Package.cpp \ + qmf/com/redhat/matahari/Package.h \ + qmf/com/redhat/matahari/Processors.cpp \ + qmf/com/redhat/matahari/Processors.h nodist_matahari_SOURCES = $(generated_file_list) $(first) @@ -25,11 +27,13 @@ matahari_SOURCES = \ host.h \ main.cpp \ nic.cpp \ - nic.h + nic.h \ + processors.cpp \ + processors.h -$(generated_file_list): $(first) +$(generated_file_list): $(generated_file_list) -$(first): schema.xml +$(first): schema.xml $(generated_file_list) qmf-gen -o ./qmf ./schema.xml BUILT_SOURCES = $(generated_file_list) $(first) diff --git a/src/host.cpp b/src/host.cpp index 0d22211..c81d2f1 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -78,6 +78,8 @@ void HostWrapper::setupQMFObjects(ManagementAgent *agent) agent->addObject(mgmt_object); syncQMFHostObject(); + processors.setup(agent); + // Iterate over list and set up CPU objects for (vector::iterator iter = cpus.begin(); iter!= cpus.end(); diff --git a/src/host.h b/src/host.h index 06bdbf0..148c91f 100644 --- a/src/host.h +++ b/src/host.h @@ -25,6 +25,7 @@ #include "cpu.h" #include "nic.h" +#include "processors.h" using namespace qpid::management; using namespace std; @@ -49,6 +50,8 @@ class HostWrapper : public Manageable vector cpus; vector nics; + ProcessorsAgent processors; + // QMF related fields ManagementAgent *agent; qmf::com::redhat::matahari::Host *mgmt_object; diff --git a/src/processors.cpp b/src/processors.cpp new file mode 100644 index 0000000..32a19d4 --- /dev/null +++ b/src/processors.cpp @@ -0,0 +1,86 @@ +/* processor.cpp - Copyright (C) 2010 Red Hat, Inc. + * Written by Darryl L. Pierce + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. A copy of the GNU General Public License is + * also available at http://www.gnu.org/copyleft/gpl.html. + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "hal.h" +#include "processors.h" + +#include "qmf/com/redhat/matahari/ArgsProcessorsGet_load_average.h" + +using namespace std; +namespace _qmf = qmf::com::redhat::matahari; + +extern DBusError dbus_error; + +void +ProcessorsAgent::setup(ManagementAgent* agent) +{ + // setup the management object + management_object = new _qmf::Processors(agent, this); + agent->addObject(management_object); + + LibHalContext* context = get_hal_ctx(); + + int num_results; + char** processors = libhal_find_device_by_capability(context,"processor", &num_results, &dbus_error); + + if (!processors) + throw runtime_error("Error: could not query processors via HAL."); + + // populate the managed object's values + management_object->set_model(libhal_device_get_property_string(context, processors[0], "info.product", &dbus_error)); + management_object->set_cores(num_results); +} + +Manageable::status_t +ProcessorsAgent::ManagementMethod(uint32_t id, Args& args, string& text) +{ + switch(id) + { + case _qmf::Processors::METHOD_GET_LOAD_AVERAGE: + _qmf::ArgsProcessorsGet_load_average& loadavg = (_qmf::ArgsProcessorsGet_load_average&) args; + loadavg.o_ret = get_load_average(); + return STATUS_OK; + } + + return STATUS_NOT_IMPLEMENTED; +} + +double +ProcessorsAgent::get_load_average(void) const +{ + double result; + ifstream input; + + input.open("/proc/loadavg", ios::in); + input >> result; + input.close(); + + return result; +} diff --git a/src/processors.h b/src/processors.h new file mode 100644 index 0000000..6833c10 --- /dev/null +++ b/src/processors.h @@ -0,0 +1,48 @@ +/* processor.h - Copyright (C) 2010 Red Hat, Inc. + * Written by Darryl L. Pierce + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. A copy of the GNU General Public License is + * also available at http://www.gnu.org/copyleft/gpl.html. + */ + +#include +#include +#include +#include + +#include "qmf/com/redhat/matahari/Processors.h" + +using namespace qpid::management; +using namespace std; + +using qpid::management::Manageable; + +class ProcessorsAgent : public Manageable +{ + private: + qmf::com::redhat::matahari::Processors* management_object; + + public: + ProcessorsAgent() {} + virtual ~ProcessorsAgent() {} + + ManagementObject* GetManagementObject(void) const { return management_object; } + Manageable::status_t ManagementMethod(uint32_t id, Args& args, string& text); + + void setup(ManagementAgent* agent); + + // agent methods + double get_load_average(void) const; +}; diff --git a/src/schema.xml b/src/schema.xml index 5fb683f..40ab3d0 100644 --- a/src/schema.xml +++ b/src/schema.xml @@ -14,6 +14,17 @@ + + + + + + + + + + + -- 1.6.6.1 From aclement at linagora.com Mon Mar 22 16:29:39 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Mon, 22 Mar 2010 17:29:39 +0100 Subject: [Ovirt-devel] [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline. Message-ID: <201003221729.39446.aclement@linagora.com> This patch include the one from D Pierce (02/23/210 : [Ovirt-devel] [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline). I tested it with success. >From 4fca494546727ca305ecc4eca61ebf86b184d263 Mon Sep 17 00:00:00 2001 From: Arthur CLEMENT Date: Mon, 22 Mar 2010 16:24:18 +0000 Subject: [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline. Signed-off-by: Arthur CLEMENT --- scripts/ovirt | 3 --- scripts/ovirt-awake | 4 +--- scripts/ovirt-early | 17 +++++++++++------ scripts/ovirt-functions | 12 ++++++++---- scripts/ovirt-post | 3 --- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/scripts/ovirt b/scripts/ovirt index 9f7156a..868d396 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -16,9 +16,6 @@ prog=ovirt VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - ovirt_start() { if is_standalone; then return 0 diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index 5126a54..ed4cb6f 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -31,15 +31,13 @@ # config: /etc/sysconfig/node-config . /etc/init.d/functions +. /usr/libexec/ovirt-functions prog=ovirt-awake NODE_CONFIG=/etc/sysconfig/node-config VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" -. /usr/libexec/ovirt-functions send_text () { local text=${1} diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 24c1816..7f7c99c 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -15,9 +15,6 @@ prog=ovirt-early VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - BONDING_MODCONF_FILE=/etc/modprobe.d/bonding AUGTOOL_CONFIG=/var/tmp/augtool-config EARLY_DIR=/etc/ovirt-early.d @@ -181,6 +178,7 @@ start_ovirt_early () { # ovirt_upgrade # ovirt_standalone # ovirt_firstboot + # ovirt_runtime_mode # rescue # pxelinux format: ip=::: # anaconda format: ip= netmask= gateway= @@ -242,6 +240,10 @@ start_ovirt_early () { # in auto-install mode, overwrite the disk chosen by ovirt_init parameter firstboot= + # ovirt_runtime_mode + # overrides the runtime mode defined in /etc/sysconfig/node-config + runtime_mode= + # rescue # enter emergency shell for fixing configuration issues rescue= @@ -367,7 +369,10 @@ start_ovirt_early () { ovirt_firstboot*) firstboot=1 ;; - rescue) + runtime_mode*) + runtime_mode=${i#runtime_mode=} + ;; + rescue) rescue=1 ;; rootpw=*) @@ -442,7 +447,7 @@ start_ovirt_early () { ip_gateway=$gateway fi # save boot parameters as defaults for ovirt-config-* - params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot" + params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot runtime_mode" # mount /config unless firstboot is forced if [ "$firstboot" != "1" ]; then mount_config @@ -459,7 +464,7 @@ start_ovirt_early () { fi done augtool $tmpaug - + . $OVIRT_DEFAULTS if [ -f /etc/sysconfig/network ]; then . /etc/sysconfig/network if [ -n "$HOSTNAME" ]; then diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 8e6d770..f760b69 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -6,11 +6,15 @@ _log_status=1 # label of the oVirt partition OVIRT_LABEL=OVIRT -# configuration defaults +# configuration values are loaded in the following order: +# 1. /etc/sysconfig/node-config sets the default values +# 2. /etc/default/ovirt is loaded to override defaults with karg values +NODE_SYSCONFIG=/etc/sysconfig/node-config OVIRT_DEFAULTS=/etc/default/ovirt -if [ -f $OVIRT_DEFAULTS ]; then - . $OVIRT_DEFAULTS -fi + +if [ -f "$NODE_SYSCONFIG" ]; then . "$NODE_SYSCONFIG"; fi +if [ -f $OVIRT_DEFAULTS ]; then . $OVIRT_DEFAULTS; fi + # fallback when default is empty OVIRT_STANDALONE=${OVIRT_STANDALONE:-0} diff --git a/scripts/ovirt-post b/scripts/ovirt-post index d0d1d20..936a0fd 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -16,9 +16,6 @@ prog=ovirt-post VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - start_ovirt_post() { # wait for libvirt to finish initializing local count=0 -- 1.6.6.1 -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Mon Mar 22 16:36:02 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Mon, 22 Mar 2010 17:36:02 +0100 Subject: [Ovirt-devel] [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline. In-Reply-To: <201003221729.39446.aclement@linagora.com> References: <201003221729.39446.aclement@linagora.com> Message-ID: <201003221736.02280.aclement@linagora.com> Correction : it's the patch from 02/24 ( [Ovirt-devel] Replacement patch...), it overrides the one from the 23 On Lundi 22 Mars 2010 17:29:39 Arthur Cl?ment wrote: > This patch include the one from D Pierce (02/23/210 : [Ovirt-devel] > [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel > cmdline). > > I tested it with success. > > >From 4fca494546727ca305ecc4eca61ebf86b184d263 Mon Sep 17 00:00:00 2001 > > From: Arthur CLEMENT > Date: Mon, 22 Mar 2010 16:24:18 +0000 > Subject: [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the > kernel cmdline. > > > Signed-off-by: Arthur CLEMENT > --- > scripts/ovirt | 3 --- > scripts/ovirt-awake | 4 +--- > scripts/ovirt-early | 17 +++++++++++------ > scripts/ovirt-functions | 12 ++++++++---- > scripts/ovirt-post | 3 --- > 5 files changed, 20 insertions(+), 19 deletions(-) > > diff --git a/scripts/ovirt b/scripts/ovirt > index 9f7156a..868d396 100755 > --- a/scripts/ovirt > +++ b/scripts/ovirt > @@ -16,9 +16,6 @@ > prog=ovirt > VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog > > -# load the configuration file > -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" > - > ovirt_start() { > if is_standalone; then > return 0 > diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake > index 5126a54..ed4cb6f 100755 > --- a/scripts/ovirt-awake > +++ b/scripts/ovirt-awake > @@ -31,15 +31,13 @@ > # config: /etc/sysconfig/node-config > > . /etc/init.d/functions > +. /usr/libexec/ovirt-functions > > prog=ovirt-awake > NODE_CONFIG=/etc/sysconfig/node-config > VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config > > -# load the configuration file > -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" > > -. /usr/libexec/ovirt-functions > > send_text () { > local text=${1} > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 24c1816..7f7c99c 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -15,9 +15,6 @@ > prog=ovirt-early > VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog > > -# load the configuration file > -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" > - > BONDING_MODCONF_FILE=/etc/modprobe.d/bonding > AUGTOOL_CONFIG=/var/tmp/augtool-config > EARLY_DIR=/etc/ovirt-early.d > @@ -181,6 +178,7 @@ start_ovirt_early () { > # ovirt_upgrade > # ovirt_standalone > # ovirt_firstboot > + # ovirt_runtime_mode > # rescue > # pxelinux format: ip=::: > # anaconda format: ip= netmask= gateway= > @@ -242,6 +240,10 @@ start_ovirt_early () { > # in auto-install mode, overwrite the disk chosen by ovirt_init > parameter firstboot= > > + # ovirt_runtime_mode > + # overrides the runtime mode defined in /etc/sysconfig/node-config > + runtime_mode= > + > # rescue > # enter emergency shell for fixing configuration issues > rescue= > @@ -367,7 +369,10 @@ start_ovirt_early () { > ovirt_firstboot*) > firstboot=1 > ;; > - rescue) > + runtime_mode*) > + runtime_mode=${i#runtime_mode=} > + ;; > + rescue) > rescue=1 > ;; > rootpw=*) > @@ -442,7 +447,7 @@ start_ovirt_early () { > ip_gateway=$gateway > fi > # save boot parameters as defaults for ovirt-config-* > - params="bootif init vol_boot_size vol_swap_size vol_root_size > vol_config_size vol_logging_size vol_data_size upgrade standalone > overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth > syslog_server syslog_port collectd_server collectd_port bootparams > hostname firstboot" + params="bootif init vol_boot_size vol_swap_size > vol_root_size vol_config_size vol_logging_size vol_data_size upgrade > standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan > ssh_pwauth syslog_server syslog_port collectd_server collectd_port > bootparams hostname firstboot runtime_mode" > # mount /config unless firstboot is forced > if [ "$firstboot" != "1" ]; then > mount_config > @@ -459,7 +464,7 @@ start_ovirt_early () { > fi > done > augtool $tmpaug > - > + . $OVIRT_DEFAULTS > if [ -f /etc/sysconfig/network ]; then > . /etc/sysconfig/network > if [ -n "$HOSTNAME" ]; then > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index 8e6d770..f760b69 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -6,11 +6,15 @@ _log_status=1 > > # label of the oVirt partition > OVIRT_LABEL=OVIRT > -# configuration defaults > +# configuration values are loaded in the following order: > +# 1. /etc/sysconfig/node-config sets the default values > +# 2. /etc/default/ovirt is loaded to override defaults with karg values > +NODE_SYSCONFIG=/etc/sysconfig/node-config > OVIRT_DEFAULTS=/etc/default/ovirt > -if [ -f $OVIRT_DEFAULTS ]; then > - . $OVIRT_DEFAULTS > -fi > + > +if [ -f "$NODE_SYSCONFIG" ]; then . "$NODE_SYSCONFIG"; fi > +if [ -f $OVIRT_DEFAULTS ]; then . $OVIRT_DEFAULTS; fi > + > # fallback when default is empty > OVIRT_STANDALONE=${OVIRT_STANDALONE:-0} > > diff --git a/scripts/ovirt-post b/scripts/ovirt-post > index d0d1d20..936a0fd 100755 > --- a/scripts/ovirt-post > +++ b/scripts/ovirt-post > @@ -16,9 +16,6 @@ > prog=ovirt-post > VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog > > -# load the configuration file > -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" > - > start_ovirt_post() { > # wait for libvirt to finish initializing > local count=0 -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Mon Mar 22 20:05:58 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 22 Mar 2010 16:05:58 -0400 Subject: [Ovirt-devel] Resend with loadavg as a statistic... Message-ID: <1269288359-19370-1-git-send-email-dpierce@redhat.com> After some feedback from Slow, mainly about the load_average API being a method rather than an ongoing statistic. So I've converted the code over to instead update the load average statistic on a regular basis. From dpierce at redhat.com Mon Mar 22 20:05:59 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 22 Mar 2010 16:05:59 -0400 Subject: [Ovirt-devel] [PATCH] Added the new Processors agent. In-Reply-To: <1269288359-19370-1-git-send-email-dpierce@redhat.com> References: <1269288359-19370-1-git-send-email-dpierce@redhat.com> Message-ID: <1269288359-19370-2-git-send-email-dpierce@redhat.com> The Processors agent reports details regarding the processing power for the managed node. Defined the agent within schema.xml. Wrote the wrapper code to create and populate an instance of the agent. The properties for the Processors agent have also been trimmed back to what is readily available via HAL. A future fix will replace this with calls to sysfs. Signed-off-by: Darryl L. Pierce --- src/Makefile.am | 26 +++++++++++-------- src/host.cpp | 6 ++++ src/host.h | 3 ++ src/processors.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/processors.h | 47 +++++++++++++++++++++++++++++++++++ src/schema.xml | 9 ++++++ 6 files changed, 150 insertions(+), 11 deletions(-) create mode 100644 src/processors.cpp create mode 100644 src/processors.h diff --git a/src/Makefile.am b/src/Makefile.am index 8c94fba..ee30443 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,14 +5,16 @@ sbin_PROGRAMS = matahari first = qmf/com/redhat/matahari/Host.cpp generated_file_list = \ - qmf/com/redhat/matahari/CPU.cpp\ - qmf/com/redhat/matahari/NIC.cpp\ - qmf/com/redhat/matahari/Package.cpp\ - qmf/com/redhat/matahari/Host.h\ - qmf/com/redhat/matahari/CPU.h\ - qmf/com/redhat/matahari/NIC.h\ - qmf/com/redhat/matahari/Package.h\ - qmf/com/redhat/matahari/ArgsNICIdentify_nic.h + qmf/com/redhat/matahari/ArgsNICIdentify_nic.h \ + qmf/com/redhat/matahari/CPU.cpp \ + qmf/com/redhat/matahari/CPU.h \ + qmf/com/redhat/matahari/Host.h \ + qmf/com/redhat/matahari/NIC.cpp \ + qmf/com/redhat/matahari/NIC.h \ + qmf/com/redhat/matahari/Package.cpp \ + qmf/com/redhat/matahari/Package.h \ + qmf/com/redhat/matahari/Processors.cpp \ + qmf/com/redhat/matahari/Processors.h nodist_matahari_SOURCES = $(generated_file_list) $(first) @@ -25,11 +27,13 @@ matahari_SOURCES = \ host.h \ main.cpp \ nic.cpp \ - nic.h + nic.h \ + processors.cpp \ + processors.h -$(generated_file_list): $(first) +$(generated_file_list): $(generated_file_list) -$(first): schema.xml +$(first): schema.xml $(generated_file_list) qmf-gen -o ./qmf ./schema.xml BUILT_SOURCES = $(generated_file_list) $(first) diff --git a/src/host.cpp b/src/host.cpp index 0d22211..44c7717 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -68,7 +68,11 @@ void HostWrapper::doLoop(void) { // Someday we might update statistics too! while(1) + { + // update all statistics + processors.update_load_averages(); sleep(5); + } } void HostWrapper::setupQMFObjects(ManagementAgent *agent) @@ -78,6 +82,8 @@ void HostWrapper::setupQMFObjects(ManagementAgent *agent) agent->addObject(mgmt_object); syncQMFHostObject(); + processors.setup(agent); + // Iterate over list and set up CPU objects for (vector::iterator iter = cpus.begin(); iter!= cpus.end(); diff --git a/src/host.h b/src/host.h index 06bdbf0..148c91f 100644 --- a/src/host.h +++ b/src/host.h @@ -25,6 +25,7 @@ #include "cpu.h" #include "nic.h" +#include "processors.h" using namespace qpid::management; using namespace std; @@ -49,6 +50,8 @@ class HostWrapper : public Manageable vector cpus; vector nics; + ProcessorsAgent processors; + // QMF related fields ManagementAgent *agent; qmf::com::redhat::matahari::Host *mgmt_object; diff --git a/src/processors.cpp b/src/processors.cpp new file mode 100644 index 0000000..3edc417 --- /dev/null +++ b/src/processors.cpp @@ -0,0 +1,70 @@ +/* processor.cpp - Copyright (C) 2010 Red Hat, Inc. + * Written by Darryl L. Pierce + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. A copy of the GNU General Public License is + * also available at http://www.gnu.org/copyleft/gpl.html. + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "hal.h" +#include "processors.h" + +using namespace std; +namespace _qmf = qmf::com::redhat::matahari; + +extern DBusError dbus_error; + +void +ProcessorsAgent::setup(ManagementAgent* agent) +{ + // setup the management object + management_object = new _qmf::Processors(agent, this); + agent->addObject(management_object); + + LibHalContext* context = get_hal_ctx(); + + int num_results; + char** processors = libhal_find_device_by_capability(context,"processor", &num_results, &dbus_error); + + if (!processors) + throw runtime_error("Error: could not query processors via HAL."); + + // populate the managed object's values + management_object->set_model(libhal_device_get_property_string(context, processors[0], "info.product", &dbus_error)); + management_object->set_cores(num_results); +} + +void +ProcessorsAgent::update_load_averages(void) const +{ + double load_average; + ifstream input; + + input.open("/proc/loadavg", ios::in); + input >> load_average; + input.close(); + + management_object->set_load_average(load_average); +} diff --git a/src/processors.h b/src/processors.h new file mode 100644 index 0000000..008ce11 --- /dev/null +++ b/src/processors.h @@ -0,0 +1,47 @@ +/* processor.h - Copyright (C) 2010 Red Hat, Inc. + * Written by Darryl L. Pierce + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. A copy of the GNU General Public License is + * also available at http://www.gnu.org/copyleft/gpl.html. + */ + +#include +#include +#include +#include + +#include "qmf/com/redhat/matahari/Processors.h" + +using namespace qpid::management; +using namespace std; + +using qpid::management::Manageable; + +class ProcessorsAgent : public Manageable +{ + private: + qmf::com::redhat::matahari::Processors* management_object; + + public: + ProcessorsAgent() {} + virtual ~ProcessorsAgent() {} + + ManagementObject* GetManagementObject(void) const { return management_object; } + + void setup(ManagementAgent* agent); + + // agent methods + void update_load_averages(void) const; +}; diff --git a/src/schema.xml b/src/schema.xml index 5fb683f..48e9576 100644 --- a/src/schema.xml +++ b/src/schema.xml @@ -14,6 +14,15 @@ + + + + + + + + + -- 1.6.6.1 From aclement at linagora.com Tue Mar 23 13:41:54 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 23 Mar 2010 13:41:54 +0000 Subject: [Ovirt-devel] [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline. Message-ID: <1269351714-13355-1-git-send-email-aclement@linagora.com> Signed-off-by: Arthur CLEMENT --- scripts/ovirt | 3 --- scripts/ovirt-awake | 4 +--- scripts/ovirt-early | 17 +++++++++++------ scripts/ovirt-functions | 12 ++++++++---- scripts/ovirt-post | 3 --- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/scripts/ovirt b/scripts/ovirt index 9f7156a..868d396 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -16,9 +16,6 @@ prog=ovirt VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - ovirt_start() { if is_standalone; then return 0 diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index 5126a54..ed4cb6f 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -31,15 +31,13 @@ # config: /etc/sysconfig/node-config . /etc/init.d/functions +. /usr/libexec/ovirt-functions prog=ovirt-awake NODE_CONFIG=/etc/sysconfig/node-config VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" -. /usr/libexec/ovirt-functions send_text () { local text=${1} diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 24c1816..7f7c99c 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -15,9 +15,6 @@ prog=ovirt-early VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - BONDING_MODCONF_FILE=/etc/modprobe.d/bonding AUGTOOL_CONFIG=/var/tmp/augtool-config EARLY_DIR=/etc/ovirt-early.d @@ -181,6 +178,7 @@ start_ovirt_early () { # ovirt_upgrade # ovirt_standalone # ovirt_firstboot + # ovirt_runtime_mode # rescue # pxelinux format: ip=::: # anaconda format: ip= netmask= gateway= @@ -242,6 +240,10 @@ start_ovirt_early () { # in auto-install mode, overwrite the disk chosen by ovirt_init parameter firstboot= + # ovirt_runtime_mode + # overrides the runtime mode defined in /etc/sysconfig/node-config + runtime_mode= + # rescue # enter emergency shell for fixing configuration issues rescue= @@ -367,7 +369,10 @@ start_ovirt_early () { ovirt_firstboot*) firstboot=1 ;; - rescue) + runtime_mode*) + runtime_mode=${i#runtime_mode=} + ;; + rescue) rescue=1 ;; rootpw=*) @@ -442,7 +447,7 @@ start_ovirt_early () { ip_gateway=$gateway fi # save boot parameters as defaults for ovirt-config-* - params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot" + params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot runtime_mode" # mount /config unless firstboot is forced if [ "$firstboot" != "1" ]; then mount_config @@ -459,7 +464,7 @@ start_ovirt_early () { fi done augtool $tmpaug - + . $OVIRT_DEFAULTS if [ -f /etc/sysconfig/network ]; then . /etc/sysconfig/network if [ -n "$HOSTNAME" ]; then diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 8e6d770..f760b69 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -6,11 +6,15 @@ _log_status=1 # label of the oVirt partition OVIRT_LABEL=OVIRT -# configuration defaults +# configuration values are loaded in the following order: +# 1. /etc/sysconfig/node-config sets the default values +# 2. /etc/default/ovirt is loaded to override defaults with karg values +NODE_SYSCONFIG=/etc/sysconfig/node-config OVIRT_DEFAULTS=/etc/default/ovirt -if [ -f $OVIRT_DEFAULTS ]; then - . $OVIRT_DEFAULTS -fi + +if [ -f "$NODE_SYSCONFIG" ]; then . "$NODE_SYSCONFIG"; fi +if [ -f $OVIRT_DEFAULTS ]; then . $OVIRT_DEFAULTS; fi + # fallback when default is empty OVIRT_STANDALONE=${OVIRT_STANDALONE:-0} diff --git a/scripts/ovirt-post b/scripts/ovirt-post index d0d1d20..936a0fd 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -16,9 +16,6 @@ prog=ovirt-post VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - start_ovirt_post() { # wait for libvirt to finish initializing local count=0 -- 1.6.6.1 From dpierce at redhat.com Tue Mar 23 13:53:34 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Mar 2010 09:53:34 -0400 Subject: [Ovirt-devel] [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline. In-Reply-To: <1269351714-13355-1-git-send-email-aclement@linagora.com> References: <1269351714-13355-1-git-send-email-aclement@linagora.com> Message-ID: <20100323135334.GP7544@mcpierce-desktop.usersys.redhat.com> On Tue, Mar 23, 2010 at 01:41:54PM +0000, Arthur CLEMENT wrote: > > Signed-off-by: Arthur CLEMENT Thanks. This is ACK'd and pushed upstream. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From aclement at linagora.com Tue Mar 23 14:10:31 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 23 Mar 2010 14:10:31 +0000 Subject: [Ovirt-devel] [PATCH] Fixes how o-process-config handles missing field names or values. Message-ID: <1269353431-13641-1-git-send-email-aclement@linagora.com> Signed-off-by: Arthur CLEMENT --- scripts/ovirt-process-config | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-process-config b/scripts/ovirt-process-config index 6011cd7..7a78a57 100755 --- a/scripts/ovirt-process-config +++ b/scripts/ovirt-process-config @@ -9,6 +9,8 @@ ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } + try_h() { printf "Try \`$ME -h' for more information.\n" >&2; exit 1;} try_help() { printf "Usage: \`$ME [config] [module output] [config output]\n" >&2; exit 1;} @@ -55,20 +57,41 @@ networking=$(awk '/^[ \t]*ifcfg=/ { field=values[1] value=values[2] + if(length(field) == 0) { + print "Missing field name." + exit 1 + } + + if(length(value) == 0) { + print "Missing field value." + exit 2 + } + printf("set %s/ifcfg-%s/%s %s\n", ifcfg_dir, iface, field, value) } } }' $CONFIG) +SUCCESS=$? + +if [ SUCCESS != 0 ]; then + case $SUCCESS in + 1) error="missing field name";; + 2) error="missing field value";; + esac + + die "Bad data received: ${error}" +fi + echo "$networking" > $OVIRT_CONFIG_OUTPUT_FILE if [ -f $OVIRT_CONFIG_OUTPUT_FILE ]; then augtool $OVIRT_CONFIG_OUTPUT_FILE \ - && RESULT=0 || RESULT=1 + && RESULT=0 || RESULT=1 # FIXME do not store ifcfg-lo if ls /etc/sysconfig/network-scripts/ifcfg* >/dev/null 2>/dev/null; then - ovirt_store_config /etc/sysconfig/network-scripts/ifcfg* + ovirt_store_config /etc/sysconfig/network-scripts/ifcfg* fi fi -- 1.6.6.1 From mburns at redhat.com Tue Mar 23 14:32:29 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 10:32:29 -0400 Subject: [Ovirt-devel] [PATCH node] Filter out /dev/dm-* devices from device list Message-ID: <1269354749-15054-1-git-send-email-mburns@redhat.com> dm-* devices are references to existing /dev/sd* and /dev/mapper/. We should not depend on them and only present /dev/sd* and /dev/mapper/ to the user. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 34e84e5..e4b6c98 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -307,14 +307,15 @@ get_dev_name() devices="$devices /dev/mapper/$dev" local sd_devs="" get_multipath_devices $dev sd_devs - devs_to_remove="${devs_to_remove} ${sd_devs}" + local dm_dev=$(multipath -ll $dev | grep $dev | sed -r 's/^.*(dm-[0-9]+ ).*$/\1/') + devs_to_remove="${devs_to_remove} ${sd_devs} $dm_dev" done # Remove /dev/sd* devices that are part of a multipath device local dev_list for dev in $devices do - if [[ ! "$devs_to_remove" =~ "$(basename $dev)" ]]; then + if [[ ! "$devs_to_remove" =~ "$(basename $dev) " ]]; then dev_list="$dev_list $dev" fi done -- 1.6.6.1 From dpierce at redhat.com Tue Mar 23 15:01:55 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Mar 2010 11:01:55 -0400 Subject: [Ovirt-devel] [PATCH node] cleanup a couple small issues In-Reply-To: <1268942374-9938-1-git-send-email-mburns@redhat.com> References: <1268942374-9938-1-git-send-email-mburns@redhat.com> Message-ID: <20100323150155.GQ7544@mcpierce-desktop.usersys.redhat.com> On Thu, Mar 18, 2010 at 03:59:34PM -0400, Mike Burns wrote: > One instance of a variable being passed instead of a string > and another instance of a tweak in a regular expression that doesn't > work on F13. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-storage | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index 34e84e5..4f3f174 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -96,7 +96,7 @@ translate_multipath_device() { > local dm_dev=/dev/$(multipath -ll $dev | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') > > local mpath_device= > - get_dm_device $dm_dev $mpath_device > + get_dm_device $dm_dev mpath_device > > if [ -z "$mpath_device" ]; then > mpath_device=$dev > @@ -580,7 +580,7 @@ wipe_lvm_on_disk() > reread_partitions() > { > local drive=$1 > - if [[ $drive =~ "^/dev/mapper" ]]; then > + if [[ $drive =~ "/dev/mapper" ]]; then > kpartx -a -p p $drive > else > blockdev --rereadpt $drive > -- > 1.6.6.1 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Tue Mar 23 15:48:41 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Mar 2010 11:48:41 -0400 Subject: [Ovirt-devel] Resend of one patch, new to follow on... Message-ID: <1269359325-6700-1-git-send-email-dpierce@redhat.com> The first patch in this set was submitted in January but never ACK'd. The following three are follow on patches to fix other issues that have come up. From dpierce at redhat.com Tue Mar 23 15:48:42 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Mar 2010 11:48:42 -0400 Subject: [Ovirt-devel] [PATCH 1/4] Fixed unpersisting directories and persisting directories that contain persisted files. In-Reply-To: <1269359325-6700-1-git-send-email-dpierce@redhat.com> References: <1269359325-6700-1-git-send-email-dpierce@redhat.com> Message-ID: <1269359325-6700-2-git-send-email-dpierce@redhat.com> Resolves: rhbz#556616 Signed-off-by: Darryl L. Pierce --- scripts/ovirt-functions | 107 ++++++++++++++++++++++++++++++---------------- 1 files changed, 70 insertions(+), 37 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index f760b69..ad3f511 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -1,4 +1,4 @@ -# -*-Shell-script-*- +\# -*-Shell-script-*- OVIRT_LOGFILE=/var/log/ovirt.log OVIRT_TMP_LOGFILE=/tmp/ovirt.log @@ -465,28 +465,41 @@ ovirt_store_config() { if grep -q " /config ext3" /proc/mounts; then printf "storing to /config :\n" for p in "$@"; do - f=$(readlink -f $p) - printf "$f" - # skip if file does not exist or is empty - if [ ! -s "$f" ]; then - printf " Skipping, file '%s' does not exist or is empty\n" $p - continue - fi - # skip if already bind-mounted - if ! grep -q " $f ext3" /proc/mounts ; then - mkdir -p /config$(dirname $f) - cp -a $f /config$f \ - && mount -n --bind /config$f $f - if [ $? -ne 0 ]; then - printf " Failed to persist\n" - rc=1 - else - printf " File persisted\n" + local persist_it=true + + # ensure that, if this is a directory + if [ -d $p ]; then + if [ -d /config$p ]; then + persist_it=false fi fi - # register in /config/files used by rc.sysinit - if ! grep -q "^$f$" /config/files 2> /dev/null ; then - printf "$f\n" >> /config/files + + if $persist_it; then + f=$(readlink -f $p) + printf "$f" + # skip if file does not exist or is empty + if [ ! -s "$f" ]; then + printf " Skipping, file '%s' does not exist or is empty\n" $p + continue + fi + # skip if already bind-mounted + if ! grep -q " $f ext3" /proc/mounts ; then + mkdir -p /config$(dirname $f) + cp -a $f /config$f \ + && mount -n --bind /config$f $f + if [ $? -ne 0 ]; then + printf " Failed to persist\n" + rc=1 + else + printf " File persisted\n" + fi + fi + # register in /config/files used by rc.sysinit + if ! grep -q "^$f$" /config/files 2> /dev/null ; then + printf "$f\n" >> /config/files + fi + else + printf "Could not persist $p: it contains an already persisted file.\n" fi done echo @@ -529,13 +542,24 @@ remove_config() { f=$(readlink -f $p) if grep -q " $f ext3" /proc/mounts ; then if umount -n $f; then - if [ -f /config$f ]; then - # refresh the file in rootfs if it was mounted over - cp -a /config$f $f + if [ -d $f ]; then + cp -ar /config/$f/* $f if [ $? -ne 0 ]; then - printf " Failed to unpersist %s\n" $f + printf " Failed to unpersist ${f}\n" + exit 1 else - printf " %s successully unpersisted\n" $f + printf " $f successfully unpersisted\n" + fi + else + if [ -f /config$f ]; then + # refresh the file in rootfs if it was mounted over + cp -a /config$f $f + if [ $? -ne 0 ]; then + printf " Failed to unpersist %s\n" $f + exit 1 + else + printf " %s successully unpersisted\n" $f + fi fi fi fi @@ -557,17 +581,26 @@ remove_config() { # WARNING: file is shredded and removed # ovirt_safe_delete_config() { - if grep -q " /config ext3" /proc/mounts; then - for f in "$@"; do - if grep -q " $f ext3" /proc/mounts ; then - umount -n $f - fi - # unregister in /config/files used by rc.sysinit - sed --copy -i "\|^$f$|d" /config/files - shred -u /config$f - done - fi - shred -u $f + local target + + for target in "$@"; do + if grep -q " $target ext3" /proc/mounts; then + umount -n $target + fi + + sed --copy -i "\|$target$|d" /config/files + + if [ -d $target ]; then + for child in $(ls -d $target/*); do + ovirt_safe_delete_config $child + done + rm -rf /config$target + rm -rf $target + else + shred -u /config$target + shred -u $target + fi + done } -- 1.6.6.1 From dpierce at redhat.com Tue Mar 23 15:48:43 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Mar 2010 11:48:43 -0400 Subject: [Ovirt-devel] [PATCH 2/4] Fixes persisting a persisted file, or unpersisting a non-persisted file. In-Reply-To: <1269359325-6700-2-git-send-email-dpierce@redhat.com> References: <1269359325-6700-1-git-send-email-dpierce@redhat.com> <1269359325-6700-2-git-send-email-dpierce@redhat.com> Message-ID: <1269359325-6700-3-git-send-email-dpierce@redhat.com> Previously the ovirt_store_config function only checked if a directory was already persisted. This patch adds in checking if a targeted file is already persisted as well. If so, then it fails with an error message. When the user tries to unpersist a file that was not explicitly persisted before (it's not listed in /config/files) then the user is told the file was not persisted previously, and the command exits. Resolves: rhbz#576329 Signed-off-by: Darryl L. Pierce --- scripts/ovirt-functions | 75 ++++++++++++++++++++++++++++++----------------- 1 files changed, 48 insertions(+), 27 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index ad3f511..dfa53a8 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -1,4 +1,4 @@ -\# -*-Shell-script-*- +# -*-Shell-script-*- OVIRT_LOGFILE=/var/log/ovirt.log OVIRT_TMP_LOGFILE=/tmp/ovirt.log @@ -463,13 +463,24 @@ EOF ovirt_store_config() { rc=0 if grep -q " /config ext3" /proc/mounts; then - printf "storing to /config :\n" for p in "$@"; do local persist_it=true # ensure that, if this is a directory + # that it's not already persisted if [ -d $p ]; then if [ -d /config$p ]; then + printf "Directory already persisted: $p\n" + printf "You need to unpersist its child directories and/or files and try again.\n" + persist_it=false + fi + fi + + # if it's a file then make sure it's not already + # persisted + if [ -f $p ]; then + if [ -f /config$p ]; then + printf "File already persisted: $p\n" persist_it=false fi fi @@ -498,13 +509,12 @@ ovirt_store_config() { if ! grep -q "^$f$" /config/files 2> /dev/null ; then printf "$f\n" >> /config/files fi - else - printf "Could not persist $p: it contains an already persisted file.\n" + printf "\nSuccessfully persisted $f\n" fi done echo else - printf "warning: persistent config storage not available\n" + printf "WARNING: persistent config storage not available\n" rc=2 fi return $rc @@ -537,39 +547,50 @@ unmount_config() { # remove_config /etc/config /etc/config2 ... # remove_config() { + # if there are no persisted files then just exit + if [ ! -s /config/files ]; then + printf "There are currently no persisted files.\n" + exit 1 + fi + if grep -q " /config ext3" /proc/mounts; then for p in "$@"; do - f=$(readlink -f $p) - if grep -q " $f ext3" /proc/mounts ; then - if umount -n $f; then - if [ -d $f ]; then - cp -ar /config/$f/* $f - if [ $? -ne 0 ]; then - printf " Failed to unpersist ${f}\n" - exit 1 - else - printf " $f successfully unpersisted\n" - fi - else - if [ -f /config$f ]; then - # refresh the file in rootfs if it was mounted over - cp -a /config$f $f + grep "^${p}\$" /config/files > /dev/null 2>&1 + if [ $? -eq 0 ]; then + f=$(readlink -f $p) + if grep -q " $f ext3" /proc/mounts ; then + if umount -n $f; then + if [ -d $f ]; then + cp -ar /config/$f/* $f if [ $? -ne 0 ]; then - printf " Failed to unpersist %s\n" $f + printf " Failed to unpersist ${f}\n" $f exit 1 else - printf " %s successully unpersisted\n" $f + printf " $f successully unpersisted\n" $f + fi + else + if [ -f /config$f ]; then + # refresh the file in rootfs if it was mounted over + cp -a /config$f $f + if [ $? -ne 0 ]; then + printf " Failed to unpersist %s\n" $f + exit 1 + else + printf " %s successully unpersisted\n" $f + fi fi fi fi + else + printf "$f is not a persisted file.\n" fi + # clean up the persistent store + rm -Rf /config$f + # unregister in /config/files used by rc.sysinit + sed --copy -i "\|^$f$|d" /config/files else - printf " %s is not in persistent storage" $f + printf "File not explicitly persisted: $p\n" fi - # clean up the persistent store - rm -f /config$f - # unregister in /config/files used by rc.sysinit - sed --copy -i "\|^$f$|d" /config/files done fi } -- 1.6.6.1 From dpierce at redhat.com Tue Mar 23 15:48:44 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Mar 2010 11:48:44 -0400 Subject: [Ovirt-devel] [PATCH 3/4] ovirt_store_config must refresh persistent copy In-Reply-To: <1269359325-6700-3-git-send-email-dpierce@redhat.com> References: <1269359325-6700-1-git-send-email-dpierce@redhat.com> <1269359325-6700-2-git-send-email-dpierce@redhat.com> <1269359325-6700-3-git-send-email-dpierce@redhat.com> Message-ID: <1269359325-6700-4-git-send-email-dpierce@redhat.com> From: Alan Pevec Related: rhbz#576239 Signed-off-by: Darryl L. Pierce --- scripts/ovirt-functions | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index dfa53a8..cfcedbb 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -480,13 +480,21 @@ ovirt_store_config() { # persisted if [ -f $p ]; then if [ -f /config$p ]; then - printf "File already persisted: $p\n" - persist_it=false + local md5root=$(md5 $p) + local md5stored=$(md5 /config$p) + if [ "$md5root" = "$md5stored" ]; then + printf "File already persisted: $p\n" + persist_it=false + else + # persistent copy needs refresh + umount -n $p 2> /dev/null || : + rm -f /config$p + fi fi fi if $persist_it; then - f=$(readlink -f $p) + local f=$(readlink -f $p) printf "$f" # skip if file does not exist or is empty if [ ! -s "$f" ]; then -- 1.6.6.1 From dpierce at redhat.com Tue Mar 23 15:48:45 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Mar 2010 11:48:45 -0400 Subject: [Ovirt-devel] [PATCH 4/4] Added the ChangeLog entry for persistence fixes. In-Reply-To: <1269359325-6700-4-git-send-email-dpierce@redhat.com> References: <1269359325-6700-1-git-send-email-dpierce@redhat.com> <1269359325-6700-2-git-send-email-dpierce@redhat.com> <1269359325-6700-3-git-send-email-dpierce@redhat.com> <1269359325-6700-4-git-send-email-dpierce@redhat.com> Message-ID: <1269359325-6700-5-git-send-email-dpierce@redhat.com> Signed-off-by: Darryl L. Pierce --- ChangeLog | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index f5a70de..e33bfff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ Version 1.9.1: * Fixes to the SysVINit scripts to name lifecycle methods propery. * Added psmisc package. * Added default KEYTAB_FILE name to /etc/sysconfig/node-config. + * Fixes to the persist and unpersist commands to handle already persisted + files and directories. Version 1.9.0: * Created a reference implementation for a 2.0 management server. -- 1.6.6.1 From dpierce at redhat.com Tue Mar 23 18:35:45 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Mar 2010 14:35:45 -0400 Subject: [Ovirt-devel] [PATCH] Ensures that persist and unpersist work with relative paths. Message-ID: <1269369345-15585-1-git-send-email-dpierce@redhat.com> As they iterate through their list of arguments, both ovirt_storage_config and remove_config first convert each of them into a fully qualified path before processing. Related: rhbz#576239 Signed-off-by: Darryl L. Pierce --- scripts/ovirt-functions | 80 +++++++++++++++++++++++------------------------ 1 files changed, 39 insertions(+), 41 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index cfcedbb..c2ef94b 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -464,13 +464,14 @@ ovirt_store_config() { rc=0 if grep -q " /config ext3" /proc/mounts; then for p in "$@"; do + local filename=$(readlink -f $p) local persist_it=true # ensure that, if this is a directory # that it's not already persisted - if [ -d $p ]; then - if [ -d /config$p ]; then - printf "Directory already persisted: $p\n" + if [ -d $filename ]; then + if [ -d /config$filename ]; then + printf "Directory already persisted: ${filename}\n" printf "You need to unpersist its child directories and/or files and try again.\n" persist_it=false fi @@ -478,34 +479,32 @@ ovirt_store_config() { # if it's a file then make sure it's not already # persisted - if [ -f $p ]; then - if [ -f /config$p ]; then - local md5root=$(md5 $p) - local md5stored=$(md5 /config$p) + if [ -f $filename ]; then + if [ -f /config$filename ]; then + local md5root=$(md5 $filename) + local md5stored=$(md5 /config$filename) if [ "$md5root" = "$md5stored" ]; then - printf "File already persisted: $p\n" + printf "File already persisted: ${filename}\n" persist_it=false else # persistent copy needs refresh - umount -n $p 2> /dev/null || : - rm -f /config$p + umount -n $filename 2> /dev/null || : + rm -f /config$filename fi fi fi if $persist_it; then - local f=$(readlink -f $p) - printf "$f" # skip if file does not exist or is empty - if [ ! -s "$f" ]; then - printf " Skipping, file '%s' does not exist or is empty\n" $p + if [ ! -s "${filename}" ]; then + printf " Skipping, file '${filename}' does not exist or is empty\n" continue fi # skip if already bind-mounted - if ! grep -q " $f ext3" /proc/mounts ; then - mkdir -p /config$(dirname $f) - cp -a $f /config$f \ - && mount -n --bind /config$f $f + if ! grep -q " $filename ext3" /proc/mounts ; then + mkdir -p /config$(dirname $filename) + cp -a $filename /config$filename \ + && mount -n --bind /config$filename $filename if [ $? -ne 0 ]; then printf " Failed to persist\n" rc=1 @@ -514,10 +513,10 @@ ovirt_store_config() { fi fi # register in /config/files used by rc.sysinit - if ! grep -q "^$f$" /config/files 2> /dev/null ; then - printf "$f\n" >> /config/files + if ! grep -q "^${filename}$" /config/files 2> /dev/null ; then + printf "${filename}\n" >> /config/files fi - printf "\nSuccessfully persisted $f\n" + printf "\nSuccessfully persisted ${filename}\n" fi done echo @@ -563,41 +562,40 @@ remove_config() { if grep -q " /config ext3" /proc/mounts; then for p in "$@"; do - grep "^${p}\$" /config/files > /dev/null 2>&1 - if [ $? -eq 0 ]; then - f=$(readlink -f $p) - if grep -q " $f ext3" /proc/mounts ; then - if umount -n $f; then - if [ -d $f ]; then - cp -ar /config/$f/* $f + local filename=$(readlink -f $p) + if grep "^${filename}\$" /config/files > /dev/null 2>&1; then + if grep -q " $filename ext3" /proc/mounts ; then + if umount -n $filename; then + if [ -d $filename ]; then + cp -ar /config/$filename/* $filename if [ $? -ne 0 ]; then - printf " Failed to unpersist ${f}\n" $f + printf " Failed to unpersist ${filename}\n" exit 1 else - printf " $f successully unpersisted\n" $f + printf " ${filename} successully unpersisted\n" fi else - if [ -f /config$f ]; then - # refresh the file in rootfs if it was mounted over - cp -a /config$f $f + if [ -f /config$filename ]; then + # refresh the file in rootfs if it was mounted over + cp -a /config$filename $filename if [ $? -ne 0 ]; then - printf " Failed to unpersist %s\n" $f + printf " Failed to unpersist ${filename}\n" exit 1 else - printf " %s successully unpersisted\n" $f + printf " ${filename} successully unpersisted\n" fi fi fi fi + # clean up the persistent store + rm -Rf /config$filename + # unregister in /config/files used by rc.sysinit + sed --copy -i "\|^${filename}$|d" /config/files else - printf "$f is not a persisted file.\n" + printf "$filename is not a persisted file.\n" fi - # clean up the persistent store - rm -Rf /config$f - # unregister in /config/files used by rc.sysinit - sed --copy -i "\|^$f$|d" /config/files else - printf "File not explicitly persisted: $p\n" + printf "File not explicitly persisted: ${filename}\n" fi done fi -- 1.6.6.1 From mburns at redhat.com Tue Mar 23 19:05:22 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 15:05:22 -0400 Subject: [Ovirt-devel] [PATCH node] Fix copy of libreadline.so Message-ID: <1269371122-25831-1-git-send-email-mburns@redhat.com> Version increased from .so.5 to .so.6. Changing copy of libreadline libncurses to .so.? instead Signed-off-by: Mike Burns --- scripts/ovirt-config-boot | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index d13dad2..a04b40d 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -182,7 +182,7 @@ set -e\ else cp /sbin/lvm bin # lvm is not static in Fedora - cp /lib$bit/libreadline.so.5 /lib$bit/libncurses.so.5 lib$bit + cp /lib$bit/libreadline.so.? /lib$bit/libncurses.so.? lib$bit fi find $init_script bin/lvm lib$bit -type f | -- 1.6.6.1 From mburns at redhat.com Tue Mar 23 19:39:15 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 15:39:15 -0400 Subject: [Ovirt-devel] [PATCH node][RFC] Fix uninstall to detect and cleanup correct partitions Message-ID: <1269373155-26728-1-git-send-email-mburns@redhat.com> Previous implementation had staticly defined partitions to remove. This would break in the case of split Root and HostVG devices. Signed-off-by: Mike Burns --- scripts/ovirt-config-boot | 11 +-------- scripts/ovirt-config-uninstall | 49 ++++++++++++++++++++++++--------------- scripts/ovirt-functions | 27 ++++++++++++++++++++++ 3 files changed, 58 insertions(+), 29 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index d13dad2..bb46f49 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -50,12 +50,7 @@ ovirt_boot_setup() { fi # check that /boot mounted ok and find partition number for GRUB - eval $(readlink -f /dev/disk/by-label/$grub_dev_label|awk {' - print "disk=" substr($1,1,length($1)-1); - print "disk2=" substr($1,1,length($1)-2); - partN=substr($1,length($1),1); partN--; - print "partN=" partN; - }') + get_part_info $(readlink -f /dev/disk/by-label/$grub_dev_label disk partN rc=$? if [ $rc -ne 0 -o $partN -lt 0 ]; then log "unable to determine Root partition" @@ -70,10 +65,6 @@ ovirt_boot_setup() { return 1 fi - if [ ! -e "$disk" ]; then - # e.g. c0d0p1 - disk="$disk2" - fi # prepare Root partition update candidate= if [ -e /dev/disk/by-label/RootBackup ]; then diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall index 3b7b48d..b319abd 100755 --- a/scripts/ovirt-config-uninstall +++ b/scripts/ovirt-config-uninstall @@ -37,27 +37,38 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" rm -f /var/lib/multipath/bindings unmount_logging unmount_config /etc/default/ovirt + #get partition info + local root2 + if findfs LABEL=RootBackup 2>&1 >/dev/null; then + root2=RootBackup + elif findfs LABEL=RootUpdate 2>&1 >/dev/null; then + root2=RootUpdate + elif findfs LABEL=RootNew 2>&1 >/dev/null; then + root2=RootNew + fi + local root_dev root_part pv_dev pv_part root2_dev root2_part + if ! get_part_info $(findfs LABEL=Root 2>/dev/null) root_dev root_part; then + log "Can't find Root device" + exit 2 + fi + if ! get_part_info $(findfs LABEL=root2 2>/dev/null) root2_dev root2_part; then + log "Can't find RootBackup/RootNew/RootUpdate device" + exit 3 + fi + if ! get_part_info $(pvs --noheadings -o pv_name,vg_name | grep HostVG | awk '{print $1}') pv_dev pv_part; then + log "Can't find HostVG device" + exit 4 + fi log "Removing volume group" wipe_volume_group "HostVG" - partition=$(readlink -f $(findfs LABEL=Root)) - if [ -n "$partition" ]; then - log "Removing partitions" - eval $(echo $partition | awk ' { - print "drive=" substr($0,1,length($1)-1); - print "drive2=" substr($0,1,length($1)-2); - }') - if [ ! -e "$drive" ]; then - drive="$drive2" - partpv="$drive}p2" - else - partpv="${drive}2" - fi - parted -s $drive "rm 1" - pvremove ${partpv} - parted -s $drive "rm 2" - parted -s $drive "rm 3" - wipe_partitions $drive - fi + log "Removing partitions" + parted -s $root_dev "rm $root_part" + pvremove ${vg_dev} + parted -s $root2_dev "rm $root2_part" + parted -s $vg_dev "rm $vg_part" + wipe_partitions $pv_dev + wipe_partitions $root_dev + wipe_partitions $root2_dev #restart multipath multipath -F multipath -v3 diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index c2ef94b..0c30890 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -851,6 +851,33 @@ get_dm_device () return $rc } +#Function to determine partition and device names +get_part_info() { + local drive_in=$1 + local dev_var=$2 + local part_var=$3 + local devname_1 devname2 part_number + local rc=0 + + eval $(readlink -f /dev/disk/by-label/$grub_dev_label|awk {' + print "devname_1=" substr($1,1,length($1)-1); + print "devname_2=" substr($1,1,length($1)-2); + part_number=substr($1,length($1),1); partN--; + print "part_number=" part_number; + }') + rc=$? + + if [ -e ${devname_1} ]; then + eval "${dev_var}"="${devname_1}" + elif [ -e ${devname_2 ]; then + eval "${dev_var}"="${devname_2}" + else + return 1 + fi + eval "${part_var}"="${part_number}" + return $rc +} + # execute a function if called as a script, e.g. # ovirt-functions ovirt_store_config /etc/hosts -- 1.6.6.1 From jboggs at redhat.com Tue Mar 23 19:44:52 2010 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 23 Mar 2010 15:44:52 -0400 Subject: [Ovirt-devel] [PATCH node] validate hostname in ovirt-config-hostname Message-ID: <1269373492-26293-1-git-send-email-jboggs@redhat.com> --- scripts/ovirt-config-hostname | 24 ++++++++++++++++++++---- 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname index 00d4214..0a86884 100755 --- a/scripts/ovirt-config-hostname +++ b/scripts/ovirt-config-hostname @@ -42,16 +42,31 @@ EOF return $rc } +is_valid_hostname () { + local host=${1} + local result=1 + if [[ $host =~ "^([a-zA-Z0-9._-]+)$" ]]; then + result=$? + fi + return $result +} + function prompt_user { + rc=0 + while true; do printf "\n" read -p "What is the hostname for this node? " if [ -n "$REPLY" ]; then + if ! is_valid_hostname "$REPLY"; then + printf "\nInvalid Hostname\n" + continue + fi if set_hostname $REPLY; then printf "\nHostname has been set\n" else printf "\nSetting hostname failed\n" - return 1 + rc=1 fi else printf "\n" @@ -60,18 +75,19 @@ function prompt_user { 0) if remove_hostname; then printf "\nHostname was removed.\n" - return 0 else printf "\nRemoving hostname failed\n" - return 1 + rc=1 fi ;; 1) printf "\nNo changes made.\n" - return 0 ;; esac fi + break + done + return $rc } # AUTO for auto-install -- 1.6.6.1 From mburns at redhat.com Tue Mar 23 19:47:54 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 15:47:54 -0400 Subject: [Ovirt-devel] [PATCH] Remove initrd patching from oc-boot Message-ID: <1269373674-27078-1-git-send-email-mburns@redhat.com> Dracut includes what was being patched in Signed-off-by: Mike Burns --- scripts/ovirt-config-boot | 47 --------------------------------------------- 1 files changed, 0 insertions(+), 47 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index d13dad2..28d1572 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -143,53 +143,6 @@ ovirt_boot_setup() { fi fi - # append LVM support to the livecd initramfs - tmpdir=$(mktemp -d) - cd $tmpdir - gzip -dc $live/$syslinux/initrd0.img | - cpio -id init sbin/real-init - init_script=init - if [ -e sbin/real-init ]; then - # Fedora 10 mkliveinitrd - init_script=sbin/real-init - fi - sed -i '/^\/sbin\/udev.*trigger/ a \ -echo SCSI wait for scans\ -/sbin/modprobe scsi_wait_scan\ -/sbin/modprobe -r scsi_wait_scan\ -set +e\ -while true; do\ - echo Scanning logical volumes\ - lvm vgscan --ignorelockingfailure\ - echo Activating logical volumes\ - if lvm vgchange -ay --ignorelockingfailure HostVG; then\ - break\ - fi\ - sleep 1\ -done\ -set -e\ -' $init_script - # fix emergency shell - sed -i 's/^ bash$/ bash < \/dev\/console/' $init_script - mkdir -p bin - bit= - if [ -e /lib64 ]; then - bit=64 - fi - mkdir -p lib$bit - if [ -e /sbin/lvm.static ]; then - cp /sbin/lvm.static bin/lvm - else - cp /sbin/lvm bin - # lvm is not static in Fedora - cp /lib$bit/libreadline.so.5 /lib$bit/libncurses.so.5 lib$bit - fi - - find $init_script bin/lvm lib$bit -type f | - cpio -H newc --quiet -o | - gzip -9 | - cat $live/$syslinux/initrd0.img - > $initrd_dest/initrd0.img - version=$(rpm -q --qf '%{version}' ovirt-node) release=$(rpm -q --qf '%{release}' ovirt-node) # reorder tty0 to allow both serial and phys console after installation -- 1.6.6.1 From mburns at redhat.com Tue Mar 23 19:54:12 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 15:54:12 -0400 Subject: [Ovirt-devel] [PATCH node] Fix copy of libreadline.so In-Reply-To: <1269371122-25831-1-git-send-email-mburns@redhat.com> References: <1269371122-25831-1-git-send-email-mburns@redhat.com> Message-ID: <1269374052.6519.1.camel@localhost.localdomain> On Tue, 2010-03-23 at 15:05 -0400, Mike Burns wrote: > Version increased from .so.5 to .so.6. Changing copy of libreadline > libncurses to .so.? instead > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-boot | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > index d13dad2..a04b40d 100755 > --- a/scripts/ovirt-config-boot > +++ b/scripts/ovirt-config-boot > @@ -182,7 +182,7 @@ set -e\ > else > cp /sbin/lvm bin > # lvm is not static in Fedora > - cp /lib$bit/libreadline.so.5 /lib$bit/libncurses.so.5 lib$bit > + cp /lib$bit/libreadline.so.? /lib$bit/libncurses.so.? lib$bit > fi > > find $init_script bin/lvm lib$bit -type f | This patch is being dropped. It is superseded by the remove initrd patching patch. Mike From mburns at redhat.com Tue Mar 23 20:05:06 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 16:05:06 -0400 Subject: [Ovirt-devel] [PATCH] Remove initrd patching from oc-boot In-Reply-To: <1269373674-27078-1-git-send-email-mburns@redhat.com> References: <1269373674-27078-1-git-send-email-mburns@redhat.com> Message-ID: <1269374706.6519.2.camel@localhost.localdomain> On Tue, 2010-03-23 at 15:47 -0400, Mike Burns wrote: > Dracut includes what was being patched in Sorry didn't finish writing this commit message. With dracut, patching of initrd is not needed. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-boot | 47 --------------------------------------------- > 1 files changed, 0 insertions(+), 47 deletions(-) > > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > index d13dad2..28d1572 100755 > --- a/scripts/ovirt-config-boot > +++ b/scripts/ovirt-config-boot > @@ -143,53 +143,6 @@ ovirt_boot_setup() { > fi > fi > > - # append LVM support to the livecd initramfs > - tmpdir=$(mktemp -d) > - cd $tmpdir > - gzip -dc $live/$syslinux/initrd0.img | > - cpio -id init sbin/real-init > - init_script=init > - if [ -e sbin/real-init ]; then > - # Fedora 10 mkliveinitrd > - init_script=sbin/real-init > - fi > - sed -i '/^\/sbin\/udev.*trigger/ a \ > -echo SCSI wait for scans\ > -/sbin/modprobe scsi_wait_scan\ > -/sbin/modprobe -r scsi_wait_scan\ > -set +e\ > -while true; do\ > - echo Scanning logical volumes\ > - lvm vgscan --ignorelockingfailure\ > - echo Activating logical volumes\ > - if lvm vgchange -ay --ignorelockingfailure HostVG; then\ > - break\ > - fi\ > - sleep 1\ > -done\ > -set -e\ > -' $init_script > - # fix emergency shell > - sed -i 's/^ bash$/ bash < \/dev\/console/' $init_script > - mkdir -p bin > - bit= > - if [ -e /lib64 ]; then > - bit=64 > - fi > - mkdir -p lib$bit > - if [ -e /sbin/lvm.static ]; then > - cp /sbin/lvm.static bin/lvm > - else > - cp /sbin/lvm bin > - # lvm is not static in Fedora > - cp /lib$bit/libreadline.so.5 /lib$bit/libncurses.so.5 lib$bit > - fi > - > - find $init_script bin/lvm lib$bit -type f | > - cpio -H newc --quiet -o | > - gzip -9 | > - cat $live/$syslinux/initrd0.img - > $initrd_dest/initrd0.img > - > version=$(rpm -q --qf '%{version}' ovirt-node) > release=$(rpm -q --qf '%{release}' ovirt-node) > # reorder tty0 to allow both serial and phys console after installation From jboggs at redhat.com Tue Mar 23 20:20:06 2010 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 23 Mar 2010 16:20:06 -0400 Subject: [Ovirt-devel] [PATCH node] RESEND: validate hostname in ovirt-config-hostname Message-ID: <1269375606-28935-1-git-send-email-jboggs@redhat.com> --- scripts/ovirt-config-hostname | 24 ++++++++++++++++++++---- 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname index 00d4214..0a86884 100755 --- a/scripts/ovirt-config-hostname +++ b/scripts/ovirt-config-hostname @@ -42,16 +42,31 @@ EOF return $rc } +is_valid_hostname () { + local host=${1} + local result=1 + if [[ $host =~ "^([a-zA-Z0-9._-]+)$" ]]; then + result=$? + fi + return $result +} + function prompt_user { + rc=0 + while true; do printf "\n" read -p "What is the hostname for this node? " if [ -n "$REPLY" ]; then + if ! is_valid_hostname "$REPLY"; then + printf "\nInvalid Hostname\n" + continue + fi if set_hostname $REPLY; then printf "\nHostname has been set\n" else printf "\nSetting hostname failed\n" - return 1 + rc=1 fi else printf "\n" @@ -60,18 +75,19 @@ function prompt_user { 0) if remove_hostname; then printf "\nHostname was removed.\n" - return 0 else printf "\nRemoving hostname failed\n" - return 1 + rc=1 fi ;; 1) printf "\nNo changes made.\n" - return 0 ;; esac fi + break + done + return $rc } # AUTO for auto-install -- 1.6.6.1 From jboggs at redhat.com Tue Mar 23 20:23:02 2010 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 23 Mar 2010 16:23:02 -0400 Subject: [Ovirt-devel] [PATCH node] RESEND: validate hostname in ovirt-config-hostname Message-ID: <1269375782-29241-1-git-send-email-jboggs@redhat.com> double quote all $REPLY variables --- scripts/ovirt-config-hostname | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname index 00d4214..f14f36e 100755 --- a/scripts/ovirt-config-hostname +++ b/scripts/ovirt-config-hostname @@ -42,16 +42,31 @@ EOF return $rc } +is_valid_hostname () { + local host=${1} + local result=1 + if [[ $host =~ "^([a-zA-Z0-9._-]+)$" ]]; then + result=$? + fi + return $result +} + function prompt_user { + rc=0 + while true; do printf "\n" read -p "What is the hostname for this node? " if [ -n "$REPLY" ]; then - if set_hostname $REPLY; then + if ! is_valid_hostname "$REPLY"; then + printf "\nInvalid Hostname\n" + continue + fi + if set_hostname "$REPLY"; then printf "\nHostname has been set\n" else printf "\nSetting hostname failed\n" - return 1 + rc=1 fi else printf "\n" @@ -60,18 +75,19 @@ function prompt_user { 0) if remove_hostname; then printf "\nHostname was removed.\n" - return 0 else printf "\nRemoving hostname failed\n" - return 1 + rc=1 fi ;; 1) printf "\nNo changes made.\n" - return 0 ;; esac fi + break + done + return $rc } # AUTO for auto-install -- 1.6.6.1 From mburns at redhat.com Tue Mar 23 21:15:11 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 17:15:11 -0400 Subject: [Ovirt-devel] [PATCH node][RFC] Fix uninstall to detect and cleanup correct partitions In-Reply-To: <1269373155-26728-1-git-send-email-mburns@redhat.com> References: <1269373155-26728-1-git-send-email-mburns@redhat.com> Message-ID: <1269378911.6519.4.camel@localhost.localdomain> For anyone testing this, there is a typo: diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index c2ef94b..0c30890 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -851,6 +851,33 @@ get_dm_device () > return $rc > } > > +#Function to determine partition and device names > +get_part_info() { > + local drive_in=$1 > + local dev_var=$2 > + local part_var=$3 > + local devname_1 devname2 part_number > + local rc=0 > + > + eval $(readlink -f /dev/disk/by-label/$grub_dev_label|awk {' > + print "devname_1=" substr($1,1,length($1)-1); > + print "devname_2=" substr($1,1,length($1)-2); > + part_number=substr($1,length($1),1); partN--; > + print "part_number=" part_number; > + }') > + rc=$? > + > + if [ -e ${devname_1} ]; then > + eval "${dev_var}"="${devname_1}" > + elif [ -e ${devname_2 ]; then + elif [ -e ${devname_2} ]; then #<-- missing } > + eval "${dev_var}"="${devname_2}" > + else > + return 1 > + fi > + eval "${part_var}"="${part_number}" > + return $rc > +} > + > # execute a function if called as a script, e.g. > # ovirt-functions ovirt_store_config /etc/hosts > From mburns at redhat.com Tue Mar 23 22:50:53 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 18:50:53 -0400 Subject: [Ovirt-devel] [PATCH node][RFC] Fix uninstall to detect and cleanup correct partitions In-Reply-To: <1269378911.6519.4.camel@localhost.localdomain> References: <1269373155-26728-1-git-send-email-mburns@redhat.com> <1269378911.6519.4.camel@localhost.localdomain> Message-ID: <1269384653.6519.5.camel@localhost.localdomain> After starting testing, I found a number of other small issues with this. The overall structure is the same, but a new patch is coming shortly that should clean up the small issues. Mike On Tue, 2010-03-23 at 17:15 -0400, Mike Burns wrote: > For anyone testing this, there is a typo: > > > > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > > index c2ef94b..0c30890 100644 > > --- a/scripts/ovirt-functions > > +++ b/scripts/ovirt-functions > > @@ -851,6 +851,33 @@ get_dm_device () > > return $rc > > } > > > > +#Function to determine partition and device names > > +get_part_info() { > > + local drive_in=$1 > > + local dev_var=$2 > > + local part_var=$3 > > + local devname_1 devname2 part_number > > + local rc=0 > > + > > + eval $(readlink -f /dev/disk/by-label/$grub_dev_label|awk {' > > + print "devname_1=" substr($1,1,length($1)-1); > > + print "devname_2=" substr($1,1,length($1)-2); > > + part_number=substr($1,length($1),1); partN--; > > + print "part_number=" part_number; > > + }') > > + rc=$? > > + > > + if [ -e ${devname_1} ]; then > > + eval "${dev_var}"="${devname_1}" > > + elif [ -e ${devname_2 ]; then > + elif [ -e ${devname_2} ]; then #<-- missing } > > + eval "${dev_var}"="${devname_2}" > > + else > > + return 1 > > + fi > > + eval "${part_var}"="${part_number}" > > + return $rc > > +} > > + > > # execute a function if called as a script, e.g. > > # ovirt-functions ovirt_store_config /etc/hosts > > > > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel From mburns at redhat.com Tue Mar 23 22:51:42 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 18:51:42 -0400 Subject: [Ovirt-devel] [PATCH node] Fix uninstall to detect and cleanup correct partitions Message-ID: <1269384702-3878-1-git-send-email-mburns@redhat.com> Previous implementation had staticly defined partitions to remove. This would break in the case of split Root and HostVG devices. Signed-off-by: Mike Burns --- scripts/ovirt-config-boot | 11 +-------- scripts/ovirt-config-uninstall | 48 ++++++++++++++++++++++++--------------- scripts/ovirt-functions | 33 +++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 29 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index 28d1572..ac43daa 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -50,12 +50,7 @@ ovirt_boot_setup() { fi # check that /boot mounted ok and find partition number for GRUB - eval $(readlink -f /dev/disk/by-label/$grub_dev_label|awk {' - print "disk=" substr($1,1,length($1)-1); - print "disk2=" substr($1,1,length($1)-2); - partN=substr($1,length($1),1); partN--; - print "partN=" partN; - }') + get_part_info $(readlink -f /dev/disk/by-label/$grub_dev_label disk partN rc=$? if [ $rc -ne 0 -o $partN -lt 0 ]; then log "unable to determine Root partition" @@ -70,10 +65,6 @@ ovirt_boot_setup() { return 1 fi - if [ ! -e "$disk" ]; then - # e.g. c0d0p1 - disk="$disk2" - fi # prepare Root partition update candidate= if [ -e /dev/disk/by-label/RootBackup ]; then diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall index 3b7b48d..b6675e7 100755 --- a/scripts/ovirt-config-uninstall +++ b/scripts/ovirt-config-uninstall @@ -37,27 +37,37 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" rm -f /var/lib/multipath/bindings unmount_logging unmount_config /etc/default/ovirt + #get partition info + root2="" + if findfs LABEL=RootBackup 2>&1 >/dev/null; then + root2=RootBackup + elif findfs LABEL=RootUpdate 2>&1 >/dev/null; then + root2=RootUpdate + elif findfs LABEL=RootNew 2>&1 >/dev/null; then + root2=RootNew + fi + if ! get_part_info $(findfs LABEL=Root 2>/dev/null) root_dev root_part; then + log "Can't find Root device" + exit 2 + fi + if ! get_part_info $(findfs LABEL=${root2} 2>/dev/null) root2_dev root2_part; then + log "Can't find RootBackup/RootNew/RootUpdate device" + exit 3 + fi + if ! get_part_info $(pvs --noheadings -o pv_name,vg_name | grep HostVG | awk '{print $1}') pv_dev pv_part; then + log "Can't find HostVG device" + exit 4 + fi log "Removing volume group" wipe_volume_group "HostVG" - partition=$(readlink -f $(findfs LABEL=Root)) - if [ -n "$partition" ]; then - log "Removing partitions" - eval $(echo $partition | awk ' { - print "drive=" substr($0,1,length($1)-1); - print "drive2=" substr($0,1,length($1)-2); - }') - if [ ! -e "$drive" ]; then - drive="$drive2" - partpv="$drive}p2" - else - partpv="${drive}2" - fi - parted -s $drive "rm 1" - pvremove ${partpv} - parted -s $drive "rm 2" - parted -s $drive "rm 3" - wipe_partitions $drive - fi + log "Removing partitions" + parted -s $root_dev "rm $root_part" + pvremove ${vg_dev} + parted -s $root2_dev "rm $root2_part" + parted -s $vg_dev "rm $vg_part" + wipe_partitions $pv_dev + wipe_partitions $root_dev + wipe_partitions $root2_dev #restart multipath multipath -F multipath -v3 diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index c2ef94b..b98e31a 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -851,6 +851,39 @@ get_dm_device () return $rc } +#Function to determine partition and device names +get_part_info() { + local drive_in=$1 + local dev_var=$2 + local part_var=$3 + local devname_1 devname2 part_number + local rc=0 + + eval $(readlink -f $drive_in|awk {' + print "devname_1=" substr($1,1,length($1)-1); + print "devname_2=" substr($1,1,length($1)-2); + part_number=substr($1,length($1),1); + print "part_number=" part_number; + }') + rc=$? + + if [[ "part_number" -lt 1 ]]; then + log "Partition number was invalid" + return 2 + fi + + + if [ -e ${devname_1} ]; then + eval "${dev_var}"="${devname_1}" + elif [ -e ${devname_2} ]; then + eval "${dev_var}"="${devname_2}" + else + return 1 + fi + eval "${part_var}"="${part_number}" + return $rc +} + # execute a function if called as a script, e.g. # ovirt-functions ovirt_store_config /etc/hosts -- 1.6.6.1 From mburns at redhat.com Tue Mar 23 23:00:16 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 19:00:16 -0400 Subject: [Ovirt-devel] [PATCH node][RFC] Remove dependencies on /dev/disk/by-label entries Message-ID: <1269385216-4356-1-git-send-email-mburns@redhat.com> Use findfs LABEL=ABC and mount LABEL=ABC instead. Signed-off-by: Mike Burns --- scripts/ovirt-config-boot | 29 ++++++++++++++++------------- scripts/ovirt-config-storage | 2 -- scripts/ovirt-functions | 18 ++++++++++-------- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index ac43daa..b1fd469 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -29,14 +29,21 @@ ovirt_boot_setup() { local disk2 local partN=-1 log "installing the image." - if [ -h /dev/disk/by-label/Boot ]; then + local found_boot=false + if findfs LABEL=Boot 2>&1 >/dev/null ; then + found_boot=true + grub_dev_label=Boot + elif findfs LABEL=Root 2>&1 >/dev/null ; then + found_boot=true + grub_dev_label=Root + fi + if $found_boot; then mount_boot mountpoint /boot if [ $? -ne 0 ] ; then log "Boot partition not available" return 1 fi - grub_dev_label="Boot" # Grab OVIRT_ISCSI VARIABLES from boot partition for upgrading # file created only if OVIRT_ISCSI_ENABLED=y if [ -f /boot/ovirt ]; then @@ -50,7 +57,7 @@ ovirt_boot_setup() { fi # check that /boot mounted ok and find partition number for GRUB - get_part_info $(readlink -f /dev/disk/by-label/$grub_dev_label disk partN + get_part_info $(readlink -f $(findfs LABEL=$grub_dev_label 2>/dev/null) disk partN rc=$? if [ $rc -ne 0 -o $partN -lt 0 ]; then log "unable to determine Root partition" @@ -67,11 +74,11 @@ ovirt_boot_setup() { # prepare Root partition update candidate= - if [ -e /dev/disk/by-label/RootBackup ]; then + if findfs LABEL=RootBackup 2>&1 >/dev/null; then candidate=RootBackup - elif [ -e /dev/disk/by-label/RootUpdate ]; then + elif findfs LABEL=RootUpdate 2>&1 >/dev/null; then candidate=RootUpdate - elif [ -e /dev/disk/by-label/RootNew ]; then + elif findfs LABEL=RootNew 2>&1 >/dev/null; then candidate=RootNew fi if [ -z "$candidate" ]; then @@ -80,7 +87,7 @@ ovirt_boot_setup() { umount /liveos rc=0 else - candidate_dev=$(readlink -f /dev/disk/by-label/$candidate) + candidate_dev=$(findfs LABEL=$candidate 2>/dev/null) e2label $candidate_dev RootNew rc=$? fi @@ -90,7 +97,7 @@ ovirt_boot_setup() { return $rc fi - mount $candidate_dev /liveos + mount $candidate_dev /liveos/ rm -rf /liveos/LiveOS mkdir -p /liveos/LiveOS @@ -212,11 +219,7 @@ if [ $rc -eq 0 -a "$doreboot" = "yes" ]; then ovirt_store_firstboot_config stop_log - if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then - reboot - else - /sbin/reboot - fi + reboot fi stop_log exit $rc diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index c6473a6..93b94b0 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -703,8 +703,6 @@ perform_partitioning() log "Creating volume group" vgcreate /dev/HostVG "${partpv}" - mkdir -p /dev/disk/by-label - if [ "$SWAP_SIZE" -gt 0 ]; then log "Creating swap partition" lvcreate --name Swap --size ${SWAP_SIZE}M /dev/HostVG diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index b98e31a..482441a 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -283,7 +283,7 @@ mount_liveos() { return 0 fi mkdir -p /liveos - mount /dev/disk/by-label/Root /liveos + mount LABEL=Root /liveos } # mount config partition @@ -326,7 +326,7 @@ mount_boot() { return 0 fi mkdir -p /boot - mount /dev/disk/by-label/Boot /boot + mount LABEL=Root /boot } # stop any service which keeps /var/log busy # keep the list of services @@ -709,12 +709,14 @@ lvremove() { # cleanup before reboot reboot() { cd / - # setup new Root if update is prepared - if [ -e "/dev/disk/by-label/RootUpdate" ]; then - root_update_dev=$(readlink -f /dev/disk/by-label/RootUpdate) - root_dev=$(readlink -f /dev/disk/by-label/Root) - e2label $root_dev RootBackup - e2label $root_update_dev Root + if [ "$OVIRT_ISCSI_ENABLED" = "yes" ]; then + # setup new Root if update is prepared + if findfs LABEL=RootUpdate 2>&1 >/dev/null; then + root_update_dev=$(findfs LABEL=RootUpdate 2>/dev/null) + root_dev=$(findfs LABEL=Root 2>/dev/null) + e2label $root_dev RootBackup + e2label $root_update_dev Root + fi fi # run post-install hooks # e.g. to avoid reboot loops using Cobbler PXE only once -- 1.6.6.1 From mburns at redhat.com Tue Mar 23 23:04:13 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 23 Mar 2010 19:04:13 -0400 Subject: [Ovirt-devel] [PATCH node][RFC] Remove dependencies on /dev/disk/by-label entries In-Reply-To: <1269385216-4356-1-git-send-email-mburns@redhat.com> References: <1269385216-4356-1-git-send-email-mburns@redhat.com> Message-ID: <1269385453.6519.7.camel@localhost.localdomain> This depends on the previous patch for uninstall fixes. There is a known issue with these that we aren't able to unmount the Logging volume. I hope to have this debugged and fixed soon. On Tue, 2010-03-23 at 19:00 -0400, Mike Burns wrote: > Use findfs LABEL=ABC and mount LABEL=ABC instead. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-boot | 29 ++++++++++++++++------------- > scripts/ovirt-config-storage | 2 -- > scripts/ovirt-functions | 18 ++++++++++-------- > 3 files changed, 26 insertions(+), 23 deletions(-) > > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > index ac43daa..b1fd469 100755 > --- a/scripts/ovirt-config-boot > +++ b/scripts/ovirt-config-boot > @@ -29,14 +29,21 @@ ovirt_boot_setup() { > local disk2 > local partN=-1 > log "installing the image." > - if [ -h /dev/disk/by-label/Boot ]; then > + local found_boot=false > + if findfs LABEL=Boot 2>&1 >/dev/null ; then > + found_boot=true > + grub_dev_label=Boot > + elif findfs LABEL=Root 2>&1 >/dev/null ; then > + found_boot=true > + grub_dev_label=Root > + fi > + if $found_boot; then > mount_boot > mountpoint /boot > if [ $? -ne 0 ] ; then > log "Boot partition not available" > return 1 > fi > - grub_dev_label="Boot" > # Grab OVIRT_ISCSI VARIABLES from boot partition for upgrading > # file created only if OVIRT_ISCSI_ENABLED=y > if [ -f /boot/ovirt ]; then > @@ -50,7 +57,7 @@ ovirt_boot_setup() { > fi > > # check that /boot mounted ok and find partition number for GRUB > - get_part_info $(readlink -f /dev/disk/by-label/$grub_dev_label disk partN > + get_part_info $(readlink -f $(findfs LABEL=$grub_dev_label 2>/dev/null) disk partN > rc=$? > if [ $rc -ne 0 -o $partN -lt 0 ]; then > log "unable to determine Root partition" > @@ -67,11 +74,11 @@ ovirt_boot_setup() { > > # prepare Root partition update > candidate= > - if [ -e /dev/disk/by-label/RootBackup ]; then > + if findfs LABEL=RootBackup 2>&1 >/dev/null; then > candidate=RootBackup > - elif [ -e /dev/disk/by-label/RootUpdate ]; then > + elif findfs LABEL=RootUpdate 2>&1 >/dev/null; then > candidate=RootUpdate > - elif [ -e /dev/disk/by-label/RootNew ]; then > + elif findfs LABEL=RootNew 2>&1 >/dev/null; then > candidate=RootNew > fi > if [ -z "$candidate" ]; then > @@ -80,7 +87,7 @@ ovirt_boot_setup() { > umount /liveos > rc=0 > else > - candidate_dev=$(readlink -f /dev/disk/by-label/$candidate) > + candidate_dev=$(findfs LABEL=$candidate 2>/dev/null) > e2label $candidate_dev RootNew > rc=$? > fi > @@ -90,7 +97,7 @@ ovirt_boot_setup() { > return $rc > fi > > - mount $candidate_dev /liveos > + mount $candidate_dev /liveos/ > > rm -rf /liveos/LiveOS > mkdir -p /liveos/LiveOS > @@ -212,11 +219,7 @@ if [ $rc -eq 0 -a "$doreboot" = "yes" ]; then > ovirt_store_firstboot_config > stop_log > > - if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then > - reboot > - else > - /sbin/reboot > - fi > + reboot > fi > stop_log > exit $rc > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index c6473a6..93b94b0 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -703,8 +703,6 @@ perform_partitioning() > log "Creating volume group" > vgcreate /dev/HostVG "${partpv}" > > - mkdir -p /dev/disk/by-label > - > if [ "$SWAP_SIZE" -gt 0 ]; then > log "Creating swap partition" > lvcreate --name Swap --size ${SWAP_SIZE}M /dev/HostVG > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index b98e31a..482441a 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -283,7 +283,7 @@ mount_liveos() { > return 0 > fi > mkdir -p /liveos > - mount /dev/disk/by-label/Root /liveos > + mount LABEL=Root /liveos > } > > # mount config partition > @@ -326,7 +326,7 @@ mount_boot() { > return 0 > fi > mkdir -p /boot > - mount /dev/disk/by-label/Boot /boot > + mount LABEL=Root /boot > } > # stop any service which keeps /var/log busy > # keep the list of services > @@ -709,12 +709,14 @@ lvremove() { > # cleanup before reboot > reboot() { > cd / > - # setup new Root if update is prepared > - if [ -e "/dev/disk/by-label/RootUpdate" ]; then > - root_update_dev=$(readlink -f /dev/disk/by-label/RootUpdate) > - root_dev=$(readlink -f /dev/disk/by-label/Root) > - e2label $root_dev RootBackup > - e2label $root_update_dev Root > + if [ "$OVIRT_ISCSI_ENABLED" = "yes" ]; then > + # setup new Root if update is prepared > + if findfs LABEL=RootUpdate 2>&1 >/dev/null; then > + root_update_dev=$(findfs LABEL=RootUpdate 2>/dev/null) > + root_dev=$(findfs LABEL=Root 2>/dev/null) > + e2label $root_dev RootBackup > + e2label $root_update_dev Root > + fi > fi > # run post-install hooks > # e.g. to avoid reboot loops using Cobbler PXE only once From jcclouduser at gmail.com Wed Mar 24 02:12:15 2010 From: jcclouduser at gmail.com (clouduser s) Date: Wed, 24 Mar 2010 07:42:15 +0530 Subject: [Ovirt-devel] Need your information Message-ID: Before starting with Ovirt, i would like to discuss for the following queries, 1) Ovirt will support all OS ? 2) Can i integrate Ovirt with my java applications ? 3) I am looking for the open source tool that which i can integrate with my java applications and manage cloud infrasturcture. 4) Managing the coloud infrastructure such as create image, deploy the image to cloud host provider ? 5) Using Ovirt can i deploy the image to EC2, private eucalyptus, rackspace ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mburns at redhat.com Wed Mar 24 11:45:33 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 07:45:33 -0400 Subject: [Ovirt-devel] [PATCH 1/4] Fixed unpersisting directories and persisting directories that contain persisted files. In-Reply-To: <1269359325-6700-2-git-send-email-dpierce@redhat.com> References: <1269359325-6700-1-git-send-email-dpierce@redhat.com> <1269359325-6700-2-git-send-email-dpierce@redhat.com> Message-ID: <1269431133.6519.8.camel@localhost.localdomain> On Tue, 2010-03-23 at 11:48 -0400, Darryl L. Pierce wrote: > Resolves: rhbz#556616 > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt-functions | 107 ++++++++++++++++++++++++++++++---------------- > 1 files changed, 70 insertions(+), 37 deletions(-) > ACK From mburns at redhat.com Wed Mar 24 11:45:46 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 07:45:46 -0400 Subject: [Ovirt-devel] [PATCH 2/4] Fixes persisting a persisted file, or unpersisting a non-persisted file. In-Reply-To: <1269359325-6700-3-git-send-email-dpierce@redhat.com> References: <1269359325-6700-1-git-send-email-dpierce@redhat.com> <1269359325-6700-2-git-send-email-dpierce@redhat.com> <1269359325-6700-3-git-send-email-dpierce@redhat.com> Message-ID: <1269431146.6519.9.camel@localhost.localdomain> On Tue, 2010-03-23 at 11:48 -0400, Darryl L. Pierce wrote: > Previously the ovirt_store_config function only checked if a directory > was already persisted. This patch adds in checking if a targeted file > is already persisted as well. If so, then it fails with an error message. > > When the user tries to unpersist a file that was not explicitly persisted > before (it's not listed in /config/files) then the user is told the file > was not persisted previously, and the command exits. > > Resolves: rhbz#576329 > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt-functions | 75 ++++++++++++++++++++++++++++++----------------- > 1 files changed, 48 insertions(+), 27 deletions(-) > ACK From mburns at redhat.com Wed Mar 24 11:45:55 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 07:45:55 -0400 Subject: [Ovirt-devel] [PATCH 3/4] ovirt_store_config must refresh persistent copy In-Reply-To: <1269359325-6700-4-git-send-email-dpierce@redhat.com> References: <1269359325-6700-1-git-send-email-dpierce@redhat.com> <1269359325-6700-2-git-send-email-dpierce@redhat.com> <1269359325-6700-3-git-send-email-dpierce@redhat.com> <1269359325-6700-4-git-send-email-dpierce@redhat.com> Message-ID: <1269431155.6519.10.camel@localhost.localdomain> On Tue, 2010-03-23 at 11:48 -0400, Darryl L. Pierce wrote: > From: Alan Pevec > > Related: rhbz#576239 > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt-functions | 14 +++++++++++--- > 1 files changed, 11 insertions(+), 3 deletions(-) > ACK From mburns at redhat.com Wed Mar 24 11:46:05 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 07:46:05 -0400 Subject: [Ovirt-devel] [PATCH 4/4] Added the ChangeLog entry for persistence fixes. In-Reply-To: <1269359325-6700-5-git-send-email-dpierce@redhat.com> References: <1269359325-6700-1-git-send-email-dpierce@redhat.com> <1269359325-6700-2-git-send-email-dpierce@redhat.com> <1269359325-6700-3-git-send-email-dpierce@redhat.com> <1269359325-6700-4-git-send-email-dpierce@redhat.com> <1269359325-6700-5-git-send-email-dpierce@redhat.com> Message-ID: <1269431165.6519.11.camel@localhost.localdomain> On Tue, 2010-03-23 at 11:48 -0400, Darryl L. Pierce wrote: > Signed-off-by: Darryl L. Pierce > --- > ChangeLog | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > ACK From mburns at redhat.com Wed Mar 24 11:46:14 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 07:46:14 -0400 Subject: [Ovirt-devel] [PATCH] Ensures that persist and unpersist work with relative paths. In-Reply-To: <1269369345-15585-1-git-send-email-dpierce@redhat.com> References: <1269369345-15585-1-git-send-email-dpierce@redhat.com> Message-ID: <1269431174.6519.12.camel@localhost.localdomain> On Tue, 2010-03-23 at 14:35 -0400, Darryl L. Pierce wrote: > As they iterate through their list of arguments, both > ovirt_storage_config and remove_config first convert each of them into a > fully qualified path before processing. > > Related: rhbz#576239 > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt-functions | 80 +++++++++++++++++++++++------------------------ > 1 files changed, 39 insertions(+), 41 deletions(-) > ACK From mburns at redhat.com Wed Mar 24 11:48:50 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 07:48:50 -0400 Subject: [Ovirt-devel] [PATCH node] RESEND: validate hostname in ovirt-config-hostname In-Reply-To: <1269375782-29241-1-git-send-email-jboggs@redhat.com> References: <1269375782-29241-1-git-send-email-jboggs@redhat.com> Message-ID: <1269431330.6519.13.camel@localhost.localdomain> On Tue, 2010-03-23 at 16:23 -0400, Joey Boggs wrote: > double quote all $REPLY variables > > --- > scripts/ovirt-config-hostname | 26 +++++++++++++++++++++----- > 1 files changed, 21 insertions(+), 5 deletions(-) > ACK From mburns at redhat.com Wed Mar 24 12:32:25 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 08:32:25 -0400 Subject: [Ovirt-devel] [PATCH node] Fix blkid.conf to scan devices for findfs calls. Message-ID: <1269433945-16104-1-git-send-email-mburns@redhat.com> findfs in F12 finds partitions on /dev/sdX devices instead of /dev/mapper/ devices. This sets an option that forces findfs to scan instead. Signed-off-by: Mike Burns --- recipe/common-post.ks | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/recipe/common-post.ks b/recipe/common-post.ks index 9243751..0a2e180 100644 --- a/recipe/common-post.ks +++ b/recipe/common-post.ks @@ -192,3 +192,7 @@ patch -d /etc/init.d/ -p0 <<\EOF /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next} {print $2}' /proc/mounts \ EOF + +# Need this for F12 findfs calls +# Otherwise, findfs returns /dev/sdX instead of /dev/mapper/ +echo "EVALUATE=scan" > /etc/blkid.conf -- 1.6.6.1 From dpierce at redhat.com Wed Mar 24 13:01:08 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Mar 2010 09:01:08 -0400 Subject: [Ovirt-devel] Need your information In-Reply-To: References: Message-ID: <20100324130107.GB11702@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 24, 2010 at 07:42:15AM +0530, clouduser s wrote: > Before starting with Ovirt, i would like to discuss for the following > queries, > > 1) Ovirt will support all OS ? oVirt doesn't not limit or constrain what operating systems are supported _in the virtual machines_ running on the managed node. The managed node itself, though, is a custom Fedora spin. > 2) Can i integrate Ovirt with my java applications ? > 3) I am looking for the open source tool that which i can integrate with my > java applications and manage cloud infrasturcture. What do you mean by "integrate" in these two questions? > 4) Managing the coloud infrastructure such as create image, deploy the > image to cloud host provider ? > 5) Using Ovirt can i deploy the image to EC2, private eucalyptus, rackspace Right now the oVirt _server_ is specific to the oVirt managed node; i.e., it only does management for the managed node and not for other systems. However, I'm currently working on defining the next generation management interface for the managed node. One that will hopefully be acceptable to other management and virtualization systesm such as eucalyptus, open nebula, etc. that they could use to mix and match virtualation management and hosting systems. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Mar 24 13:03:24 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 09:03:24 -0400 Subject: [Ovirt-devel] [PATCH node][REPOST 1/2] Fix uninstall to detect and cleanup correct partitions Message-ID: <1269435805-17163-1-git-send-email-mburns@redhat.com> Previous implementation had staticly defined partitions to remove. This would break in the case of split Root and HostVG devices. Signed-off-by: Mike Burns --- scripts/ovirt-config-boot | 11 +-------- scripts/ovirt-config-uninstall | 48 ++++++++++++++++++++++++--------------- scripts/ovirt-functions | 33 +++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 29 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index 28d1572..ac43daa 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -50,12 +50,7 @@ ovirt_boot_setup() { fi # check that /boot mounted ok and find partition number for GRUB - eval $(readlink -f /dev/disk/by-label/$grub_dev_label|awk {' - print "disk=" substr($1,1,length($1)-1); - print "disk2=" substr($1,1,length($1)-2); - partN=substr($1,length($1),1); partN--; - print "partN=" partN; - }') + get_part_info $(readlink -f /dev/disk/by-label/$grub_dev_label disk partN rc=$? if [ $rc -ne 0 -o $partN -lt 0 ]; then log "unable to determine Root partition" @@ -70,10 +65,6 @@ ovirt_boot_setup() { return 1 fi - if [ ! -e "$disk" ]; then - # e.g. c0d0p1 - disk="$disk2" - fi # prepare Root partition update candidate= if [ -e /dev/disk/by-label/RootBackup ]; then diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall index 3b7b48d..b6675e7 100755 --- a/scripts/ovirt-config-uninstall +++ b/scripts/ovirt-config-uninstall @@ -37,27 +37,37 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" rm -f /var/lib/multipath/bindings unmount_logging unmount_config /etc/default/ovirt + #get partition info + root2="" + if findfs LABEL=RootBackup 2>&1 >/dev/null; then + root2=RootBackup + elif findfs LABEL=RootUpdate 2>&1 >/dev/null; then + root2=RootUpdate + elif findfs LABEL=RootNew 2>&1 >/dev/null; then + root2=RootNew + fi + if ! get_part_info $(findfs LABEL=Root 2>/dev/null) root_dev root_part; then + log "Can't find Root device" + exit 2 + fi + if ! get_part_info $(findfs LABEL=${root2} 2>/dev/null) root2_dev root2_part; then + log "Can't find RootBackup/RootNew/RootUpdate device" + exit 3 + fi + if ! get_part_info $(pvs --noheadings -o pv_name,vg_name | grep HostVG | awk '{print $1}') pv_dev pv_part; then + log "Can't find HostVG device" + exit 4 + fi log "Removing volume group" wipe_volume_group "HostVG" - partition=$(readlink -f $(findfs LABEL=Root)) - if [ -n "$partition" ]; then - log "Removing partitions" - eval $(echo $partition | awk ' { - print "drive=" substr($0,1,length($1)-1); - print "drive2=" substr($0,1,length($1)-2); - }') - if [ ! -e "$drive" ]; then - drive="$drive2" - partpv="$drive}p2" - else - partpv="${drive}2" - fi - parted -s $drive "rm 1" - pvremove ${partpv} - parted -s $drive "rm 2" - parted -s $drive "rm 3" - wipe_partitions $drive - fi + log "Removing partitions" + parted -s $root_dev "rm $root_part" + pvremove ${vg_dev} + parted -s $root2_dev "rm $root2_part" + parted -s $vg_dev "rm $vg_part" + wipe_partitions $pv_dev + wipe_partitions $root_dev + wipe_partitions $root2_dev #restart multipath multipath -F multipath -v3 diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index c2ef94b..b98e31a 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -851,6 +851,39 @@ get_dm_device () return $rc } +#Function to determine partition and device names +get_part_info() { + local drive_in=$1 + local dev_var=$2 + local part_var=$3 + local devname_1 devname2 part_number + local rc=0 + + eval $(readlink -f $drive_in|awk {' + print "devname_1=" substr($1,1,length($1)-1); + print "devname_2=" substr($1,1,length($1)-2); + part_number=substr($1,length($1),1); + print "part_number=" part_number; + }') + rc=$? + + if [[ "part_number" -lt 1 ]]; then + log "Partition number was invalid" + return 2 + fi + + + if [ -e ${devname_1} ]; then + eval "${dev_var}"="${devname_1}" + elif [ -e ${devname_2} ]; then + eval "${dev_var}"="${devname_2}" + else + return 1 + fi + eval "${part_var}"="${part_number}" + return $rc +} + # execute a function if called as a script, e.g. # ovirt-functions ovirt_store_config /etc/hosts -- 1.6.6.1 From mburns at redhat.com Wed Mar 24 13:03:25 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 09:03:25 -0400 Subject: [Ovirt-devel] [PATCH node][REPOST 2/2] Remove dependencies on /dev/disk/by-label entries In-Reply-To: <1269435805-17163-1-git-send-email-mburns@redhat.com> References: <1269435805-17163-1-git-send-email-mburns@redhat.com> Message-ID: <1269435805-17163-2-git-send-email-mburns@redhat.com> Use findfs LABEL=ABC and mount LABEL=ABC instead. Signed-off-by: Mike Burns --- scripts/ovirt-config-boot | 29 ++++++++++++++++------------- scripts/ovirt-config-storage | 2 -- scripts/ovirt-functions | 18 ++++++++++-------- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index ac43daa..d545878 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -29,14 +29,21 @@ ovirt_boot_setup() { local disk2 local partN=-1 log "installing the image." - if [ -h /dev/disk/by-label/Boot ]; then + local found_boot=false + if findfs LABEL=Boot 2>&1 >/dev/null ; then + found_boot=true + grub_dev_label=Boot + elif findfs LABEL=Root 2>&1 >/dev/null ; then + found_boot=true + grub_dev_label=Root + fi + if $found_boot; then mount_boot mountpoint /boot if [ $? -ne 0 ] ; then log "Boot partition not available" return 1 fi - grub_dev_label="Boot" # Grab OVIRT_ISCSI VARIABLES from boot partition for upgrading # file created only if OVIRT_ISCSI_ENABLED=y if [ -f /boot/ovirt ]; then @@ -50,7 +57,7 @@ ovirt_boot_setup() { fi # check that /boot mounted ok and find partition number for GRUB - get_part_info $(readlink -f /dev/disk/by-label/$grub_dev_label disk partN + get_part_info $(readlink -f $(findfs LABEL=$grub_dev_label 2>/dev/null)) disk partN rc=$? if [ $rc -ne 0 -o $partN -lt 0 ]; then log "unable to determine Root partition" @@ -67,11 +74,11 @@ ovirt_boot_setup() { # prepare Root partition update candidate= - if [ -e /dev/disk/by-label/RootBackup ]; then + if findfs LABEL=RootBackup 2>&1 >/dev/null; then candidate=RootBackup - elif [ -e /dev/disk/by-label/RootUpdate ]; then + elif findfs LABEL=RootUpdate 2>&1 >/dev/null; then candidate=RootUpdate - elif [ -e /dev/disk/by-label/RootNew ]; then + elif findfs LABEL=RootNew 2>&1 >/dev/null; then candidate=RootNew fi if [ -z "$candidate" ]; then @@ -80,7 +87,7 @@ ovirt_boot_setup() { umount /liveos rc=0 else - candidate_dev=$(readlink -f /dev/disk/by-label/$candidate) + candidate_dev=$(findfs LABEL=$candidate 2>/dev/null) e2label $candidate_dev RootNew rc=$? fi @@ -90,7 +97,7 @@ ovirt_boot_setup() { return $rc fi - mount $candidate_dev /liveos + mount $candidate_dev /liveos/ rm -rf /liveos/LiveOS mkdir -p /liveos/LiveOS @@ -212,11 +219,7 @@ if [ $rc -eq 0 -a "$doreboot" = "yes" ]; then ovirt_store_firstboot_config stop_log - if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then - reboot - else - /sbin/reboot - fi + reboot fi stop_log exit $rc diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index c6473a6..93b94b0 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -703,8 +703,6 @@ perform_partitioning() log "Creating volume group" vgcreate /dev/HostVG "${partpv}" - mkdir -p /dev/disk/by-label - if [ "$SWAP_SIZE" -gt 0 ]; then log "Creating swap partition" lvcreate --name Swap --size ${SWAP_SIZE}M /dev/HostVG diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index b98e31a..482441a 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -283,7 +283,7 @@ mount_liveos() { return 0 fi mkdir -p /liveos - mount /dev/disk/by-label/Root /liveos + mount LABEL=Root /liveos } # mount config partition @@ -326,7 +326,7 @@ mount_boot() { return 0 fi mkdir -p /boot - mount /dev/disk/by-label/Boot /boot + mount LABEL=Root /boot } # stop any service which keeps /var/log busy # keep the list of services @@ -709,12 +709,14 @@ lvremove() { # cleanup before reboot reboot() { cd / - # setup new Root if update is prepared - if [ -e "/dev/disk/by-label/RootUpdate" ]; then - root_update_dev=$(readlink -f /dev/disk/by-label/RootUpdate) - root_dev=$(readlink -f /dev/disk/by-label/Root) - e2label $root_dev RootBackup - e2label $root_update_dev Root + if [ "$OVIRT_ISCSI_ENABLED" = "yes" ]; then + # setup new Root if update is prepared + if findfs LABEL=RootUpdate 2>&1 >/dev/null; then + root_update_dev=$(findfs LABEL=RootUpdate 2>/dev/null) + root_dev=$(findfs LABEL=Root 2>/dev/null) + e2label $root_dev RootBackup + e2label $root_update_dev Root + fi fi # run post-install hooks # e.g. to avoid reboot loops using Cobbler PXE only once -- 1.6.6.1 From jcclouduser at gmail.com Wed Mar 24 13:11:59 2010 From: jcclouduser at gmail.com (clouduser s) Date: Wed, 24 Mar 2010 18:41:59 +0530 Subject: [Ovirt-devel] Need your information In-Reply-To: <20100324130107.GB11702@mcpierce-desktop.usersys.redhat.com> References: <20100324130107.GB11702@mcpierce-desktop.usersys.redhat.com> Message-ID: > 2) Can i integrate Ovirt with my java applications ? > 3) I am looking for the open source tool that which i can integrate with my > java applications and manage cloud infrasturcture. >What do you mean by "integrate" in these two questions? Inside my web application, using Ovirt i would like to provide option to manage clound infrastructure such as to deploy image into EC2 and monitor. On Wed, Mar 24, 2010 at 6:31 PM, Darryl L. Pierce wrote: > On Wed, Mar 24, 2010 at 07:42:15AM +0530, clouduser s wrote: > > Before starting with Ovirt, i would like to discuss for the following > > queries, > > > > 1) Ovirt will support all OS ? > > oVirt doesn't not limit or constrain what operating systems are > supported _in the virtual machines_ running on the managed node. The > managed node itself, though, is a custom Fedora spin. > > > 2) Can i integrate Ovirt with my java applications ? > > 3) I am looking for the open source tool that which i can integrate with > my > > java applications and manage cloud infrasturcture. > > What do you mean by "integrate" in these two questions? > > > 4) Managing the coloud infrastructure such as create image, deploy the > > image to cloud host provider ? > > 5) Using Ovirt can i deploy the image to EC2, private eucalyptus, > rackspace > > Right now the oVirt _server_ is specific to the oVirt managed node; > i.e., it only does management for the managed node and not for other > systems. > > However, I'm currently working on defining the next generation > management interface for the managed node. One that will hopefully be > acceptable to other management and virtualization systesm such as > eucalyptus, open nebula, etc. that they could use to mix and match > virtualation management and hosting systems. > > -- > Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. > Delivering value year after year. > Red Hat ranks #1 in value among software vendors. > http://www.redhat.com/promo/vendor/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jboggs at redhat.com Wed Mar 24 13:15:38 2010 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 24 Mar 2010 09:15:38 -0400 Subject: [Ovirt-devel] Need your information In-Reply-To: References: <20100324130107.GB11702@mcpierce-desktop.usersys.redhat.com> Message-ID: <4BAA107A.8020504@redhat.com> On 03/24/2010 09:11 AM, clouduser s wrote: > > 2) Can i integrate Ovirt with my java applications ? > > 3) I am looking for the open source tool that which i can integrate > with my > > java applications and manage cloud infrasturcture. > > >What do you mean by "integrate" in these two questions? > > Inside my web application, using Ovirt i would like to provide option > to manage clound infrastructure such as to deploy image into EC2 and > monitor. > > > > > > > > On Wed, Mar 24, 2010 at 6:31 PM, Darryl L. Pierce > wrote: > > On Wed, Mar 24, 2010 at 07:42:15AM +0530, clouduser s wrote: > > Before starting with Ovirt, i would like to discuss for the > following > > queries, > > > > 1) Ovirt will support all OS ? > > oVirt doesn't not limit or constrain what operating systems are > supported _in the virtual machines_ running on the managed node. The > managed node itself, though, is a custom Fedora spin. > > > 2) Can i integrate Ovirt with my java applications ? > > 3) I am looking for the open source tool that which i can > integrate with my > > java applications and manage cloud infrasturcture. > > What do you mean by "integrate" in these two questions? > > > 4) Managing the coloud infrastructure such as create image, > deploy the > > image to cloud host provider ? > > 5) Using Ovirt can i deploy the image to EC2, private > eucalyptus, rackspace > > Right now the oVirt _server_ is specific to the oVirt managed node; > i.e., it only does management for the managed node and not for other > systems. > > However, I'm currently working on defining the next generation > management interface for the managed node. One that will hopefully be > acceptable to other management and virtualization systesm such as > eucalyptus, open nebula, etc. that they could use to mix and match > virtualation management and hosting systems. > > -- > Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. > Delivering value year after year. > Red Hat ranks #1 in value among software vendors. > http://www.redhat.com/promo/vendor/ > > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > You want want to take a look at detlacloud which may be more matching to your goals of cloud deployment. http://deltacloud.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dpierce at redhat.com Wed Mar 24 14:29:12 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Mar 2010 10:29:12 -0400 Subject: [Ovirt-devel] [PATCH] Disables virt-preview and add ovirt.org yum repo. Message-ID: <1269440952-7115-1-git-send-email-dpierce@redhat.com> Signed-off-by: Darryl L. Pierce --- recipe/Makefile.am | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/recipe/Makefile.am b/recipe/Makefile.am index 0bd139f..6c97ed0 100644 --- a/recipe/Makefile.am +++ b/recipe/Makefile.am @@ -3,6 +3,7 @@ CUR_RAWHIDE = 14 CUR_DEVEL = 13 CUR_PREVIEW = 12 PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) +OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(CUR_PREVIEW)/$(ARCH) FEDORA = $(shell rpm --eval '%{fedora}') ARCH = $(shell rpm --eval '%{_arch}') @@ -36,10 +37,11 @@ repos.ks: FEDORA_REPO=f$(FEDORA) ;\ FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/${ARCH}/os,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=$(ARCH))" ;\ UPDATE_REPO_LINE="repo --name=$${FEDORA_REPO}-updates $(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/updates/$(FEDORA)/${ARCH},--mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-f$(FEDORA)&arch=$(ARCH))\n" ;\ - if [ 0$(FEDORA) == 0$(CUR_PREVIEW) ]; then \ + if [ 0$(FEDORA)remove == 0$(CUR_PREVIEW)me ]; then \ UPDATE_REPO_LINE="$${UPDATE_REPO_LINE}repo --name=preview --baseurl=$(PREVIEW_URL)\n" ;\ fi ;\ fi ;\ + UPDATE_REPO_LINE="$${UPDATE_REPO_LINE}repo --name=ovirt --baseurl=$(OVIRT_REPO_URL)\n" ;\ echo "repo --name=$${FEDORA_REPO} $${FEDORA_REPO_LOC}" > repos.ks ;\ printf "$${UPDATE_REPO_LINE}" >> repos.ks ;\ ) -- 1.6.6.1 From mburns at redhat.com Wed Mar 24 14:38:38 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 10:38:38 -0400 Subject: [Ovirt-devel] [PATCH] Disables virt-preview and add ovirt.org yum repo. In-Reply-To: <1269440952-7115-1-git-send-email-dpierce@redhat.com> References: <1269440952-7115-1-git-send-email-dpierce@redhat.com> Message-ID: <1269441518.6519.14.camel@localhost.localdomain> On Wed, 2010-03-24 at 10:29 -0400, Darryl L. Pierce wrote: > Signed-off-by: Darryl L. Pierce > --- > recipe/Makefile.am | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/recipe/Makefile.am b/recipe/Makefile.am > index 0bd139f..6c97ed0 100644 > --- a/recipe/Makefile.am > +++ b/recipe/Makefile.am > @@ -3,6 +3,7 @@ CUR_RAWHIDE = 14 > CUR_DEVEL = 13 > CUR_PREVIEW = 12 > PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) > +OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(CUR_PREVIEW)/$(ARCH) > > FEDORA = $(shell rpm --eval '%{fedora}') > ARCH = $(shell rpm --eval '%{_arch}') > @@ -36,10 +37,11 @@ repos.ks: > FEDORA_REPO=f$(FEDORA) ;\ > FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/${ARCH}/os,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=$(ARCH))" ;\ > UPDATE_REPO_LINE="repo --name=$${FEDORA_REPO}-updates $(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/updates/$(FEDORA)/${ARCH},--mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-f$(FEDORA)&arch=$(ARCH))\n" ;\ > - if [ 0$(FEDORA) == 0$(CUR_PREVIEW) ]; then \ > + if [ 0$(FEDORA)remove == 0$(CUR_PREVIEW)me ]; then \ > UPDATE_REPO_LINE="$${UPDATE_REPO_LINE}repo --name=preview --baseurl=$(PREVIEW_URL)\n" ;\ > fi ;\ > fi ;\ > + UPDATE_REPO_LINE="$${UPDATE_REPO_LINE}repo --name=ovirt --baseurl=$(OVIRT_REPO_URL)\n" ;\ > echo "repo --name=$${FEDORA_REPO} $${FEDORA_REPO_LOC}" > repos.ks ;\ > printf "$${UPDATE_REPO_LINE}" >> repos.ks ;\ > ) Ack From mburns at redhat.com Wed Mar 24 14:45:01 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 10:45:01 -0400 Subject: [Ovirt-devel] [PATCH] Disables virt-preview and add ovirt.org yum repo. In-Reply-To: <1269441518.6519.14.camel@localhost.localdomain> References: <1269440952-7115-1-git-send-email-dpierce@redhat.com> <1269441518.6519.14.camel@localhost.localdomain> Message-ID: <1269441901.6519.17.camel@localhost.localdomain> On Wed, 2010-03-24 at 10:38 -0400, Mike Burns wrote: > On Wed, 2010-03-24 at 10:29 -0400, Darryl L. Pierce wrote: > > Signed-off-by: Darryl L. Pierce > > --- > > recipe/Makefile.am | 4 +++- > > 1 files changed, 3 insertions(+), 1 deletions(-) > > > > diff --git a/recipe/Makefile.am b/recipe/Makefile.am > > index 0bd139f..6c97ed0 100644 > > --- a/recipe/Makefile.am > > +++ b/recipe/Makefile.am > > @@ -3,6 +3,7 @@ CUR_RAWHIDE = 14 > > CUR_DEVEL = 13 > > CUR_PREVIEW = 12 > > PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) > > +OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(CUR_PREVIEW)/$(ARCH) Change to: +OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) > > > > FEDORA = $(shell rpm --eval '%{fedora}') > > ARCH = $(shell rpm --eval '%{_arch}') > > @@ -36,10 +37,11 @@ repos.ks: > > FEDORA_REPO=f$(FEDORA) ;\ > > FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/${ARCH}/os,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=$(ARCH))" ;\ > > UPDATE_REPO_LINE="repo --name=$${FEDORA_REPO}-updates $(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/updates/$(FEDORA)/${ARCH},--mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-f$(FEDORA)&arch=$(ARCH))\n" ;\ > > - if [ 0$(FEDORA) == 0$(CUR_PREVIEW) ]; then \ > > + if [ 0$(FEDORA)remove == 0$(CUR_PREVIEW)me ]; then \ > > UPDATE_REPO_LINE="$${UPDATE_REPO_LINE}repo --name=preview --baseurl=$(PREVIEW_URL)\n" ;\ > > fi ;\ > > fi ;\ > > + UPDATE_REPO_LINE="$${UPDATE_REPO_LINE}repo --name=ovirt --baseurl=$(OVIRT_REPO_URL)\n" ;\ > > echo "repo --name=$${FEDORA_REPO} $${FEDORA_REPO_LOC}" > repos.ks ;\ > > printf "$${UPDATE_REPO_LINE}" >> repos.ks ;\ > > ) > > Ack Will push with small changed discussed on IRC. > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel From jboggs at redhat.com Wed Mar 24 15:10:44 2010 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 24 Mar 2010 11:10:44 -0400 Subject: [Ovirt-devel] [PATCH] Remove initrd patching from oc-boot In-Reply-To: <1269373674-27078-1-git-send-email-mburns@redhat.com> References: <1269373674-27078-1-git-send-email-mburns@redhat.com> Message-ID: <4BAA2B74.7050101@redhat.com> On 03/23/2010 03:47 PM, Mike Burns wrote: > Dracut includes what was being patched in > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-boot | 47 --------------------------------------------- > 1 files changed, 0 insertions(+), 47 deletions(-) > > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > index d13dad2..28d1572 100755 > --- a/scripts/ovirt-config-boot > +++ b/scripts/ovirt-config-boot > @@ -143,53 +143,6 @@ ovirt_boot_setup() { > fi > fi > > - # append LVM support to the livecd initramfs > - tmpdir=$(mktemp -d) > - cd $tmpdir > - gzip -dc $live/$syslinux/initrd0.img | > - cpio -id init sbin/real-init > - init_script=init > - if [ -e sbin/real-init ]; then > - # Fedora 10 mkliveinitrd > - init_script=sbin/real-init > - fi > - sed -i '/^\/sbin\/udev.*trigger/ a \ > -echo SCSI wait for scans\ > -/sbin/modprobe scsi_wait_scan\ > -/sbin/modprobe -r scsi_wait_scan\ > -set +e\ > -while true; do\ > - echo Scanning logical volumes\ > - lvm vgscan --ignorelockingfailure\ > - echo Activating logical volumes\ > - if lvm vgchange -ay --ignorelockingfailure HostVG; then\ > - break\ > - fi\ > - sleep 1\ > -done\ > -set -e\ > -' $init_script > - # fix emergency shell > - sed -i 's/^ bash$/ bash< \/dev\/console/' $init_script > - mkdir -p bin > - bit= > - if [ -e /lib64 ]; then > - bit=64 > - fi > - mkdir -p lib$bit > - if [ -e /sbin/lvm.static ]; then > - cp /sbin/lvm.static bin/lvm > - else > - cp /sbin/lvm bin > - # lvm is not static in Fedora > - cp /lib$bit/libreadline.so.5 /lib$bit/libncurses.so.5 lib$bit > - fi > - > - find $init_script bin/lvm lib$bit -type f | > - cpio -H newc --quiet -o | > - gzip -9 | > - cat $live/$syslinux/initrd0.img -> $initrd_dest/initrd0.img > - > version=$(rpm -q --qf '%{version}' ovirt-node) > release=$(rpm -q --qf '%{release}' ovirt-node) > # reorder tty0 to allow both serial and phys console after installation > ACK From jboggs at redhat.com Wed Mar 24 15:10:55 2010 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 24 Mar 2010 11:10:55 -0400 Subject: [Ovirt-devel] [PATCH node][REPOST 1/2] Fix uninstall to detect and cleanup correct partitions In-Reply-To: <1269435805-17163-1-git-send-email-mburns@redhat.com> References: <1269435805-17163-1-git-send-email-mburns@redhat.com> Message-ID: <4BAA2B7F.609@redhat.com> On 03/24/2010 09:03 AM, Mike Burns wrote: > Previous implementation had staticly defined partitions to remove. > This would break in the case of split Root and HostVG devices. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-boot | 11 +-------- > scripts/ovirt-config-uninstall | 48 ++++++++++++++++++++++++--------------- > scripts/ovirt-functions | 33 +++++++++++++++++++++++++++ > 3 files changed, 63 insertions(+), 29 deletions(-) > > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > index 28d1572..ac43daa 100755 > --- a/scripts/ovirt-config-boot > +++ b/scripts/ovirt-config-boot > @@ -50,12 +50,7 @@ ovirt_boot_setup() { > fi > > # check that /boot mounted ok and find partition number for GRUB > - eval $(readlink -f /dev/disk/by-label/$grub_dev_label|awk {' > - print "disk=" substr($1,1,length($1)-1); > - print "disk2=" substr($1,1,length($1)-2); > - partN=substr($1,length($1),1); partN--; > - print "partN=" partN; > - }') > + get_part_info $(readlink -f /dev/disk/by-label/$grub_dev_label disk partN > rc=$? > if [ $rc -ne 0 -o $partN -lt 0 ]; then > log "unable to determine Root partition" > @@ -70,10 +65,6 @@ ovirt_boot_setup() { > return 1 > fi > > - if [ ! -e "$disk" ]; then > - # e.g. c0d0p1 > - disk="$disk2" > - fi > # prepare Root partition update > candidate= > if [ -e /dev/disk/by-label/RootBackup ]; then > diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall > index 3b7b48d..b6675e7 100755 > --- a/scripts/ovirt-config-uninstall > +++ b/scripts/ovirt-config-uninstall > @@ -37,27 +37,37 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" > rm -f /var/lib/multipath/bindings > unmount_logging > unmount_config /etc/default/ovirt > + #get partition info > + root2="" > + if findfs LABEL=RootBackup 2>&1>/dev/null; then > + root2=RootBackup > + elif findfs LABEL=RootUpdate 2>&1>/dev/null; then > + root2=RootUpdate > + elif findfs LABEL=RootNew 2>&1>/dev/null; then > + root2=RootNew > + fi > + if ! get_part_info $(findfs LABEL=Root 2>/dev/null) root_dev root_part; then > + log "Can't find Root device" > + exit 2 > + fi > + if ! get_part_info $(findfs LABEL=${root2} 2>/dev/null) root2_dev root2_part; then > + log "Can't find RootBackup/RootNew/RootUpdate device" > + exit 3 > + fi > + if ! get_part_info $(pvs --noheadings -o pv_name,vg_name | grep HostVG | awk '{print $1}') pv_dev pv_part; then > + log "Can't find HostVG device" > + exit 4 > + fi > log "Removing volume group" > wipe_volume_group "HostVG" > - partition=$(readlink -f $(findfs LABEL=Root)) > - if [ -n "$partition" ]; then > - log "Removing partitions" > - eval $(echo $partition | awk ' { > - print "drive=" substr($0,1,length($1)-1); > - print "drive2=" substr($0,1,length($1)-2); > - }') > - if [ ! -e "$drive" ]; then > - drive="$drive2" > - partpv="$drive}p2" > - else > - partpv="${drive}2" > - fi > - parted -s $drive "rm 1" > - pvremove ${partpv} > - parted -s $drive "rm 2" > - parted -s $drive "rm 3" > - wipe_partitions $drive > - fi > + log "Removing partitions" > + parted -s $root_dev "rm $root_part" > + pvremove ${vg_dev} > + parted -s $root2_dev "rm $root2_part" > + parted -s $vg_dev "rm $vg_part" > + wipe_partitions $pv_dev > + wipe_partitions $root_dev > + wipe_partitions $root2_dev > #restart multipath > multipath -F > multipath -v3 > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index c2ef94b..b98e31a 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -851,6 +851,39 @@ get_dm_device () > return $rc > } > > +#Function to determine partition and device names > +get_part_info() { > + local drive_in=$1 > + local dev_var=$2 > + local part_var=$3 > + local devname_1 devname2 part_number > + local rc=0 > + > + eval $(readlink -f $drive_in|awk {' > + print "devname_1=" substr($1,1,length($1)-1); > + print "devname_2=" substr($1,1,length($1)-2); > + part_number=substr($1,length($1),1); > + print "part_number=" part_number; > + }') > + rc=$? > + > + if [[ "part_number" -lt 1 ]]; then > + log "Partition number was invalid" > + return 2 > + fi > + > + > + if [ -e ${devname_1} ]; then > + eval "${dev_var}"="${devname_1}" > + elif [ -e ${devname_2} ]; then > + eval "${dev_var}"="${devname_2}" > + else > + return 1 > + fi > + eval "${part_var}"="${part_number}" > + return $rc > +} > + > # execute a function if called as a script, e.g. > # ovirt-functions ovirt_store_config /etc/hosts > > ACK From jboggs at redhat.com Wed Mar 24 15:11:04 2010 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 24 Mar 2010 11:11:04 -0400 Subject: [Ovirt-devel] [PATCH node][REPOST 2/2] Remove dependencies on /dev/disk/by-label entries In-Reply-To: <1269435805-17163-2-git-send-email-mburns@redhat.com> References: <1269435805-17163-1-git-send-email-mburns@redhat.com> <1269435805-17163-2-git-send-email-mburns@redhat.com> Message-ID: <4BAA2B88.7030307@redhat.com> On 03/24/2010 09:03 AM, Mike Burns wrote: > Use findfs LABEL=ABC and mount LABEL=ABC instead. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-boot | 29 ++++++++++++++++------------- > scripts/ovirt-config-storage | 2 -- > scripts/ovirt-functions | 18 ++++++++++-------- > 3 files changed, 26 insertions(+), 23 deletions(-) > > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > index ac43daa..d545878 100755 > --- a/scripts/ovirt-config-boot > +++ b/scripts/ovirt-config-boot > @@ -29,14 +29,21 @@ ovirt_boot_setup() { > local disk2 > local partN=-1 > log "installing the image." > - if [ -h /dev/disk/by-label/Boot ]; then > + local found_boot=false > + if findfs LABEL=Boot 2>&1>/dev/null ; then > + found_boot=true > + grub_dev_label=Boot > + elif findfs LABEL=Root 2>&1>/dev/null ; then > + found_boot=true > + grub_dev_label=Root > + fi > + if $found_boot; then > mount_boot > mountpoint /boot > if [ $? -ne 0 ] ; then > log "Boot partition not available" > return 1 > fi > - grub_dev_label="Boot" > # Grab OVIRT_ISCSI VARIABLES from boot partition for upgrading > # file created only if OVIRT_ISCSI_ENABLED=y > if [ -f /boot/ovirt ]; then > @@ -50,7 +57,7 @@ ovirt_boot_setup() { > fi > > # check that /boot mounted ok and find partition number for GRUB > - get_part_info $(readlink -f /dev/disk/by-label/$grub_dev_label disk partN > + get_part_info $(readlink -f $(findfs LABEL=$grub_dev_label 2>/dev/null)) disk partN > rc=$? > if [ $rc -ne 0 -o $partN -lt 0 ]; then > log "unable to determine Root partition" > @@ -67,11 +74,11 @@ ovirt_boot_setup() { > > # prepare Root partition update > candidate= > - if [ -e /dev/disk/by-label/RootBackup ]; then > + if findfs LABEL=RootBackup 2>&1>/dev/null; then > candidate=RootBackup > - elif [ -e /dev/disk/by-label/RootUpdate ]; then > + elif findfs LABEL=RootUpdate 2>&1>/dev/null; then > candidate=RootUpdate > - elif [ -e /dev/disk/by-label/RootNew ]; then > + elif findfs LABEL=RootNew 2>&1>/dev/null; then > candidate=RootNew > fi > if [ -z "$candidate" ]; then > @@ -80,7 +87,7 @@ ovirt_boot_setup() { > umount /liveos > rc=0 > else > - candidate_dev=$(readlink -f /dev/disk/by-label/$candidate) > + candidate_dev=$(findfs LABEL=$candidate 2>/dev/null) > e2label $candidate_dev RootNew > rc=$? > fi > @@ -90,7 +97,7 @@ ovirt_boot_setup() { > return $rc > fi > > - mount $candidate_dev /liveos > + mount $candidate_dev /liveos/ > > rm -rf /liveos/LiveOS > mkdir -p /liveos/LiveOS > @@ -212,11 +219,7 @@ if [ $rc -eq 0 -a "$doreboot" = "yes" ]; then > ovirt_store_firstboot_config > stop_log > > - if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then > - reboot > - else > - /sbin/reboot > - fi > + reboot > fi > stop_log > exit $rc > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index c6473a6..93b94b0 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -703,8 +703,6 @@ perform_partitioning() > log "Creating volume group" > vgcreate /dev/HostVG "${partpv}" > > - mkdir -p /dev/disk/by-label > - > if [ "$SWAP_SIZE" -gt 0 ]; then > log "Creating swap partition" > lvcreate --name Swap --size ${SWAP_SIZE}M /dev/HostVG > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index b98e31a..482441a 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -283,7 +283,7 @@ mount_liveos() { > return 0 > fi > mkdir -p /liveos > - mount /dev/disk/by-label/Root /liveos > + mount LABEL=Root /liveos > } > > # mount config partition > @@ -326,7 +326,7 @@ mount_boot() { > return 0 > fi > mkdir -p /boot > - mount /dev/disk/by-label/Boot /boot > + mount LABEL=Root /boot > } > # stop any service which keeps /var/log busy > # keep the list of services > @@ -709,12 +709,14 @@ lvremove() { > # cleanup before reboot > reboot() { > cd / > - # setup new Root if update is prepared > - if [ -e "/dev/disk/by-label/RootUpdate" ]; then > - root_update_dev=$(readlink -f /dev/disk/by-label/RootUpdate) > - root_dev=$(readlink -f /dev/disk/by-label/Root) > - e2label $root_dev RootBackup > - e2label $root_update_dev Root > + if [ "$OVIRT_ISCSI_ENABLED" = "yes" ]; then > + # setup new Root if update is prepared > + if findfs LABEL=RootUpdate 2>&1>/dev/null; then > + root_update_dev=$(findfs LABEL=RootUpdate 2>/dev/null) > + root_dev=$(findfs LABEL=Root 2>/dev/null) > + e2label $root_dev RootBackup > + e2label $root_update_dev Root > + fi > fi > # run post-install hooks > # e.g. to avoid reboot loops using Cobbler PXE only once > ACK From jboggs at redhat.com Wed Mar 24 15:14:03 2010 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 24 Mar 2010 11:14:03 -0400 Subject: [Ovirt-devel] [PATCH node] Fix blkid.conf to scan devices for findfs calls. In-Reply-To: <1269433945-16104-1-git-send-email-mburns@redhat.com> References: <1269433945-16104-1-git-send-email-mburns@redhat.com> Message-ID: <4BAA2C3B.1080904@redhat.com> On 03/24/2010 08:32 AM, Mike Burns wrote: > findfs in F12 finds partitions on /dev/sdX devices instead of > /dev/mapper/ devices. This sets an option that forces > findfs to scan instead. > > Signed-off-by: Mike Burns > --- > recipe/common-post.ks | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/recipe/common-post.ks b/recipe/common-post.ks > index 9243751..0a2e180 100644 > --- a/recipe/common-post.ks > +++ b/recipe/common-post.ks > @@ -192,3 +192,7 @@ patch -d /etc/init.d/ -p0<<\EOF > /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next} > {print $2}' /proc/mounts \ > EOF > + > +# Need this for F12 findfs calls > +# Otherwise, findfs returns /dev/sdX instead of /dev/mapper/ > +echo "EVALUATE=scan"> /etc/blkid.conf > ACK From apevec at gmail.com Wed Mar 24 16:41:40 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 24 Mar 2010 17:41:40 +0100 Subject: [Ovirt-devel] Need your information In-Reply-To: References: Message-ID: <2be7262f1003240941h704ab1edg31a7020dd3cf7cb8@mail.gmail.com> On Wed, Mar 24, 2010 at 3:12 AM, clouduser s wrote: > Before starting with Ovirt, i would like to discuss for the following > queries, > > 1) Ovirt will support all OS ? > 2) Can i integrate Ovirt with my java applications ? > 3) I am looking for the open source tool that which i can integrate with my > java applications and manage cloud infrasturcture. > 4) Managing the coloud infrastructure such as create image, deploy the > image?to cloud host provider ? > 5) Using Ovirt can i deploy the image to EC2, private eucalyptus, rackspace looks like deltacloud.org is what you need Alan > ? > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > > From aclement at linagora.com Wed Mar 24 16:59:05 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Wed, 24 Mar 2010 16:59:05 +0000 Subject: [Ovirt-devel] [PATCH] Restart network after applying configuration Message-ID: <1269449945-29860-1-git-send-email-aclement@linagora.com> Signed-off-by: Arthur CLEMENT --- scripts/ovirt-early | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 7f7c99c..4b85102 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -96,6 +96,9 @@ configure_ovirt_management_nic() { > /etc/sysconfig/network-scripts/ifcfg-$BRIDGE log "Default config applied" fi + + service network restart + } # $(get_live_disk) -- 1.6.6.1 From aclement at linagora.com Wed Mar 24 17:06:15 2010 From: aclement at linagora.com (Arthur =?iso-8859-15?q?Cl=E9ment?=) Date: Wed, 24 Mar 2010 18:06:15 +0100 Subject: [Ovirt-devel] [PATCH] Restart network after applying configuration In-Reply-To: <1269449945-29860-1-git-send-email-aclement@linagora.com> References: <1269449945-29860-1-git-send-email-aclement@linagora.com> Message-ID: <201003241806.15322.aclement@linagora.com> With this patch I have now an up and running f12 node with a good network config. I have non crititical ruby errors in taskomatic but the ovirt server is running on f11, it might come from that (bug trace : http://redhat.pastebin.com/Sg92TdYR). I'll test ovirt-server on f12 asap. On Mercredi 24 Mars 2010 17:59:05 you wrote: > Signed-off-by: Arthur CLEMENT > --- > scripts/ovirt-early | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 7f7c99c..4b85102 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -96,6 +96,9 @@ configure_ovirt_management_nic() { > > > /etc/sysconfig/network-scripts/ifcfg-$BRIDGE > > log "Default config applied" > fi > + > + service network restart > + > } > > # $(get_live_disk) -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Wed Mar 24 17:14:20 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Mar 2010 13:14:20 -0400 Subject: [Ovirt-devel] [PATCH] Restart network after applying configuration In-Reply-To: <1269449945-29860-1-git-send-email-aclement@linagora.com> References: <1269449945-29860-1-git-send-email-aclement@linagora.com> Message-ID: <20100324171420.GE11702@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 24, 2010 at 04:59:05PM +0000, Arthur CLEMENT wrote: > > Signed-off-by: Arthur CLEMENT > --- > scripts/ovirt-early | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 7f7c99c..4b85102 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -96,6 +96,9 @@ configure_ovirt_management_nic() { > > /etc/sysconfig/network-scripts/ifcfg-$BRIDGE > log "Default config applied" > fi > + > + service network restart > + > } > > # $(get_live_disk) > -- > 1.6.6.1 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. Pushing to the repo now. :) -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Mar 24 17:59:23 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 13:59:23 -0400 Subject: [Ovirt-devel] [PATCH] Fixed errors when the user selects a different remove libvirt host. In-Reply-To: <1261414187-2481-1-git-send-email-dpierce@redhat.com> References: <1261414187-2481-1-git-send-email-dpierce@redhat.com> Message-ID: <1269453563.6519.23.camel@localhost.localdomain> On Mon, 2009-12-21 at 11:49 -0500, Darryl L. Pierce wrote: > Now the app will show the current connection. When the user selects > a different host then any connection exception is caught and the > previous connection restored. > > Signed-off-by: Darryl L. Pierce > --- > nodeadmin/changehost.py | 6 ++++-- > nodeadmin/configscreen.py | 5 ++++- > nodeadmin/libvirtworker.py | 16 +++++++++++++++- > 3 files changed, 23 insertions(+), 4 deletions(-) > > diff --git a/nodeadmin/changehost.py b/nodeadmin/changehost.py > index 23e6854..f604c03 100644 > --- a/nodeadmin/changehost.py > +++ b/nodeadmin/changehost.py > @@ -27,7 +27,10 @@ CONNECTED_PAGE = 2 > > class ChangeHostConfigScreen(HostListConfigScreen): > def __init__(self): > - HostListConfigScreen.__init__(self, "Change Host") > + HostListConfigScreen.__init__(self, "") > + > + def get_title(self): > + return "Currently: %s" % self.get_libvirt().get_url() > > def get_elements_for_page(self, screen, page): > if page is CONNECTION_LIST_PAGE: return self.get_connection_list_page(screen) > @@ -36,7 +39,6 @@ class ChangeHostConfigScreen(HostListConfigScreen): > def process_input(self, page): > if page is CONNECTION_LIST_PAGE: > logging.info("Changing libvirt connection to %s" % self.get_selected_connection()) > - libvirtworker.set_default_url(self.get_selected_connection()) > self.get_libvirt().open_connection(self.get_selected_connection()) > elif page is CONNECTED_PAGE: self.set_finished() > > diff --git a/nodeadmin/configscreen.py b/nodeadmin/configscreen.py > index 02ab5b4..7a23325 100644 > --- a/nodeadmin/configscreen.py > +++ b/nodeadmin/configscreen.py > @@ -37,6 +37,9 @@ class ConfigScreen: > self.__libvirt = LibvirtWorker() > self.__vm_config = VirtManagerConfig() > > + def get_title(self): > + return self.__title > + > def get_hal(self): > return self.__hal > > @@ -83,7 +86,7 @@ class ConfigScreen: > screen = SnackScreen() > elements = self.get_elements_for_page(screen, self.__current_page) > # TODO: need to set the form height to the number of elements on the page > - gridform = GridForm(screen, self.__title, 1, 10) > + gridform = GridForm(screen, self.get_title(), 1, 10) > current_element = 0 > for element in elements: > gridform.add(element, 0, current_element) > diff --git a/nodeadmin/libvirtworker.py b/nodeadmin/libvirtworker.py > index b35509f..3338f80 100644 > --- a/nodeadmin/libvirtworker.py > +++ b/nodeadmin/libvirtworker.py > @@ -74,6 +74,8 @@ class LibvirtWorker: > def __init__(self, url = None): > if url is None: url = get_default_url() > logging.info("Connecting to libvirt: %s" % url) > + self.__url = None > + self.__conn = None > self.open_connection(url) > self.__capabilities = virtinst.CapabilitiesParser.parse(self.__conn.getCapabilities()) > self.__net = virtinst.VirtualNetworkInterface(conn = self.__conn) > @@ -84,9 +86,21 @@ class LibvirtWorker: > '''Returns the underlying connection.''' > return self.__conn > > + def get_url(self): > + return self.__url > + > def open_connection(self, url): > '''Lets the user change the url for the connection.''' > - self.__conn = libvirt.open(url) > + old_conn = self.__conn > + old_url = self.__url > + try: > + self.__conn = libvirt.open(url) > + self.__url = url > + set_default_url(url) > + except Exception, error: > + self.__conn = old_conn > + self.__url = old_url > + raise error > > def list_domains(self, defined = True, started = True): > '''Lists all domains.''' Ack, pushed with modified message (s/remove/remote) From dpierce at redhat.com Wed Mar 24 18:44:48 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Mar 2010 14:44:48 -0400 Subject: [Ovirt-devel] Resending a refactored patch... Message-ID: <1269456289-21467-1-git-send-email-dpierce@redhat.com> This was an older patch that had to be rebased against the current tip. From dpierce at redhat.com Wed Mar 24 18:44:49 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Mar 2010 14:44:49 -0400 Subject: [Ovirt-devel] [PATCH] Prevents duplicate DNS and NTP server entries. In-Reply-To: <1269456289-21467-1-git-send-email-dpierce@redhat.com> References: <1269456289-21467-1-git-send-email-dpierce@redhat.com> Message-ID: <1269456289-21467-2-git-send-email-dpierce@redhat.com> Checks any entered address for DNS and NTP servers against previously entered ones in order to prevent duplicates. Resolves: rhbz#555373 Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 46 +++++++++++++++++++++++++------------- scripts/ovirt-functions | 7 ++++++ 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 6c2bd21..a4e0ebd 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -357,8 +357,9 @@ function configure_dns for dns in first second; do while true; do printf "\n" - read -ep "Please enter the ${dns} DNS server (or ENTER to exit): " - if [[ -z "${REPLY}" ]]; then + read -erp "Please enter the ${dns} DNS server (or ENTER to exit): " + local ADDRESS=$(trim_whitespace $REPLY) + if [[ -z "${ADDRESS}" ]]; then if [[ -z "${DNS}" ]]; then printf "\nAborted...\n" return @@ -366,15 +367,19 @@ function configure_dns break fi fi - if is_valid_ipv4 $REPLY; then + if is_valid_ipv4 $ADDRESS; then if [[ -z "${DNS}" ]]; then - DNS="${REPLY}" - elif [[ -n "${REPLY}" ]]; then - DNS="${DNS}:${REPLY}" + DNS="${ADDRESS}" + elif [[ -n "${ADDRESS}" ]]; then + if [[ ! $DNS =~ "${ADDRESS}" ]]; then + DNS="${DNS}:${ADDRESS}" + break + else + printf "${ADDRESS} is already defined as a DNS server.\n" + fi fi - break else - printf "${REPLY} is an invalid address.\n" + printf "${ADDRESS} is an invalid address.\n" fi done done @@ -403,19 +408,28 @@ function configure_ntp { local AUTO=$2 if [[ "$AUTO" == "AUTO" && -n "$OVIRT_NTP" ]]; then - NTPSERVERS=$OVIRT_NTP + NTPSERVERS=$OVIRT_NTP else - NTPSERVERS="" + NTPSERVERS="" fi if [ -z "$AUTO" ]; then if has_configured_interface true; then - while true; do - read -ep "Enter an NTP server (hit return when finished): " + while true; do + read -rp "Enter an NTP server (hit return when finished): " + local ADDRESS=$(trim_whitespace $REPLY) - if [ -z "$REPLY" ]; then break; fi - NTPSERVERS="${NTPSERVERS}:${REPLY}" - done + if [ -z "${ADDRESS}" ]; then break; fi + if is_valid_ipv4 $address; then + if [[ ! $NTPSERVERS =~ $address ]]; then + NTPSERVERS="${NTPSERVERS}:${ADDRESS}" + else + printf "${ADDRESS} is already defined as an NTP server.\n" + fi + else + printf "${ADDRESS} is an invalid address.\n" + fi + done fi fi } diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 482441a..d8aa008 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -665,6 +665,13 @@ add_if_not_exist() { || echo "$string" >> "$file" } +# $1 - the string to be trimmed +trim_whitespace () { + local text=${1} + + printf "$text" | awk '{gsub(/^[ ]*/,"",$0); gsub(/[ ]*$/,"",$0) ; print }' +} + is_numeric() { printf "$1" | grep -q -E '^[0-9]+$' } -- 1.6.6.1 From mburns at redhat.com Wed Mar 24 18:52:47 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 14:52:47 -0400 Subject: [Ovirt-devel] [Fwd: [PATCH node] fix halt patch] Message-ID: <1269456767.6519.24.camel@localhost.localdomain> -------- Forwarded Message -------- > From: Alan Pevec > To: mburns at redhat.com > Cc: Alan Pevec > Subject: [PATCH node] fix halt patch > Date: Wed, 24 Mar 2010 19:25:39 +0100 > > (copy/paste whitespace damage) > --- > recipe/common-post.ks | 14 +++++++------- > 1 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/recipe/common-post.ks b/recipe/common-post.ks > index 0a2e180..c6ef496 100644 > --- a/recipe/common-post.ks > +++ b/recipe/common-post.ks > @@ -180,17 +180,17 @@ sed -i 's/preferred_names = \[ \]/preferred_names = [ "^\/dev\/mapper", "^\/dev\ > > # prevent node from hanging on reboot due to /etc mounts > patch -d /etc/init.d/ -p0 <<\EOF > ---- halt.orig 2010-03-15 16:01:13.677585448 -0400 > -+++ halt 2010-03-15 16:01:39.798581069 -0400 > -@@ -138,7 +138,7 @@ __umount_loop '$3 ~ /^rpc_pipefs$/ || $3 > +--- halt.orig 2009-12-05 00:44:29.000000000 +0000 > ++++ halt 2010-03-24 18:12:36.000000000 +0000 > +@@ -138,7 +138,7 @@ > $"Unmounting pipe file systems (retry): " \ > -f > - > + > -LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/dev/{next} > +LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/etc|^\/dev/{next} > - $3 == "tmpfs" || $3 == "proc" {print $2 ; next} > - /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next} > - {print $2}' /proc/mounts \ > + $3 == "tmpfs" || $3 == "proc" {print $2 ; next} > + /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next} > + {print $2}' /proc/mounts \ > EOF > > # Need this for F12 findfs calls acked and pushed From dpierce at redhat.com Wed Mar 24 19:18:44 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Mar 2010 15:18:44 -0400 Subject: [Ovirt-devel] Supercedes previous patch... Message-ID: <1269458325-30072-1-git-send-email-dpierce@redhat.com> This includes a missed break and two spots where $ADDRESS was copied as $address instead. From dpierce at redhat.com Wed Mar 24 19:18:45 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Mar 2010 15:18:45 -0400 Subject: [Ovirt-devel] [PATCH] Prevents duplicate DNS and NTP server entries. In-Reply-To: <1269458325-30072-1-git-send-email-dpierce@redhat.com> References: <1269458325-30072-1-git-send-email-dpierce@redhat.com> Message-ID: <1269458325-30072-2-git-send-email-dpierce@redhat.com> Checks any entered address for DNS and NTP servers against previously entered ones in order to prevent duplicates. Resolves: rhbz#555373 Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 47 +++++++++++++++++++++++++------------- scripts/ovirt-functions | 7 +++++ 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 6c2bd21..4d412ac 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -357,8 +357,9 @@ function configure_dns for dns in first second; do while true; do printf "\n" - read -ep "Please enter the ${dns} DNS server (or ENTER to exit): " - if [[ -z "${REPLY}" ]]; then + read -erp "Please enter the ${dns} DNS server (or ENTER to exit): " + local ADDRESS=$(trim_whitespace $REPLY) + if [[ -z "${ADDRESS}" ]]; then if [[ -z "${DNS}" ]]; then printf "\nAborted...\n" return @@ -366,15 +367,20 @@ function configure_dns break fi fi - if is_valid_ipv4 $REPLY; then + if is_valid_ipv4 $ADDRESS; then if [[ -z "${DNS}" ]]; then - DNS="${REPLY}" - elif [[ -n "${REPLY}" ]]; then - DNS="${DNS}:${REPLY}" + DNS="${ADDRESS}" + break + elif [[ -n "${ADDRESS}" ]]; then + if [[ ! $DNS =~ "${ADDRESS}" ]]; then + DNS="${DNS}:${ADDRESS}" + break + else + printf "${ADDRESS} is already defined as a DNS server.\n" + fi fi - break else - printf "${REPLY} is an invalid address.\n" + printf "${ADDRESS} is an invalid address.\n" fi done done @@ -403,19 +409,28 @@ function configure_ntp { local AUTO=$2 if [[ "$AUTO" == "AUTO" && -n "$OVIRT_NTP" ]]; then - NTPSERVERS=$OVIRT_NTP + NTPSERVERS=$OVIRT_NTP else - NTPSERVERS="" + NTPSERVERS="" fi if [ -z "$AUTO" ]; then if has_configured_interface true; then - while true; do - read -ep "Enter an NTP server (hit return when finished): " + while true; do + read -rp "Enter an NTP server (hit return when finished): " + local ADDRESS=$(trim_whitespace $REPLY) - if [ -z "$REPLY" ]; then break; fi - NTPSERVERS="${NTPSERVERS}:${REPLY}" - done + if [ -z "${ADDRESS}" ]; then break; fi + if is_valid_ipv4 $ADDRESS; then + if [[ ! $NTPSERVERS =~ $ADDRESS ]]; then + NTPSERVERS="${NTPSERVERS}:${ADDRESS}" + else + printf "${ADDRESS} is already defined as an NTP server.\n" + fi + else + printf "${ADDRESS} is an invalid address.\n" + fi + done fi fi } diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 482441a..d8aa008 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -665,6 +665,13 @@ add_if_not_exist() { || echo "$string" >> "$file" } +# $1 - the string to be trimmed +trim_whitespace () { + local text=${1} + + printf "$text" | awk '{gsub(/^[ ]*/,"",$0); gsub(/[ ]*$/,"",$0) ; print }' +} + is_numeric() { printf "$1" | grep -q -E '^[0-9]+$' } -- 1.6.6.1 From mburns at redhat.com Wed Mar 24 19:50:06 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Mar 2010 15:50:06 -0400 Subject: [Ovirt-devel] [PATCH] Prevents duplicate DNS and NTP server entries. In-Reply-To: <1269458325-30072-2-git-send-email-dpierce@redhat.com> References: <1269458325-30072-1-git-send-email-dpierce@redhat.com> <1269458325-30072-2-git-send-email-dpierce@redhat.com> Message-ID: <1269460206.6519.25.camel@localhost.localdomain> On Wed, 2010-03-24 at 15:18 -0400, Darryl L. Pierce wrote: > Checks any entered address for DNS and NTP servers against previously > entered ones in order to prevent duplicates. > > Resolves: rhbz#555373 > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt-config-networking | 47 +++++++++++++++++++++++++------------- > scripts/ovirt-functions | 7 +++++ > 2 files changed, 38 insertions(+), 16 deletions(-) > > diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking > index 6c2bd21..4d412ac 100755 > --- a/scripts/ovirt-config-networking > +++ b/scripts/ovirt-config-networking > @@ -357,8 +357,9 @@ function configure_dns > for dns in first second; do > while true; do > printf "\n" > - read -ep "Please enter the ${dns} DNS server (or ENTER to exit): " > - if [[ -z "${REPLY}" ]]; then > + read -erp "Please enter the ${dns} DNS server (or ENTER to exit): " > + local ADDRESS=$(trim_whitespace $REPLY) > + if [[ -z "${ADDRESS}" ]]; then > if [[ -z "${DNS}" ]]; then > printf "\nAborted...\n" > return > @@ -366,15 +367,20 @@ function configure_dns > break > fi > fi > - if is_valid_ipv4 $REPLY; then > + if is_valid_ipv4 $ADDRESS; then > if [[ -z "${DNS}" ]]; then > - DNS="${REPLY}" > - elif [[ -n "${REPLY}" ]]; then > - DNS="${DNS}:${REPLY}" > + DNS="${ADDRESS}" > + break > + elif [[ -n "${ADDRESS}" ]]; then > + if [[ ! $DNS =~ "${ADDRESS}" ]]; then > + DNS="${DNS}:${ADDRESS}" > + break > + else > + printf "${ADDRESS} is already defined as a DNS server.\n" > + fi > fi > - break > else > - printf "${REPLY} is an invalid address.\n" > + printf "${ADDRESS} is an invalid address.\n" > fi > done > done > @@ -403,19 +409,28 @@ function configure_ntp > { > local AUTO=$2 > if [[ "$AUTO" == "AUTO" && -n "$OVIRT_NTP" ]]; then > - NTPSERVERS=$OVIRT_NTP > + NTPSERVERS=$OVIRT_NTP > else > - NTPSERVERS="" > + NTPSERVERS="" > fi > > if [ -z "$AUTO" ]; then > if has_configured_interface true; then > - while true; do > - read -ep "Enter an NTP server (hit return when finished): " > + while true; do > + read -rp "Enter an NTP server (hit return when finished): " > + local ADDRESS=$(trim_whitespace $REPLY) > > - if [ -z "$REPLY" ]; then break; fi > - NTPSERVERS="${NTPSERVERS}:${REPLY}" > - done > + if [ -z "${ADDRESS}" ]; then break; fi > + if is_valid_ipv4 $ADDRESS; then > + if [[ ! $NTPSERVERS =~ $ADDRESS ]]; then > + NTPSERVERS="${NTPSERVERS}:${ADDRESS}" > + else > + printf "${ADDRESS} is already defined as an NTP server.\n" > + fi > + else > + printf "${ADDRESS} is an invalid address.\n" > + fi > + done > fi > fi > } > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index 482441a..d8aa008 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -665,6 +665,13 @@ add_if_not_exist() { > || echo "$string" >> "$file" > } > > +# $1 - the string to be trimmed > +trim_whitespace () { > + local text=${1} > + > + printf "$text" | awk '{gsub(/^[ ]*/,"",$0); gsub(/[ ]*$/,"",$0) ; print }' > +} > + > is_numeric() { > printf "$1" | grep -q -E '^[0-9]+$' > } ACK From matinata at br.ibm.com Wed Mar 24 22:16:49 2010 From: matinata at br.ibm.com (Ricardo Marin Matinata) Date: Wed, 24 Mar 2010 19:16:49 -0300 Subject: [Ovirt-devel] [PATCH] Allow persistance of empty config files in ovirt_store_config Message-ID: <1269469009-12865-1-git-send-email-matinata@br.ibm.com> This fix enables the persistance of empty configuration files during firstboot, in ovirt_store_config, so configuration files like ssh/ssl keys that are dynamically generated to well known locations can be pre set for persistance. Signed-off-by: Ricardo Marin Matinata --- scripts/ovirt-functions | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 482441a..cecb359 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -496,7 +496,7 @@ ovirt_store_config() { if $persist_it; then # skip if file does not exist or is empty - if [ ! -s "${filename}" ]; then + if [ ! -e "${filename}" ]; then printf " Skipping, file '${filename}' does not exist or is empty\n" continue fi -- 1.6.6.1 From jcclouduser at gmail.com Thu Mar 25 04:59:11 2010 From: jcclouduser at gmail.com (clouduser s) Date: Thu, 25 Mar 2010 10:29:11 +0530 Subject: [Ovirt-devel] Need your information In-Reply-To: <2be7262f1003240941h704ab1edg31a7020dd3cf7cb8@mail.gmail.com> References: <2be7262f1003240941h704ab1edg31a7020dd3cf7cb8@mail.gmail.com> Message-ID: deltacloud is not in java...as of now which i cannot integrate with java application. but with the help of opennebula.org hope i can do ? On Wed, Mar 24, 2010 at 10:11 PM, Alan Pevec wrote: > On Wed, Mar 24, 2010 at 3:12 AM, clouduser s > wrote: > > Before starting with Ovirt, i would like to discuss for the following > > queries, > > > > 1) Ovirt will support all OS ? > > 2) Can i integrate Ovirt with my java applications ? > > 3) I am looking for the open source tool that which i can integrate with > my > > java applications and manage cloud infrasturcture. > > 4) Managing the coloud infrastructure such as create image, deploy the > > image to cloud host provider ? > > 5) Using Ovirt can i deploy the image to EC2, private eucalyptus, > rackspace > > looks like deltacloud.org is what you need > > Alan > > ? > > _______________________________________________ > > Ovirt-devel mailing list > > Ovirt-devel at redhat.com > > https://www.redhat.com/mailman/listinfo/ovirt-devel > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dpierce at redhat.com Thu Mar 25 12:41:40 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 25 Mar 2010 08:41:40 -0400 Subject: [Ovirt-devel] [PATCH] Allow persistance of empty config files in ovirt_store_config In-Reply-To: <1269469009-12865-1-git-send-email-matinata@br.ibm.com> References: <1269469009-12865-1-git-send-email-matinata@br.ibm.com> Message-ID: <20100325124140.GL11702@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 24, 2010 at 07:16:49PM -0300, Ricardo Marin Matinata wrote: > This fix enables the persistance of empty configuration files during firstboot, in ovirt_store_config, so configuration files like ssh/ssl keys that are dynamically generated to well known locations can be pre set for persistance. > > Signed-off-by: Ricardo Marin Matinata > --- > scripts/ovirt-functions | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index 482441a..cecb359 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -496,7 +496,7 @@ ovirt_store_config() { > > if $persist_it; then > # skip if file does not exist or is empty > - if [ ! -s "${filename}" ]; then > + if [ ! -e "${filename}" ]; then > printf " Skipping, file '${filename}' does not exist or is empty\n" > continue > fi > -- > 1.6.6.1 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK - I'll push this upstream. Thank you. :) -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From apevec at gmail.com Thu Mar 25 13:28:54 2010 From: apevec at gmail.com (Alan Pevec) Date: Thu, 25 Mar 2010 14:28:54 +0100 Subject: [Ovirt-devel] [PATCH] Allow persistance of empty config files in ovirt_store_config In-Reply-To: <20100325124140.GL11702@mcpierce-desktop.usersys.redhat.com> References: <1269469009-12865-1-git-send-email-matinata@br.ibm.com> <20100325124140.GL11702@mcpierce-desktop.usersys.redhat.com> Message-ID: <2be7262f1003250628t203bd218rd85569c658d63e91@mail.gmail.com> On Thu, Mar 25, 2010 at 1:41 PM, Darryl L. Pierce wrote: >> ? ? ? ? ? ? ? ? ?# skip if file does not exist or is empty if changing logic, comments... >> - ? ? ? ? ? ? ? ?if [ ! -s "${filename}" ]; then >> + ? ? ? ? ? ? ? ?if [ ! -e "${filename}" ]; then >> ? ? ? ? ? ? ? ? ? ? ?printf " Skipping, file '${filename}' does not exist or is empty\n" ... and messages should be corrected >> ? ? ? ? ? ? ? ? ? ? ?continue >> ? ? ? ? ? ? ? ? ?fi > ACK - I'll push this upstream. Thank you. :) please hold with the push, soft nack from me for the moment, 0 size check was explicitly added in: commit 9a0b8ceb94784402c4acf5a5c92dfa0397b76dd7 Author: Alan Pevec Date: Sat Jan 31 00:12:47 2009 +0100 do not persist empty files empty config files confuse applications which don't expect them e.g. empty ifcfg-* or ssh_host_*key Empty configs show up after storage is reformatted, leaving placeholder empty files in rootfs. I need to check if that's still the case and find other solution. BTW, one important thing about stateless persistence: rc.sysinit will bind-mount only what's listed in /config/files AND if there's existing file in rootfs. mount_config, called in ovirt-early will also try to create target mount-points in rootfs (this works if parent dir is in rwtab, otherwise rootfs is read-only!) but this might be too late in some case e.g. additional persisted initscript won't be picked up since shell expansion /etc/rc$runlevel.d/S* in /etc/rc.d/rc was already done. So if you really need that the file exists, it should be included in the RPM or at least created in kickstart. Alan From matinata at br.ibm.com Thu Mar 25 16:49:56 2010 From: matinata at br.ibm.com (Ricardo Marin Matinata) Date: Thu, 25 Mar 2010 13:49:56 -0300 Subject: [Ovirt-devel] [PATCH] Allow persistance of empty config files in ovirt_store_config In-Reply-To: <2be7262f1003250628t203bd218rd85569c658d63e91@mail.gmail.com> References: <1269469009-12865-1-git-send-email-matinata@br.ibm.com> <20100325124140.GL11702@mcpierce-desktop.usersys.redhat.com> <2be7262f1003250628t203bd218rd85569c658d63e91@mail.gmail.com> Message-ID: <1269535796.4134.16.camel@localhost> On Thu, 2010-03-25 at 14:28 +0100, Alan Pevec wrote: > On Thu, Mar 25, 2010 at 1:41 PM, Darryl L. Pierce wrote: > >> # skip if file does not exist or is empty > if changing logic, comments... > > >> - if [ ! -s "${filename}" ]; then > >> + if [ ! -e "${filename}" ]; then > >> printf " Skipping, file '${filename}' does not exist or is empty\n" > ... and messages should be corrected > > >> continue > >> fi Agree... Re-sending below just in case... > This fix enables the persistence of empty configuration files during firstboot, in ovirt_store_config, so configuration files like ssh/ssl keys that are dynamically generated (i.e. content is not known until the node has booted at least one time) to well known locations can be pre set for persistence. Signed-off-by: Ricardo Marin Matinata --- scripts/ovirt-functions | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 482441a..1c3336d 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -495,9 +495,9 @@ ovirt_store_config() { fi if $persist_it; then - # skip if file does not exist or is empty - if [ ! -s "${filename}" ]; then - printf " Skipping, file '${filename}' does not exist or is empty\n" + # skip if file does not exist + if [ ! -e "${filename}" ]; then + printf " Skipping, file '${filename}' does not exist\n" continue fi # skip if already bind-mounted -- 1.6.6.1 > > > ACK - I'll push this upstream. Thank you. :) > > please hold with the push, soft nack from me for the moment, 0 size > check was explicitly added in: > > commit 9a0b8ceb94784402c4acf5a5c92dfa0397b76dd7 > Author: Alan Pevec > Date: Sat Jan 31 00:12:47 2009 +0100 > > do not persist empty files > > empty config files confuse applications which don't expect them > e.g. empty ifcfg-* or ssh_host_*key > > Empty configs show up after storage is reformatted, leaving placeholder > empty files in rootfs. > > I need to check if that's still the case and find other solution. > BTW, one important thing about stateless persistence: rc.sysinit will > bind-mount only what's listed in /config/files AND if there's existing > file in rootfs. > mount_config, called in ovirt-early will also try to create target > mount-points in rootfs (this works if parent dir is in rwtab, > otherwise rootfs is read-only!) > but this might be too late in some case e.g. additional persisted > initscript won't be picked up since shell expansion > /etc/rc$runlevel.d/S* in /etc/rc.d/rc was already done. > > So if you really need that the file exists, it should be included in > the RPM or at least created in kickstart. Agree with all of that, however solely adding the files to an RPM (or kickstart) would not solve the original problem this patch is all about: We don't know what will be in the file, until the node has actually booted once. As a mater of fact, ssh_host_*key files are among the ones we've been using this patch for... Of course, I?ll be glad to help if any other suggestions on how to do this ;) > > Alan -- Ricardo Marin Matinata Linux Technology Center IBM Brazil | Hortolandia | SP matinata br ibm com From dpierce at redhat.com Thu Mar 25 17:04:22 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 25 Mar 2010 13:04:22 -0400 Subject: [Ovirt-devel] [PATCH] Allow persistance of empty config files in ovirt_store_config In-Reply-To: <1269535796.4134.16.camel@localhost> References: <1269469009-12865-1-git-send-email-matinata@br.ibm.com> <20100325124140.GL11702@mcpierce-desktop.usersys.redhat.com> <2be7262f1003250628t203bd218rd85569c658d63e91@mail.gmail.com> <1269535796.4134.16.camel@localhost> Message-ID: <20100325170422.GM11702@mcpierce-desktop.usersys.redhat.com> On Thu, Mar 25, 2010 at 01:49:56PM -0300, Ricardo Marin Matinata wrote: > On Thu, 2010-03-25 at 14:28 +0100, Alan Pevec wrote: > > On Thu, Mar 25, 2010 at 1:41 PM, Darryl L. Pierce wrote: > > >> # skip if file does not exist or is empty > > if changing logic, comments... > > > > >> - if [ ! -s "${filename}" ]; then > > >> + if [ ! -e "${filename}" ]; then > > >> printf " Skipping, file '${filename}' does not exist or is empty\n" > > ... and messages should be corrected > > > > >> continue > > >> fi > > Agree... Re-sending below just in case... > > > > > This fix enables the persistence of empty configuration files during > firstboot, in ovirt_store_config, so configuration files like ssh/ssl > keys that are dynamically generated (i.e. content is not known until the > node has booted at least one time) to well known locations can be pre > set for persistence. Can you resend the patch by itself so that it doesn't get reformated? Thanks. :) -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From matinata at br.ibm.com Thu Mar 25 17:30:18 2010 From: matinata at br.ibm.com (Ricardo Marin Matinata) Date: Thu, 25 Mar 2010 14:30:18 -0300 Subject: [Ovirt-devel] [PATCH] Allow persistance of empty config files in ovirt_store_config v2 Message-ID: <1269538218-12341-1-git-send-email-matinata@br.ibm.com> This fix enables the persistance of empty configuration files during firstboot, in ovirt_store_config, so configuration files like ssh/ssl keys that are dynamically generated (i.e. content is not known until the node has booted at least one time) to well known locations can be pre set for persistance. Signed-off-by: Ricardo Marin Matinata --- scripts/ovirt-functions | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 482441a..1c3336d 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -495,9 +495,9 @@ ovirt_store_config() { fi if $persist_it; then - # skip if file does not exist or is empty - if [ ! -s "${filename}" ]; then - printf " Skipping, file '${filename}' does not exist or is empty\n" + # skip if file does not exist + if [ ! -e "${filename}" ]; then + printf " Skipping, file '${filename}' does not exist\n" continue fi # skip if already bind-mounted -- 1.6.6.1 From imain at redhat.com Thu Mar 25 18:39:26 2010 From: imain at redhat.com (Ian Main) Date: Thu, 25 Mar 2010 11:39:26 -0700 Subject: [Ovirt-devel] [PATCH] Added the new Processors agent. In-Reply-To: <1269288359-19370-2-git-send-email-dpierce@redhat.com> References: <1269288359-19370-1-git-send-email-dpierce@redhat.com> <1269288359-19370-2-git-send-email-dpierce@redhat.com> Message-ID: <1269542366.18575.19.camel@localhost.localdomain> On Mon, 2010-03-22 at 16:05 -0400, Darryl L. Pierce wrote: > The Processors agent reports details regarding the processing power for > the managed node. > > Defined the agent within schema.xml. Wrote the wrapper code to create > and populate an instance of the agent. > > The properties for the Processors agent have also been trimmed back to > what is readily available via HAL. A future fix will replace this with > calls to sysfs. ACK Ian From dpierce at redhat.com Thu Mar 25 18:42:57 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 25 Mar 2010 14:42:57 -0400 Subject: [Ovirt-devel] [PATCH] Added the new Processors agent. In-Reply-To: <1269542366.18575.19.camel@localhost.localdomain> References: <1269288359-19370-1-git-send-email-dpierce@redhat.com> <1269288359-19370-2-git-send-email-dpierce@redhat.com> <1269542366.18575.19.camel@localhost.localdomain> Message-ID: <20100325184257.GO11702@mcpierce-desktop.usersys.redhat.com> On Thu, Mar 25, 2010 at 11:39:26AM -0700, Ian Main wrote: > On Mon, 2010-03-22 at 16:05 -0400, Darryl L. Pierce wrote: > > The Processors agent reports details regarding the processing power for > > the managed node. > > > > Defined the agent within schema.xml. Wrote the wrapper code to create > > and populate an instance of the agent. > > > > The properties for the Processors agent have also been trimmed back to > > what is readily available via HAL. A future fix will replace this with > > calls to sysfs. > > ACK Thanks. This is now pushed to next. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From apevec at gmail.com Thu Mar 25 22:21:46 2010 From: apevec at gmail.com (Alan Pevec) Date: Thu, 25 Mar 2010 23:21:46 +0100 Subject: [Ovirt-devel] [PATCH] Added the new Processors agent. In-Reply-To: <20100325184257.GO11702@mcpierce-desktop.usersys.redhat.com> References: <1269288359-19370-1-git-send-email-dpierce@redhat.com> <1269288359-19370-2-git-send-email-dpierce@redhat.com> <1269542366.18575.19.camel@localhost.localdomain> <20100325184257.GO11702@mcpierce-desktop.usersys.redhat.com> Message-ID: <2be7262f1003251521u4fc03e8g17bc8e062c555b16@mail.gmail.com> On Thu, Mar 25, 2010 at 7:42 PM, Darryl L. Pierce wrote: > Thanks. This is now pushed to next. When posting patches, please set in your git clones format.subjectprefix to PATCH _repo_name_ so it's clear which repository is it about :) e.g [PATCH node] [PATCH matahari] ... Thanks, Alan From mburns at redhat.com Fri Mar 26 13:09:42 2010 From: mburns at redhat.com (Mike Burns) Date: Fri, 26 Mar 2010 09:09:42 -0400 Subject: [Ovirt-devel] [PATCH node] Use vg uuid when detecting whether vg spans multiple disks Message-ID: <1269608982-9047-1-git-send-email-mburns@redhat.com> In the case where there are multiple volume groups with the same name, the only way to differentiate is with the uuid. Now we will compare uuid's so we don't report the the vg spans multiple disks when it's a duplicate id. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 8d59a6b..9d8c482 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -563,9 +563,9 @@ wipe_lvm_on_disk() if [[ "$dev" =~ "/dev/sd" ]]; then part_delim="" fi - for vg in $(pvs -o vg_name --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do - if pvs -o pv_name,vg_name --noheadings | \ - grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then + for vg in $(pvs -o vg_uuid --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do + if pvs -o pv_name,vg_uuid --noheadings | \ + grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev} " 2>/dev/null; then log "The volume group \"$vg\" spans multiple disks." log "This operation cannot complete. Please manually" log "cleanup the storage using standard linux tools." -- 1.6.6.1 From mburns at redhat.com Fri Mar 26 16:50:03 2010 From: mburns at redhat.com (Mike Burns) Date: Fri, 26 Mar 2010 12:50:03 -0400 Subject: [Ovirt-devel] [PATCH node] fix typo /dev/null in common-post.ks Message-ID: <1269622203-17918-1-git-send-email-mburns@redhat.com> Signed-off-by: Mike Burns --- recipe/common-post.ks | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/recipe/common-post.ks b/recipe/common-post.ks index c6ef496..411e565 100644 --- a/recipe/common-post.ks +++ b/recipe/common-post.ks @@ -172,7 +172,7 @@ EOF #use all hard-coded defaults for multipath -cat /dev/mull > /etc/multipath.conf +cat /dev/null > /etc/multipath.conf #lvm.conf should use /dev/mapper and /dev/sdX devices # and not /dev/dm-X devices -- 1.6.6.1 From dpierce at redhat.com Fri Mar 26 17:04:14 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 26 Mar 2010 13:04:14 -0400 Subject: [Ovirt-devel] [PATCH node] fix typo /dev/null in common-post.ks In-Reply-To: <1269622203-17918-1-git-send-email-mburns@redhat.com> References: <1269622203-17918-1-git-send-email-mburns@redhat.com> Message-ID: <20100326170414.GB2948@mcpierce-desktop.usersys.redhat.com> On Fri, Mar 26, 2010 at 12:50:03PM -0400, Mike Burns wrote: > > Signed-off-by: Mike Burns > --- > recipe/common-post.ks | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/recipe/common-post.ks b/recipe/common-post.ks > index c6ef496..411e565 100644 > --- a/recipe/common-post.ks > +++ b/recipe/common-post.ks > @@ -172,7 +172,7 @@ EOF > > > #use all hard-coded defaults for multipath > -cat /dev/mull > /etc/multipath.conf > +cat /dev/null > /etc/multipath.conf > > #lvm.conf should use /dev/mapper and /dev/sdX devices > # and not /dev/dm-X devices > -- > 1.6.6.1 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Fri Mar 26 19:28:14 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 26 Mar 2010 15:28:14 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. Message-ID: <1269631694-21692-1-git-send-email-dpierce@redhat.com> Added a new subdirectory called "isobuilder" to the project. Created a new Makefile that only allows for creating the livecd version of the oVirt node. Adjusted the build environment to work with the kickstart files that are found in the repo and not ones installed via any previous RPM. Signed-off-by: Darryl L. Pierce --- configure.ac | 1 + isobuilder/Makefile.am | 103 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 0 deletions(-) create mode 100644 isobuilder/Makefile.am diff --git a/configure.ac b/configure.ac index b6e0973..6957a03 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,7 @@ test x"$ac_ct_CC:$CFLAGS" = 'xgcc:-g -O2' \ AC_CONFIG_FILES([Makefile images/Makefile + isobuilder/Makefile kinit/Makefile nodeadmin/Makefile scripts/Makefile diff --git a/isobuilder/Makefile.am b/isobuilder/Makefile.am new file mode 100644 index 0000000..ec4aab3 --- /dev/null +++ b/isobuilder/Makefile.am @@ -0,0 +1,103 @@ +# Copyright (C) 2008 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +OVIRT_CACHE_DIR ?= $(HOME)/ovirt-cache +OVIRT_LOCAL_REPO ?= file://$(OVIRT_CACHE_DIR)/ovirt +OVIRT_NODE_RECIPE ?= ../recipe/ovirt-node-recipe.ks +SUM ?= sha1sum +PKG_FMT = iso +SRC_FMT ?= tar +AUTH_KEYS ?= ~/.ssh/authorized_keys +PACKAGE = ovirt-node-image + +ARCH = $(shell rpm --eval '%{_arch}') + +NVR = $(PACKAGE)-$(VERSION)-$(ARCH) + +# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT- +# annotated rpm version strings. +_ovirt_dev = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) + +git_head = $$(git log -1 --pretty=format:%h) +GIT_RELEASE = $(shell date --utc +%Y%m%d%H%M%S)git$(git_head) +RPMDIR = $$(rpm --eval '%{_rpmdir}') +RPM_FLAGS = --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)" +RPM_FLAGS += $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)") +NODE_TMP = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp +SRC_KS = $(NODE_TMP)/src.ks +NODE_KS = $(NODE_TMP)/node.ks + +all: $(PACKAGE).$(PKG_FMT) + +keys: + if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \ + cp -va $(AUTH_KEYS) ovirt-authorized_keys ;\ + fi + +no_nscd: + if pgrep -xl nscd; then \ + echo "Please stop nscd" ;\ + exit 1 ;\ + fi + +SELINUX_ENFORCING=$(shell /usr/sbin/getenforce) +$(NVR).$(PKG_FMT): no_nscd keys + mkdir -p $(NODE_TMP) + mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH) + ( \ + case $(SELINUX_ENFORCING) in \ + Enforcing) sudo /usr/sbin/setenforce Permissive ;; \ + Permissive) ;; \ + *) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \ + then \ + echo WARNING: SELinux disabled in kickstart ;\ + else \ + echo ERROR: SELinux enabled in kickstart, \ + but disabled on the build machine ;\ + exit 1 ;\ + fi ;; \ + esac ;\ + ) + rm -f $(NODE_KS) + if [ "$(_ovirt_dev)" = 1 ]; then \ + echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\ + fi + cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS) + sudo livecd-creator --skip-minimize -c $(NODE_KS)\ + -f $(PACKAGE) \ + --tmpdir='$(NODE_TMP)' \ + --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)' + sudo chown $${USER} $(PACKAGE).$(PKG_FMT) + ( \ + if [ $(SELINUX_ENFORCING) = Enforcing ]; then \ + sudo /usr/sbin/setenforce Enforcing || exit 1 ;\ + fi \ + ) + + ln -nf $(PACKAGE).$(PKG_FMT) $(NVR).$(PKG_FMT) + +$(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) + $(SUM) $(NVR).$(PKG_FMT) > $(NVR).$(PKG_FMT).$(SUM) + +$(PACKAGE).$(PKG_FMT) node: $(NVR).$(PKG_FMT).$(SUM) + +PUNGI = $(NODE_TMP)/tree/pungi + +.PHONY: $(NVR).$(PKG_FMT).$(SUM) $(NVR).$(PKG_FMT) \ + $(PACKAGE).$(PKG_FMT) keys src.ks no_nscd -- 1.6.6.1 From apevec at redhat.com Fri Mar 26 20:46:04 2010 From: apevec at redhat.com (Alan Pevec) Date: Fri, 26 Mar 2010 21:46:04 +0100 Subject: [Ovirt-devel] [PATCH node] avoid fedora-release conflict Message-ID: <1269636364-14909-1-git-send-email-apevec@redhat.com> move banner modification to kickstart %post --- ovirt-node.spec.in | 14 +------------- recipe/ovirt-node-image.ks | 9 +++++++++ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index 032a5a9..eaf52cc 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -154,25 +154,17 @@ python nodeadmin/setup.py install --root %{buildroot} echo "oVirt Node release %{version}-%{release}" > %{buildroot}%{_sysconfdir}/ovirt-release mkdir -p %{buildroot}/%{_sysconfdir}/default -echo "# File where default partitioning info is kept" > %{buildroot}/%{_sysconfdir}/default/ovirt +echo "# File where default configuration is kept" > %{buildroot}/%{_sysconfdir}/default/ovirt # ovirt-logos # should be ifarch i386 -mkdir -p %{buildroot}/boot/grub install -p -m 644 images/grub-splash.xpm.gz %{buildroot}%{app_root} # end i386 bits -mkdir -p %{buildroot}/usr/lib/anaconda-runtime install -p -m 644 images/syslinux-vesa-splash.jpg %{buildroot}%{app_root} # ovirt-logos # release files echo "%{product_family} release %{version}%{?beta: %{beta}} (%{release})" > %{buildroot}/etc/ovirt-release -cp %{buildroot}/etc/ovirt-release %{buildroot}/etc/issue -echo "Kernel \r on an \m (\l)" >> %{buildroot}/etc/issue -cp %{buildroot}/etc/issue %{buildroot}/etc/issue.net -echo >> %{buildroot}/etc/issue -ln -s ovirt-release %{buildroot}/etc/redhat-release -ln -s ovirt-release %{buildroot}/etc/system-release # ovirt-config-boot post-install hooks %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-config-boot.d @@ -247,10 +239,6 @@ fi %defattr(-,root,root) %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/ovirt-release %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/default/ovirt -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/redhat-release -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/system-release -%config(noreplace) %attr(0644,root,root) /etc/issue -%config(noreplace) %attr(0644,root,root) /etc/issue.net %config(noreplace) %{_sysconfdir}/logrotate.d/ovirt-node %config(noreplace) %{_sysconfdir}/cron.d/ovirt-logrotate diff --git a/recipe/ovirt-node-image.ks b/recipe/ovirt-node-image.ks index 270eb77..7c9361c 100644 --- a/recipe/ovirt-node-image.ks +++ b/recipe/ovirt-node-image.ks @@ -84,6 +84,15 @@ linux0==1 && $1=="label" && $2!="linux0" { mv $LIVE_ROOT/isolinux/isolinux.cfg.standalone $LIVE_ROOT/isolinux/isolinux.cfg cp $INSTALL_ROOT/usr/share/ovirt-node/syslinux-vesa-splash.jpg $LIVE_ROOT/isolinux/splash.jpg + +# overwrite user visible banners with the image versioning info +PACKAGE=ovirt +ln -snf $PACKAGE-release $INSTALL_ROOT/etc/redhat-release +ln -snf $PACKAGE-release $INSTALL_ROOT/etc/system-release +cp $INSTALL_ROOT/etc/$PACKAGE-release $INSTALL_ROOT/etc/issue +echo "Kernel \r on an \m (\l)" >> $INSTALL_ROOT/etc/issue +cp $INSTALL_ROOT/etc/issue $INSTALL_ROOT/etc/issue.net + %end %post -- 1.6.0.6 From dpierce at redhat.com Fri Mar 26 21:31:08 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 26 Mar 2010 17:31:08 -0400 Subject: [Ovirt-devel] Updated patch... Message-ID: <1269639069-842-1-git-send-email-dpierce@redhat.com> This supercedes the previous patch by incorporating feedback from pmyers and apevec. The ISO building target is in the recipes Makefile rather than a separate one. From dpierce at redhat.com Fri Mar 26 21:31:09 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 26 Mar 2010 17:31:09 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <1269639069-842-1-git-send-email-dpierce@redhat.com> References: <1269639069-842-1-git-send-email-dpierce@redhat.com> Message-ID: <1269639069-842-2-git-send-email-dpierce@redhat.com> The ISO can now be built by going into the recipe directory and building the ovirt-node-image.iso target. Signed-off-by: Darryl L. Pierce --- recipe/Makefile.am | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/recipe/Makefile.am b/recipe/Makefile.am index c8a7b94..a925f01 100644 --- a/recipe/Makefile.am +++ b/recipe/Makefile.am @@ -7,6 +7,14 @@ OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) FEDORA = $(shell rpm --eval '%{fedora}') ARCH = $(shell rpm --eval '%{_arch}') +OVIRT_NODE_RECIPE = ovirt-node-recipe.ks +PKG_FMT = iso +PACKAGE = ovirt-node-image +NODE_TMP = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp +OVIRT_LOCAL_REPO ?= file://$(OVIRT_CACHE_DIR)/ovirt +NODE_KS = $(NODE_TMP)/node.ks +NVR = $(PACKAGE)-$(VERSION)-$(ARCH) +SUM ?= sha1sum OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools OVIRT_NODE_TOOLS_DATA = \ @@ -51,4 +59,64 @@ ovirt-node-recipe.ks: # XXX broken ksflatten leaves %include sed -i 's/^%include /#&/' $@ +keys: + if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \ + cp -va $(AUTH_KEYS) ovirt-authorized_keys ;\ + fi + +no_nscd: + if pgrep -xl nscd; then \ + echo "Please stop nscd" ;\ + exit 1 ;\ + fi + +# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT- +# annotated rpm version strings. +_ovirt_dev = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(srcdir)/*.spec.in && echo 1 || :) + +SELINUX_ENFORCING=$(shell /usr/sbin/getenforce) +$(NVR).$(PKG_FMT): no_nscd keys + mkdir -p $(NODE_TMP) + mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH) + ( \ + case $(SELINUX_ENFORCING) in \ + Enforcing) sudo /usr/sbin/setenforce Permissive ;; \ + Permissive) ;; \ + *) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \ + then \ + echo WARNING: SELinux disabled in kickstart ;\ + else \ + echo ERROR: SELinux enabled in kickstart, \ + but disabled on the build machine ;\ + exit 1 ;\ + fi ;; \ + esac ;\ + ) + rm -f $(NODE_KS) + if [ "$(_ovirt_dev)" = 1 ]; then \ + echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\ + fi + cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS) + sudo livecd-creator --skip-minimize -c $(NODE_KS)\ + -f $(PACKAGE) \ + --tmpdir='$(NODE_TMP)' \ + --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)' + sudo chown $${USER} $(PACKAGE).$(PKG_FMT) + ( \ + if [ $(SELINUX_ENFORCING) = Enforcing ]; then \ + sudo /usr/sbin/setenforce Enforcing || exit 1 ;\ + fi \ + ) + + ln -nf $(PACKAGE).$(PKG_FMT) $(NVR).$(PKG_FMT) + +$(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) + $(SUM) $(NVR).$(PKG_FMT) > $(NVR).$(PKG_FMT).$(SUM) + +$(PACKAGE).$(PKG_FMT) node: ovirt-node-recipe.ks $(NVR).$(PKG_FMT).$(SUM) + +PUNGI = $(NODE_TMP)/tree/pungi + .PHONY: ovirt-node-recipe.ks repos.ks -- 1.6.6.1 From pmyers at redhat.com Fri Mar 26 22:05:12 2010 From: pmyers at redhat.com (Perry Myers) Date: Fri, 26 Mar 2010 18:05:12 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <1269639069-842-2-git-send-email-dpierce@redhat.com> References: <1269639069-842-1-git-send-email-dpierce@redhat.com> <1269639069-842-2-git-send-email-dpierce@redhat.com> Message-ID: <4BAD2F98.2070306@redhat.com> On 03/26/2010 05:31 PM, Darryl L. Pierce wrote: > The ISO can now be built by going into the recipe directory and building > the ovirt-node-image.iso target. Doesn't this still need a patch to configure.ac to add recipe/Makefile to be generated from recipe/Makefile.am? Also, shouldn't we with this patch also take care of adding the resulting recipe/Makefile to the ovirt-node-recipe so that it gets installed to /usr/share along with the kickstarts? > Signed-off-by: Darryl L. Pierce > --- > recipe/Makefile.am | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 68 insertions(+), 0 deletions(-) > > diff --git a/recipe/Makefile.am b/recipe/Makefile.am > index c8a7b94..a925f01 100644 > --- a/recipe/Makefile.am > +++ b/recipe/Makefile.am > @@ -7,6 +7,14 @@ OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) > > FEDORA = $(shell rpm --eval '%{fedora}') > ARCH = $(shell rpm --eval '%{_arch}') > +OVIRT_NODE_RECIPE = ovirt-node-recipe.ks > +PKG_FMT = iso > +PACKAGE = ovirt-node-image > +NODE_TMP = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp > +OVIRT_LOCAL_REPO ?= file://$(OVIRT_CACHE_DIR)/ovirt > +NODE_KS = $(NODE_TMP)/node.ks > +NVR = $(PACKAGE)-$(VERSION)-$(ARCH) > +SUM ?= sha1sum > > OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools > OVIRT_NODE_TOOLS_DATA = \ > @@ -51,4 +59,64 @@ ovirt-node-recipe.ks: > # XXX broken ksflatten leaves %include > sed -i 's/^%include /#&/' $@ > > +keys: > + if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \ > + cp -va $(AUTH_KEYS) ovirt-authorized_keys ;\ > + fi > + > +no_nscd: > + if pgrep -xl nscd; then \ > + echo "Please stop nscd" ;\ > + exit 1 ;\ > + fi > + > +# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT- > +# annotated rpm version strings. > +_ovirt_dev = \ > + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ > + $(srcdir)/*.spec.in && echo 1 || :) > + > +SELINUX_ENFORCING=$(shell /usr/sbin/getenforce) > +$(NVR).$(PKG_FMT): no_nscd keys > + mkdir -p $(NODE_TMP) > + mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH) > + ( \ > + case $(SELINUX_ENFORCING) in \ > + Enforcing) sudo /usr/sbin/setenforce Permissive ;; \ > + Permissive) ;; \ > + *) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \ > + then \ > + echo WARNING: SELinux disabled in kickstart ;\ > + else \ > + echo ERROR: SELinux enabled in kickstart, \ > + but disabled on the build machine ;\ > + exit 1 ;\ > + fi ;; \ > + esac ;\ > + ) > + rm -f $(NODE_KS) > + if [ "$(_ovirt_dev)" = 1 ]; then \ > + echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\ > + fi > + cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS) > + sudo livecd-creator --skip-minimize -c $(NODE_KS)\ > + -f $(PACKAGE) \ > + --tmpdir='$(NODE_TMP)' \ > + --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)' > + sudo chown $${USER} $(PACKAGE).$(PKG_FMT) > + ( \ > + if [ $(SELINUX_ENFORCING) = Enforcing ]; then \ > + sudo /usr/sbin/setenforce Enforcing || exit 1 ;\ > + fi \ > + ) > + > + ln -nf $(PACKAGE).$(PKG_FMT) $(NVR).$(PKG_FMT) > + > +$(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) > + $(SUM) $(NVR).$(PKG_FMT) > $(NVR).$(PKG_FMT).$(SUM) > + > +$(PACKAGE).$(PKG_FMT) node: ovirt-node-recipe.ks $(NVR).$(PKG_FMT).$(SUM) > + > +PUNGI = $(NODE_TMP)/tree/pungi > + > .PHONY: ovirt-node-recipe.ks repos.ks From mburns at redhat.com Fri Mar 26 22:25:26 2010 From: mburns at redhat.com (Mike Burns) Date: Fri, 26 Mar 2010 18:25:26 -0400 Subject: [Ovirt-devel] [PATCH node] Update autobuild and autotest scripts for new build structure Message-ID: <1269642326-3751-1-git-send-email-mburns@redhat.com> Autobuild has to be updated to call make in the recipe directory and move the resulting iso to the main build directory. Importing the existing autotest.sh script from ovirt-node-image Signed-off-by: Mike Burns --- autobuild.sh | 7 + autotest.sh | 764 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 771 insertions(+), 0 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 0ac1e58..8517164 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -41,3 +41,10 @@ if [ -f /usr/bin/rpmbuild ]; then fi rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean *.tar.gz fi + +#make iso +cd recipe +make + +#copy iso back to main directory for autotest.sh +cp *iso .. diff --git a/autotest.sh b/autotest.sh index 05a7907..32a60d9 100755 --- a/autotest.sh +++ b/autotest.sh @@ -1,2 +1,766 @@ #!/bin/bash +# +# oVirt node autotest script +# +# Copyright (C) 2009 Red Hat, Inc. +# Written by Darryl L. Pierce +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. +# To include autotesting on the build system, you need to insert the +# following snippet *BEFORE* the text that reads "Output Stages": +# ---8<[begin]--- +# # Integration test +# { +# name = integration +# label = Test group +# module = Test::AutoBuild::Stage::Test +# # Don't abort entire cycle if the module test fails +# critical = 0 +# } +# ---8<[end]--- +# +# This will, for each module whose autobuild.sh is run, to have a matching +# autotest.sh to run as well. +# +# To run these tests locally, you will need to open port 69 TCP and UDP and have +# an ISO file. + +ME=$(basename "$0") +WORKDIR=$(mktemp -d) +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } +debug() { if $debugging; then log "[DEBUG] %s" "$*"; fi } + +trap '__st=$?; cleanup_after_testing; exit $__st' 1 2 3 13 15 +trap 'cleanup_after_testing' 0 + +# set -e +# set -u + +log () { + date=$(date) + printf "${date} $*\n" +} + +usage () { + cat < /dev/null 2>&1 + sudo chmod -R 777 $workdir + + # set default kernel arguments if none were provided + # the defaults boot in standalone mode + if [ -z "$kernelargs" ]; then + kernelargs="standalone" + fi + + local definition="DEFAULT pxeboot" + definition="${definition}\nTIMEOUT 20" + definition="${definition}\nPROMPT 0" + definition="${definition}\nLABEL pxeboot" + definition="${definition}\n KERNEL vmlinuz0" + definition="${definition}\n IPAPPEND 2" + definition="${definition}\n APPEND rootflags=loop initrd=initrd0.img root=/${isoname} rootfstype=auto console=tty0 check console=ttyS0,115200n8 $kernelargs" + + debug "pxeboot definition=\n${definition}" + sudo bash -c "printf \"${definition}\" > $pxedefault" +} + +# Starts a simple instance of dnsmasq. +# $1 - the iface on which dnsmasq works +# $2 - the root for tftp files +# $3 - the mac address for the node (ignored if blank) +# $4 - the nodename +start_dnsmasq () { + local iface=$1 + local tftproot=$2 + local macaddress=$3 + local nodename=$4 + local pidfile=$2/dnsmasq.pid + + stop_dnsmasq + debug "Starting dnsmasq" + dns_startup="sudo /usr/sbin/dnsmasq --read-ethers + --dhcp-range=${NETWORK}.100,${NETWORK}.254,255.255.255.0,24h + --conf-file= + --interface=${iface} + --bind-interfaces + --except-interface=lo + --dhcp-boot=tftpboot/pxelinux.0 + --enable-tftp + --tftp-root=${tftproot} + --log-facility=$WORKDIR/dnsmasq-${nodename}.log + --log-queries + --log-dhcp + --pid-file=${pidfile}" + if [ -n "$macaddress" ]; then + dns_startup="${dns_startup} --dhcp-host=${macaddress},${NODE_ADDRESS}" + fi + # start dnsmasq + eval $dns_startup + debug "pidfile=$pidfile" + DNSMASQ_PID=$(sudo cat $pidfile) + debug "DNSMASQ_PID=${DNSMASQ_PID}" +} + +# Kills the running instance of dnsmasq. +stop_dnsmasq () { + if [ -n "${DNSMASQ_PID-}" -a "${DNSMASQ_PID-}" != "0" ]; then + local check=$(ps -ef | awk "/${DNSMASQ_PID}/"' { if ($2 ~ '"${DNSMASQ_PID}"') print $2 }') + + if [[ "${check}" == "${DNSMASQ_PID}" ]]; then + sudo kill -9 $DNSMASQ_PID + return + fi + fi + DNSMASQ_PID="0" +} + +# Creates a virt network. +# $1 - the node name +# $2 - the network interface name +# $3 - use DHCP (any value) +# $4 - start dnsmsq (def. false) +start_networking () { + local nodename=$1 + local ifacename=$2 + local use_dhcp=${3-false} + local start_dnsmasq=${4-false} + local workdir=$5 + local definition="" + local network=$NETWORK + local xmlfile=$WORKDIR/$nodename-$ifacename.xml + + debug "start_networking ()" + for var in nodename ifacename use_dhcp start_dnsmasq workdir network xmlfile; do + eval debug "::$var: \$$var" + done + + definition="\n${ifacename}\n\n" + definition="${definition}\n" + if $use_dhcp; then + definition="${definition}\n\n\n" + fi + definition="${definition}\n\n" + + debug "Saving network definition file to: ${xmlfile}\n" + sudo printf "${definition}" > $xmlfile + sudo virsh net-define $xmlfile > /dev/null 2>&1 + debug "Starting network." + sudo virsh net-start $ifacename > /dev/null 2>&1 + + if [ "${use_dhcp}" == "false" ]; then + if $start_dnsmasq; then + start_dnsmasq $ifacename $workdir "" $nodename + fi + fi +} + +# Destroys the test network interface +# $1 - the network name +# $2 - stop dnsmasq (def. false) +stop_networking () { + local networkname=${1-} + local stop_dnsmasq=${2-true} + + # if no network was supplied, then check for the global network + if [ -z "$networkname" ]; then + networkname=${NETWORK_NAME-} + fi + + # exit if preserve was enabled + if $preserve_vm; then return; fi + + if [ -n "${networkname}" ]; then + debug "Destroying network interface: ${networkname}" + check=$(sudo virsh net-list --all) + if [[ "${check}" =~ "${networkname}" ]]; then + if [[ "{$check}" =~ active ]]; then + sudo virsh net-destroy $networkname > /dev/null 2>&1 + fi + sudo virsh net-undefine $networkname > /dev/null 2>&1 + fi + fi + + if $stop_dnsmasq; then + stop_dnsmasq + fi +} + +# creates a HD disk file +# $1 - filename for disk file +# $2 - size (##M or ##G) +create_hard_disk () { + local filename=$1 + local size=$2 + + debug "Creating hard disk: filename=${filename} size=${size}" + sudo qemu-img create -f raw $filename "${size}M" > /dev/null 2>&1 + sudo chcon -t virt_image_t $filename > /dev/null 2>&1 +} + +# Creates the XML for a virtual machine. +# $1 - the file to write the xml +# $2 - the node name +# $3 - memory size (in kb) +# $4 - boot device +# $5 - the local hard disk (if blank then no disk is used) +# $6 - the cdrom disk (if blank then no cdrom is used) +# $7 - the network bridge (if blank then 'default' is used) +# $8 - optional arguments +define_node () { + local filename=$1 + local nodename=$2 + local memory=$3 + local boot_device=$4 + local harddrive=$5 + local cddrive=$6 + local bridge=${7-default} + local options=${8-} + local result="" + + # flexible options + # define defaults, then allow the caller to override them as needed + local arch=$(uname -i) + local serial="true" + local vncport="-1" + local bootdev='hd' + + # first destroy the node + destroy_node $nodename + + if [ -n "$options" ]; then eval "$options"; fi + + debug "define_node ()" + for var in filename nodename memory harddrive cddrive bridge options arch serial vncport bootdev; do +eval debug "::$var: \$$var" + done + + result="\n${nodename}\n${memory}\n 1" + + # begin the os section + # inject the boot device + result="${result}\n\nhvm" + result="${result}\n" + result="${result}\n" + + # virtual machine features + result="${result}\n" + result="${result}\n" + if [ -z "${noapic-}" ]; then result="${result}\n"; fi + result="${result}\n" + result="${result}\n" + result="${result}\ndestroy" + result="${result}\nrestart" + result="${result}\nrestart" + + # add devices + result="${result}\n" + # inject the hard disk if defined + if [ -n "$harddrive" ]; then + debug "Adding a hard drive to the node" + result="${result}\n" + result="${result}\n" + result="${result}\n" + result="${result}\n" + fi + # inject the cdrom drive if defined + if [ -n "$cddrive" ]; then + debug "Adding a CDROM drive to the node" + result="${result}\n" + result="${result}\n" + result="${result}\n" + result="${result}\n" + fi + # inject the bridge network + result="${result}\n" + result="${result}\n" + result="${result}\n" + # inject the serial port + if [ -n "$serial" ]; then + result="${result}\n" + fi + # inject the vnc port + if [ -n "$vncport" ]; then + result="${result}\n" + result="${result}\n" + fi + # finish the device section + result="${result}\n" + + result="${result}\n" + + debug "Node definition: ${filename}" + sudo printf "$result" > $filename + + # now define the vm + sudo virsh define $filename > /dev/null 2>&1 + + if [ $? != 0 ]; then die "Unable to define virtual machine: $nodename"; fi +} + +# $1 - the node name +# $2 - the boot device (def. "hd") +# $3 - the memory size in kb (def. 524288) +# $4 - hard disk size (if blank then no hard disk) +# $5 - the cd drive image file (if blank then no cd drive) +# $6 - option arguments +configure_node () { + local nodename=$1 + local boot_device=$2 + local memory=$3 + local hdsize=$4 + local hdfile="" + local cdfile=$5 + local args=$6 + local nodefile=$WORKDIR/$nodename.xml + + if [ -z "${boot_device}" ]; then boot_device="hd"; fi + if [ -z "${memory}" ]; then memory="524288"; fi + + debug "configure_node ()" + for var in nodename boot_device memory hdsize hdfile cdfile args nodefile; do + eval debug "::$var: \$$var" + done + + # create the hard disk file + if [ -n "${hdsize}" ]; then + hdfile=$WORKDIR/$nodename-hd.img + create_hard_disk $hdfile $hdsize + fi + + define_node $nodefile $nodename "${memory}" "${boot_device}" "${hdfile}" "${cdfile}" $IFACE_NAME "${args}" +} + +# $1 - the node name +# $2 - undefine the node (def. true) +destroy_node () { + local nodename=$1 + local undefine=${2-true} + + # if preserving nodes then exit + if $preserve_vm; then return; fi + + if [ -n "${nodename}" ]; then + check=$(sudo virsh list --all) + if [[ "${check}" =~ "${nodename}" ]]; then + if [[ "${check}" =~ running ]]; then + sudo virsh destroy $nodename > /dev/null 2>&1 + fi + if $undefine; then + sudo virsh undefine $nodename > /dev/null 2>&1 + fi + fi + fi +} + +# for each test created, add it to the follow array: +tests=''; testcount=0; + +# $1 - test name +add_test () { + tests="${tests} $1" +} + +# $1 - node name +start_virt_viewer () { + local nodename=$1 + + sudo virt-viewer $nodename > /dev/null 2>&1& +} + +# $1 - the node's name +# $2 - kernel arguments +# $3 - working directory +boot_with_pxe () { + local nodename=$1 + local kernel_args=$2 + local workdir=$3 + + debug "boot_with_pxe ()" + debug "- workdir: ${workdir}" + debug "- nodename: ${nodename}" + debug "- kernel_args: ${kernel_args}" + + setup_pxeboot $workdir "${kernel_args}" + + sudo virsh start $nodename > /dev/null 2>&1 + if $show_viewer; then + start_virt_viewer $nodename + fi +} + +# $1 - the node's name +boot_from_hd () { + local nodename=$1 + + debug "boot_from_hd ()" + debug "::nodename: ${nodename}" + + sudo virsh start $nodename > /dev/null 2>&1 + if $show_viewer; then + start_virt_viewer $nodename + fi +} + +# $1 - the node name +# $2 - the old boot device +# $3 - the new boot device +substitute_boot_device () { + local nodename=$1 + local old_device=$2 + local new_device=$3 + local new_node_file=$WORKDIR/$nodename-new.xml + + if [ -n "${nodename}" ]; then + local xml=$(sudo virsh dumpxml $nodename | sed "s/boot dev='"${old_device}"'/boot dev='"${new_device}"'/") + + sudo printf "${xml}" > $new_node_file + + sudo virsh define $new_node_file + fi +} + +add_test "test_stateless_pxe" +test_stateless_pxe () { + local nodename="${vm_prefix}-stateless-pxe" + local workdir=$WORKDIR + + start_networking $nodename $IFACE_NAME false true $workdir + + configure_node "${nodename}" "network" "" "10000" "" "local noapic=true" + boot_with_pxe "${nodename}" "standalone firstboot=no" "${workdir}" + + expect -c ' +set timeout '${timeout_period}' + +log_file -noappend stateless-pxe.log + +spawn sudo virsh console '"${nodename}"' + +expect { + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } + -re "localhost.*login:" { send_log "\n\nMarker 5\n\n"; exit } + timeout { +send_log "\nTimeout waiting for marker..\n\n" +exit 1 + } eof { +send_log "Unexpected end of file." +exit 2 + } +} + +send_log "\n\nUnexpected end of interaction.\n\n" +exit 3' + result=$? + + destroy_node $nodename + stop_networking $IFACE_NAME true + + return $result +} + +add_test "test_stateless_pxe_with_nohd" +test_stateless_pxe_with_nohd () { + local nodename="${vm_prefix}-stateless-pxe-nohd" + local workdir=$WORKDIR + + start_networking $nodename $IFACE_NAME false true $workdir + + configure_node "${nodename}" "network" "" "" "" "local noapic=true" + boot_with_pxe "${nodename}" "firstboot=no" "${workdir}" + + expect -c ' +set timeout '${timeout_period}' + +log_file -noappend stateless-pxe.log + +spawn sudo virsh console '"${nodename}"' + +expect { + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } + -re "localhost.*login:" { send_log "\n\nMarker 5\n\n"; exit } + timeout { + send_log "\nTimeout waiting for marker..\n\n" + exit 1 + } eof { + send_log "Unexpected end of file." + exit 2 + } +} + +send_log "\n\nUnexpected end of interaction.\n\n" +exit 3' + + result=$? + + destroy_node $nodename + stop_networking $IFACE_NAME true + + return $result +} + +add_test "test_stateful_pxe" +test_stateful_pxe () { + local nodename="${vm_prefix}-stateful-pxe" + local workdir=$WORKDIR + local ipaddress=${NODE_ADDRESS} + + for var in nodename workdir ipaddress; do + eval debug "::\$$var: $var" + done + + start_networking $nodename $IFACE_NAME false true $workdir + + configure_node "${nodename}" "network" "" "10000" "" "local noapic=true" + boot_with_pxe "${nodename}" "standalone storage_init=/dev/vda local_boot ip=${ipaddress}" ${workdir} + + # verify the booting and installation + expect -c ' +set timeout '${timeout_period}' +log_file -noappend stateful-pxe.log + +spawn sudo virsh console '"${nodename}"' + +expect { + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } + -exact "Starting ovirt-firstpost:" { send_log "\n\nMarker 5\n\n"; exp_continue } + -exact "Starting partitioning of /dev/vda" { send_log "\n\nMarker 6\n\n"; exp_continue } + -exact "Restarting system" { send_log "\n\nMarker 7\n\n"; exit } + timeout { +send_log "\nTimeout waiting for marker..\n\n" +exit 1 + } eof { +send_log "Unexpected end of file." +exit 2 + } +} + +send_log "\n\nUnexpected end of interaction.\n\n" +exit 3' + result=$? + + # only continue if we're in a good state + if [ $result -eq 0 ]; then + destroy_node "${nodename}" false + substitute_boot_device "${nodename}" "network" "hd" + boot_from_hd "${nodename}" + + expect -c ' +set timeout '${timeout_period}' +log_file stateful-pxe.log + +send_log "Restarted node, booting from hard disk.\n" + +spawn sudo virsh console '"${nodename}"' + +expect { + -re "localhost.*login:" { send_log "\n\nLogin marker found\n\n"; exit } + + timeout { +send_log "\nMarker not found.\n\n" +exit 1 + } eof { +send_log "Unexpected end of file." +exit 2 + } +} + +send_log "\n\nUnexpected end of interaction.\n\n" + +exit 3 +' + + expect -c ' +set timeout 3 +log_file stateful-pxe.log + +spawn ping -c 3 '"${ipaddress}"' + +expect { + -exact "64 bytes from '"${ipaddress}"'" { send_log "\n\nGot ping response!\n"; send_log "\n\nNetworking verified!\n"; exit } + + timeout { +send_log "\nMarker not found.\n\n" +exit 1 + } eof { +send_log "Unexpected end of file." +exit 2 + } +} + +send_log "\n\nUnexpected end of interaction.\n\n" + +exit 3' + +result=$? + fi + + destroy_node $nodename + stop_networking $IFACE_NAME true + + return $result + +} + +# configures the environment for testing +setup_for_testing () { + debug "WORKDIR=${WORKDIR}" + debug "isofile=${isofile}" + debug "isoname=${isoname}" + IFACE_NAME=testbr$$ + debug "IFACE_NAME=${IFACE_NAME}" + NETWORK=192.168.$(echo "scale=0; print $$ % 255" | bc -l) + debug "NETWORK=${NETWORK}" + NODE_ADDRESS=$NETWORK.100 + debug "NODE_ADDRESS=${NODE_ADDRESS}" + DNSMASQ_PID=0 + debug "preserve_vm=${preserve_vm}" +} + +# cleans up any loose ends +cleanup_after_testing () { + debug "Cleaning up" + stop_dnsmasq + stop_networking + # destroy any running vms + vm_list=$(sudo virsh list --all | awk '/'${vm_prefix}-'/ { print $2 }') + test -n "$vm_list" && for vm in $vm_list; do + destroy_node $vm + done + stop_networking + + # do not delete the work directory if preserve was specified + if $preserve_vm; then return; fi + + rm -rf $WORKDIR +} + +# check commandline options +test='' +debugging=false +isofile="${PWD}/ovirt-node-image.iso" +show_viewer=false +vm_prefix="$$" +preserve_vm=false +timeout_period="120" + +while getopts di:n:pt:vwh c; do + case $c in + d) debugging=true;; + i) isofile=($OPTARG);; + n) tests=($OPTARG);; + p) preserve_vm=true;; + t) timeout_period=($OPTARG);; + v) set -v;; + w) show_viewer=true;; + h) usage; exit 0;; + '?') die "invalid option \`-$OPTARG'";; + :) die "missing argument to \`-$OPTARG' option";; + *) die "internal error";; + esac +done + +isoname=$(basename $isofile) +isofile="$(cd `dirname $isofile`; pwd)/${isoname}" + +if ! [ -s "${isofile}" ]; then + die "Missing or invalid file: ${isofile}" +fi + +shift $(($OPTIND - 1)) + +set +u +if [ $# -gt 0 -a -n "$1" ]; then RESULTS=$1; else RESULTS=autotest.log; fi +set -u + +result_file=$WORKDIR/results.log +debug "result_file=${result_file}" + +log "Logging results to file: ${RESULTS}" +{ + setup_for_testing + + log "Begin Testing: ${isoname}" + log "Tests: ${tests}" + log "Timeout: ${timeout_period} ms" + + for test in ${tests}; do + execute_test $test + result=$? + + if [ $result != 0 ]; then + echo "${result}" > $result_file + break + fi + done + + log "End Testing: ${isoname}" + +} | sudo tee --append $RESULTS + +if [ -s "$result_file" ]; then + exit $(cat $result_file) +fi -- 1.6.6.1 From mburns at redhat.com Fri Mar 26 22:27:14 2010 From: mburns at redhat.com (Mike Burns) Date: Fri, 26 Mar 2010 18:27:14 -0400 Subject: [Ovirt-devel] [PATCH node] Update autobuild and autotest scripts for new build structure In-Reply-To: <1269642326-3751-1-git-send-email-mburns@redhat.com> References: <1269642326-3751-1-git-send-email-mburns@redhat.com> Message-ID: <1269642434.6519.58.camel@localhost.localdomain> Oh, please note that these patches depend on Darryl's patches. Mike On Fri, 2010-03-26 at 18:25 -0400, Mike Burns wrote: > Autobuild has to be updated to call make in the recipe directory > and move the resulting iso to the main build directory. > > Importing the existing autotest.sh script from ovirt-node-image > > Signed-off-by: Mike Burns > --- > autobuild.sh | 7 + > autotest.sh | 764 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 771 insertions(+), 0 deletions(-) > > diff --git a/autobuild.sh b/autobuild.sh > index 0ac1e58..8517164 100755 > --- a/autobuild.sh > +++ b/autobuild.sh > @@ -41,3 +41,10 @@ if [ -f /usr/bin/rpmbuild ]; then > fi > rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean *.tar.gz > fi > + > +#make iso > +cd recipe > +make > + > +#copy iso back to main directory for autotest.sh > +cp *iso .. > diff --git a/autotest.sh b/autotest.sh > index 05a7907..32a60d9 100755 > --- a/autotest.sh > +++ b/autotest.sh > @@ -1,2 +1,766 @@ > #!/bin/bash > +# > +# oVirt node autotest script > +# > +# Copyright (C) 2009 Red Hat, Inc. > +# Written by Darryl L. Pierce > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; version 2 of the License. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write to the Free Software > +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, > +# MA 02110-1301, USA. A copy of the GNU General Public License is > +# also available at http://www.gnu.org/copyleft/gpl.html. > > +# To include autotesting on the build system, you need to insert the > +# following snippet *BEFORE* the text that reads "Output Stages": > +# ---8<[begin]--- > +# # Integration test > +# { > +# name = integration > +# label = Test group > +# module = Test::AutoBuild::Stage::Test > +# # Don't abort entire cycle if the module test fails > +# critical = 0 > +# } > +# ---8<[end]--- > +# > +# This will, for each module whose autobuild.sh is run, to have a matching > +# autotest.sh to run as well. > +# > +# To run these tests locally, you will need to open port 69 TCP and UDP and have > +# an ISO file. > + > +ME=$(basename "$0") > +WORKDIR=$(mktemp -d) > +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } > +die() { warn "$*"; exit 1; } > +debug() { if $debugging; then log "[DEBUG] %s" "$*"; fi } > + > +trap '__st=$?; cleanup_after_testing; exit $__st' 1 2 3 13 15 > +trap 'cleanup_after_testing' 0 > + > +# set -e > +# set -u > + > +log () { > + date=$(date) > + printf "${date} $*\n" > +} > + > +usage () { > + cat < +Usage: $ME [-n test_name] [LOGFILE] > + -i: set the ISO filename (defualt: ovirt-node-image.iso) > + -n: the name of the specific autotest to run (default: run all autotests) > + -d: enable more verbose output (default: disabled) > + -t: change the timeout between markers (in ms, default: 120) > + -v: enable tracing (default: disabled) > + -w: launch virt-viewer for each VM (default: no window shown) > + -h: display this help and exit > +EOF > +} > + > +# $1 - the test function to call > +execute_test () { > + local testname=$1 > + > + if [ -z $testname ]; then die "Missing test name"; fi > + > + log "Executing test: $testname" > + > + eval $testname > + > + rc=$? > + log "Completed test: $testname [result=$rc]" > + > + if [ $rc -ne 0 ]; then > + log "Build fails smoke tests." > + fi > + > + return $rc > +} > + > +# setup a node for pxeboot > +# $1 - the working directory > +# $2 - kernel arguments; if present then they replace all default flags > +setup_pxeboot () { > + local workdir=$1 > + local kernelargs=$2 > + local pxedefault=$workdir/tftpboot/pxelinux.cfg/default > + > + debug "setup for pxeboot: isofile=${isofile} workdir=${workdir} kernelargs='${kernelargs}' pxedefault=${pxedefault}" > + (cd $workdir && sudo livecd-iso-to-pxeboot $isofile) > /dev/null 2>&1 > + sudo chmod -R 777 $workdir > + > + # set default kernel arguments if none were provided > + # the defaults boot in standalone mode > + if [ -z "$kernelargs" ]; then > + kernelargs="standalone" > + fi > + > + local definition="DEFAULT pxeboot" > + definition="${definition}\nTIMEOUT 20" > + definition="${definition}\nPROMPT 0" > + definition="${definition}\nLABEL pxeboot" > + definition="${definition}\n KERNEL vmlinuz0" > + definition="${definition}\n IPAPPEND 2" > + definition="${definition}\n APPEND rootflags=loop initrd=initrd0.img root=/${isoname} rootfstype=auto console=tty0 check console=ttyS0,115200n8 $kernelargs" > + > + debug "pxeboot definition=\n${definition}" > + sudo bash -c "printf \"${definition}\" > $pxedefault" > +} > + > +# Starts a simple instance of dnsmasq. > +# $1 - the iface on which dnsmasq works > +# $2 - the root for tftp files > +# $3 - the mac address for the node (ignored if blank) > +# $4 - the nodename > +start_dnsmasq () { > + local iface=$1 > + local tftproot=$2 > + local macaddress=$3 > + local nodename=$4 > + local pidfile=$2/dnsmasq.pid > + > + stop_dnsmasq > + debug "Starting dnsmasq" > + dns_startup="sudo /usr/sbin/dnsmasq --read-ethers > + --dhcp-range=${NETWORK}.100,${NETWORK}.254,255.255.255.0,24h > + --conf-file= > + --interface=${iface} > + --bind-interfaces > + --except-interface=lo > + --dhcp-boot=tftpboot/pxelinux.0 > + --enable-tftp > + --tftp-root=${tftproot} > + --log-facility=$WORKDIR/dnsmasq-${nodename}.log > + --log-queries > + --log-dhcp > + --pid-file=${pidfile}" > + if [ -n "$macaddress" ]; then > + dns_startup="${dns_startup} --dhcp-host=${macaddress},${NODE_ADDRESS}" > + fi > + # start dnsmasq > + eval $dns_startup > + debug "pidfile=$pidfile" > + DNSMASQ_PID=$(sudo cat $pidfile) > + debug "DNSMASQ_PID=${DNSMASQ_PID}" > +} > + > +# Kills the running instance of dnsmasq. > +stop_dnsmasq () { > + if [ -n "${DNSMASQ_PID-}" -a "${DNSMASQ_PID-}" != "0" ]; then > + local check=$(ps -ef | awk "/${DNSMASQ_PID}/"' { if ($2 ~ '"${DNSMASQ_PID}"') print $2 }') > + > + if [[ "${check}" == "${DNSMASQ_PID}" ]]; then > + sudo kill -9 $DNSMASQ_PID > + return > + fi > + fi > + DNSMASQ_PID="0" > +} > + > +# Creates a virt network. > +# $1 - the node name > +# $2 - the network interface name > +# $3 - use DHCP (any value) > +# $4 - start dnsmsq (def. false) > +start_networking () { > + local nodename=$1 > + local ifacename=$2 > + local use_dhcp=${3-false} > + local start_dnsmasq=${4-false} > + local workdir=$5 > + local definition="" > + local network=$NETWORK > + local xmlfile=$WORKDIR/$nodename-$ifacename.xml > + > + debug "start_networking ()" > + for var in nodename ifacename use_dhcp start_dnsmasq workdir network xmlfile; do > + eval debug "::$var: \$$var" > + done > + > + definition="\n${ifacename}\n\n" > + definition="${definition}\n" > + if $use_dhcp; then > + definition="${definition}\n\n\n" > + fi > + definition="${definition}\n\n" > + > + debug "Saving network definition file to: ${xmlfile}\n" > + sudo printf "${definition}" > $xmlfile > + sudo virsh net-define $xmlfile > /dev/null 2>&1 > + debug "Starting network." > + sudo virsh net-start $ifacename > /dev/null 2>&1 > + > + if [ "${use_dhcp}" == "false" ]; then > + if $start_dnsmasq; then > + start_dnsmasq $ifacename $workdir "" $nodename > + fi > + fi > +} > + > +# Destroys the test network interface > +# $1 - the network name > +# $2 - stop dnsmasq (def. false) > +stop_networking () { > + local networkname=${1-} > + local stop_dnsmasq=${2-true} > + > + # if no network was supplied, then check for the global network > + if [ -z "$networkname" ]; then > + networkname=${NETWORK_NAME-} > + fi > + > + # exit if preserve was enabled > + if $preserve_vm; then return; fi > + > + if [ -n "${networkname}" ]; then > + debug "Destroying network interface: ${networkname}" > + check=$(sudo virsh net-list --all) > + if [[ "${check}" =~ "${networkname}" ]]; then > + if [[ "{$check}" =~ active ]]; then > + sudo virsh net-destroy $networkname > /dev/null 2>&1 > + fi > + sudo virsh net-undefine $networkname > /dev/null 2>&1 > + fi > + fi > + > + if $stop_dnsmasq; then > + stop_dnsmasq > + fi > +} > + > +# creates a HD disk file > +# $1 - filename for disk file > +# $2 - size (##M or ##G) > +create_hard_disk () { > + local filename=$1 > + local size=$2 > + > + debug "Creating hard disk: filename=${filename} size=${size}" > + sudo qemu-img create -f raw $filename "${size}M" > /dev/null 2>&1 > + sudo chcon -t virt_image_t $filename > /dev/null 2>&1 > +} > + > +# Creates the XML for a virtual machine. > +# $1 - the file to write the xml > +# $2 - the node name > +# $3 - memory size (in kb) > +# $4 - boot device > +# $5 - the local hard disk (if blank then no disk is used) > +# $6 - the cdrom disk (if blank then no cdrom is used) > +# $7 - the network bridge (if blank then 'default' is used) > +# $8 - optional arguments > +define_node () { > + local filename=$1 > + local nodename=$2 > + local memory=$3 > + local boot_device=$4 > + local harddrive=$5 > + local cddrive=$6 > + local bridge=${7-default} > + local options=${8-} > + local result="" > + > + # flexible options > + # define defaults, then allow the caller to override them as needed > + local arch=$(uname -i) > + local serial="true" > + local vncport="-1" > + local bootdev='hd' > + > + # first destroy the node > + destroy_node $nodename > + > + if [ -n "$options" ]; then eval "$options"; fi > + > + debug "define_node ()" > + for var in filename nodename memory harddrive cddrive bridge options arch serial vncport bootdev; do > +eval debug "::$var: \$$var" > + done > + > + result="\n${nodename}\n${memory}\n 1" > + > + # begin the os section > + # inject the boot device > + result="${result}\n\nhvm" > + result="${result}\n" > + result="${result}\n" > + > + # virtual machine features > + result="${result}\n" > + result="${result}\n" > + if [ -z "${noapic-}" ]; then result="${result}\n"; fi > + result="${result}\n" > + result="${result}\n" > + result="${result}\ndestroy" > + result="${result}\nrestart" > + result="${result}\nrestart" > + > + # add devices > + result="${result}\n" > + # inject the hard disk if defined > + if [ -n "$harddrive" ]; then > + debug "Adding a hard drive to the node" > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + fi > + # inject the cdrom drive if defined > + if [ -n "$cddrive" ]; then > + debug "Adding a CDROM drive to the node" > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + fi > + # inject the bridge network > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + # inject the serial port > + if [ -n "$serial" ]; then > + result="${result}\n" > + fi > + # inject the vnc port > + if [ -n "$vncport" ]; then > + result="${result}\n" > + result="${result}\n" > + fi > + # finish the device section > + result="${result}\n" > + > + result="${result}\n" > + > + debug "Node definition: ${filename}" > + sudo printf "$result" > $filename > + > + # now define the vm > + sudo virsh define $filename > /dev/null 2>&1 > + > + if [ $? != 0 ]; then die "Unable to define virtual machine: $nodename"; fi > +} > + > +# $1 - the node name > +# $2 - the boot device (def. "hd") > +# $3 - the memory size in kb (def. 524288) > +# $4 - hard disk size (if blank then no hard disk) > +# $5 - the cd drive image file (if blank then no cd drive) > +# $6 - option arguments > +configure_node () { > + local nodename=$1 > + local boot_device=$2 > + local memory=$3 > + local hdsize=$4 > + local hdfile="" > + local cdfile=$5 > + local args=$6 > + local nodefile=$WORKDIR/$nodename.xml > + > + if [ -z "${boot_device}" ]; then boot_device="hd"; fi > + if [ -z "${memory}" ]; then memory="524288"; fi > + > + debug "configure_node ()" > + for var in nodename boot_device memory hdsize hdfile cdfile args nodefile; do > + eval debug "::$var: \$$var" > + done > + > + # create the hard disk file > + if [ -n "${hdsize}" ]; then > + hdfile=$WORKDIR/$nodename-hd.img > + create_hard_disk $hdfile $hdsize > + fi > + > + define_node $nodefile $nodename "${memory}" "${boot_device}" "${hdfile}" "${cdfile}" $IFACE_NAME "${args}" > +} > + > +# $1 - the node name > +# $2 - undefine the node (def. true) > +destroy_node () { > + local nodename=$1 > + local undefine=${2-true} > + > + # if preserving nodes then exit > + if $preserve_vm; then return; fi > + > + if [ -n "${nodename}" ]; then > + check=$(sudo virsh list --all) > + if [[ "${check}" =~ "${nodename}" ]]; then > + if [[ "${check}" =~ running ]]; then > + sudo virsh destroy $nodename > /dev/null 2>&1 > + fi > + if $undefine; then > + sudo virsh undefine $nodename > /dev/null 2>&1 > + fi > + fi > + fi > +} > + > +# for each test created, add it to the follow array: > +tests=''; testcount=0; > + > +# $1 - test name > +add_test () { > + tests="${tests} $1" > +} > + > +# $1 - node name > +start_virt_viewer () { > + local nodename=$1 > + > + sudo virt-viewer $nodename > /dev/null 2>&1& > +} > + > +# $1 - the node's name > +# $2 - kernel arguments > +# $3 - working directory > +boot_with_pxe () { > + local nodename=$1 > + local kernel_args=$2 > + local workdir=$3 > + > + debug "boot_with_pxe ()" > + debug "- workdir: ${workdir}" > + debug "- nodename: ${nodename}" > + debug "- kernel_args: ${kernel_args}" > + > + setup_pxeboot $workdir "${kernel_args}" > + > + sudo virsh start $nodename > /dev/null 2>&1 > + if $show_viewer; then > + start_virt_viewer $nodename > + fi > +} > + > +# $1 - the node's name > +boot_from_hd () { > + local nodename=$1 > + > + debug "boot_from_hd ()" > + debug "::nodename: ${nodename}" > + > + sudo virsh start $nodename > /dev/null 2>&1 > + if $show_viewer; then > + start_virt_viewer $nodename > + fi > +} > + > +# $1 - the node name > +# $2 - the old boot device > +# $3 - the new boot device > +substitute_boot_device () { > + local nodename=$1 > + local old_device=$2 > + local new_device=$3 > + local new_node_file=$WORKDIR/$nodename-new.xml > + > + if [ -n "${nodename}" ]; then > + local xml=$(sudo virsh dumpxml $nodename | sed "s/boot dev='"${old_device}"'/boot dev='"${new_device}"'/") > + > + sudo printf "${xml}" > $new_node_file > + > + sudo virsh define $new_node_file > + fi > +} > + > +add_test "test_stateless_pxe" > +test_stateless_pxe () { > + local nodename="${vm_prefix}-stateless-pxe" > + local workdir=$WORKDIR > + > + start_networking $nodename $IFACE_NAME false true $workdir > + > + configure_node "${nodename}" "network" "" "10000" "" "local noapic=true" > + boot_with_pxe "${nodename}" "standalone firstboot=no" "${workdir}" > + > + expect -c ' > +set timeout '${timeout_period}' > + > +log_file -noappend stateless-pxe.log > + > +spawn sudo virsh console '"${nodename}"' > + > +expect { > + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } > + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } > + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } > + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } > + -re "localhost.*login:" { send_log "\n\nMarker 5\n\n"; exit } > + timeout { > +send_log "\nTimeout waiting for marker..\n\n" > +exit 1 > + } eof { > +send_log "Unexpected end of file." > +exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > +exit 3' > + result=$? > + > + destroy_node $nodename > + stop_networking $IFACE_NAME true > + > + return $result > +} > + > +add_test "test_stateless_pxe_with_nohd" > +test_stateless_pxe_with_nohd () { > + local nodename="${vm_prefix}-stateless-pxe-nohd" > + local workdir=$WORKDIR > + > + start_networking $nodename $IFACE_NAME false true $workdir > + > + configure_node "${nodename}" "network" "" "" "" "local noapic=true" > + boot_with_pxe "${nodename}" "firstboot=no" "${workdir}" > + > + expect -c ' > +set timeout '${timeout_period}' > + > +log_file -noappend stateless-pxe.log > + > +spawn sudo virsh console '"${nodename}"' > + > +expect { > + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } > + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } > + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } > + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } > + -re "localhost.*login:" { send_log "\n\nMarker 5\n\n"; exit } > + timeout { > + send_log "\nTimeout waiting for marker..\n\n" > + exit 1 > + } eof { > + send_log "Unexpected end of file." > + exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > +exit 3' > + > + result=$? > + > + destroy_node $nodename > + stop_networking $IFACE_NAME true > + > + return $result > +} > + > +add_test "test_stateful_pxe" > +test_stateful_pxe () { > + local nodename="${vm_prefix}-stateful-pxe" > + local workdir=$WORKDIR > + local ipaddress=${NODE_ADDRESS} > + > + for var in nodename workdir ipaddress; do > + eval debug "::\$$var: $var" > + done > + > + start_networking $nodename $IFACE_NAME false true $workdir > + > + configure_node "${nodename}" "network" "" "10000" "" "local noapic=true" > + boot_with_pxe "${nodename}" "standalone storage_init=/dev/vda local_boot ip=${ipaddress}" ${workdir} > + > + # verify the booting and installation > + expect -c ' > +set timeout '${timeout_period}' > +log_file -noappend stateful-pxe.log > + > +spawn sudo virsh console '"${nodename}"' > + > +expect { > + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } > + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } > + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } > + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } > + -exact "Starting ovirt-firstpost:" { send_log "\n\nMarker 5\n\n"; exp_continue } > + -exact "Starting partitioning of /dev/vda" { send_log "\n\nMarker 6\n\n"; exp_continue } > + -exact "Restarting system" { send_log "\n\nMarker 7\n\n"; exit } > + timeout { > +send_log "\nTimeout waiting for marker..\n\n" > +exit 1 > + } eof { > +send_log "Unexpected end of file." > +exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > +exit 3' > + result=$? > + > + # only continue if we're in a good state > + if [ $result -eq 0 ]; then > + destroy_node "${nodename}" false > + substitute_boot_device "${nodename}" "network" "hd" > + boot_from_hd "${nodename}" > + > + expect -c ' > +set timeout '${timeout_period}' > +log_file stateful-pxe.log > + > +send_log "Restarted node, booting from hard disk.\n" > + > +spawn sudo virsh console '"${nodename}"' > + > +expect { > + -re "localhost.*login:" { send_log "\n\nLogin marker found\n\n"; exit } > + > + timeout { > +send_log "\nMarker not found.\n\n" > +exit 1 > + } eof { > +send_log "Unexpected end of file." > +exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > + > +exit 3 > +' > + > + expect -c ' > +set timeout 3 > +log_file stateful-pxe.log > + > +spawn ping -c 3 '"${ipaddress}"' > + > +expect { > + -exact "64 bytes from '"${ipaddress}"'" { send_log "\n\nGot ping response!\n"; send_log "\n\nNetworking verified!\n"; exit } > + > + timeout { > +send_log "\nMarker not found.\n\n" > +exit 1 > + } eof { > +send_log "Unexpected end of file." > +exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > + > +exit 3' > + > +result=$? > + fi > + > + destroy_node $nodename > + stop_networking $IFACE_NAME true > + > + return $result > + > +} > + > +# configures the environment for testing > +setup_for_testing () { > + debug "WORKDIR=${WORKDIR}" > + debug "isofile=${isofile}" > + debug "isoname=${isoname}" > + IFACE_NAME=testbr$$ > + debug "IFACE_NAME=${IFACE_NAME}" > + NETWORK=192.168.$(echo "scale=0; print $$ % 255" | bc -l) > + debug "NETWORK=${NETWORK}" > + NODE_ADDRESS=$NETWORK.100 > + debug "NODE_ADDRESS=${NODE_ADDRESS}" > + DNSMASQ_PID=0 > + debug "preserve_vm=${preserve_vm}" > +} > + > +# cleans up any loose ends > +cleanup_after_testing () { > + debug "Cleaning up" > + stop_dnsmasq > + stop_networking > + # destroy any running vms > + vm_list=$(sudo virsh list --all | awk '/'${vm_prefix}-'/ { print $2 }') > + test -n "$vm_list" && for vm in $vm_list; do > + destroy_node $vm > + done > + stop_networking > + > + # do not delete the work directory if preserve was specified > + if $preserve_vm; then return; fi > + > + rm -rf $WORKDIR > +} > + > +# check commandline options > +test='' > +debugging=false > +isofile="${PWD}/ovirt-node-image.iso" > +show_viewer=false > +vm_prefix="$$" > +preserve_vm=false > +timeout_period="120" > + > +while getopts di:n:pt:vwh c; do > + case $c in > + d) debugging=true;; > + i) isofile=($OPTARG);; > + n) tests=($OPTARG);; > + p) preserve_vm=true;; > + t) timeout_period=($OPTARG);; > + v) set -v;; > + w) show_viewer=true;; > + h) usage; exit 0;; > + '?') die "invalid option \`-$OPTARG'";; > + :) die "missing argument to \`-$OPTARG' option";; > + *) die "internal error";; > + esac > +done > + > +isoname=$(basename $isofile) > +isofile="$(cd `dirname $isofile`; pwd)/${isoname}" > + > +if ! [ -s "${isofile}" ]; then > + die "Missing or invalid file: ${isofile}" > +fi > + > +shift $(($OPTIND - 1)) > + > +set +u > +if [ $# -gt 0 -a -n "$1" ]; then RESULTS=$1; else RESULTS=autotest.log; fi > +set -u > + > +result_file=$WORKDIR/results.log > +debug "result_file=${result_file}" > + > +log "Logging results to file: ${RESULTS}" > +{ > + setup_for_testing > + > + log "Begin Testing: ${isoname}" > + log "Tests: ${tests}" > + log "Timeout: ${timeout_period} ms" > + > + for test in ${tests}; do > + execute_test $test > + result=$? > + > + if [ $result != 0 ]; then > + echo "${result}" > $result_file > + break > + fi > + done > + > + log "End Testing: ${isoname}" > + > +} | sudo tee --append $RESULTS > + > +if [ -s "$result_file" ]; then > + exit $(cat $result_file) > +fi From dpierce at redhat.com Mon Mar 29 11:54:11 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Mar 2010 07:54:11 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <4BAD2F98.2070306@redhat.com> References: <1269639069-842-1-git-send-email-dpierce@redhat.com> <1269639069-842-2-git-send-email-dpierce@redhat.com> <4BAD2F98.2070306@redhat.com> Message-ID: <20100329115411.GD2948@mcpierce-desktop.usersys.redhat.com> On Fri, Mar 26, 2010 at 06:05:12PM -0400, Perry Myers wrote: > On 03/26/2010 05:31 PM, Darryl L. Pierce wrote: > > The ISO can now be built by going into the recipe directory and building > > the ovirt-node-image.iso target. > > Doesn't this still need a patch to configure.ac to add recipe/Makefile to > be generated from recipe/Makefile.am? That's already in the configure.ac for ovirt-node. > Also, shouldn't we with this patch also take care of adding the resulting > recipe/Makefile to the ovirt-node-recipe so that it gets installed to > /usr/share along with the kickstarts? Those would come in as a follow up patch. This one was only meant to move the ISO building functionality into the ovirt-node repo. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From pmyers at redhat.com Mon Mar 29 12:10:47 2010 From: pmyers at redhat.com (Perry Myers) Date: Mon, 29 Mar 2010 08:10:47 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <20100329115411.GD2948@mcpierce-desktop.usersys.redhat.com> References: <1269639069-842-1-git-send-email-dpierce@redhat.com> <1269639069-842-2-git-send-email-dpierce@redhat.com> <4BAD2F98.2070306@redhat.com> <20100329115411.GD2948@mcpierce-desktop.usersys.redhat.com> Message-ID: <4BB098C7.4050706@redhat.com> On 03/29/2010 07:54 AM, Darryl L. Pierce wrote: > On Fri, Mar 26, 2010 at 06:05:12PM -0400, Perry Myers wrote: >> On 03/26/2010 05:31 PM, Darryl L. Pierce wrote: >>> The ISO can now be built by going into the recipe directory and building >>> the ovirt-node-image.iso target. >> >> Doesn't this still need a patch to configure.ac to add recipe/Makefile to >> be generated from recipe/Makefile.am? > > That's already in the configure.ac for ovirt-node. > >> Also, shouldn't we with this patch also take care of adding the resulting >> recipe/Makefile to the ovirt-node-recipe so that it gets installed to >> /usr/share along with the kickstarts? > > Those would come in as a follow up patch. This one was only meant to > move the ISO building functionality into the ovirt-node repo. ok thx for the info Perry From mburns at redhat.com Mon Mar 29 15:35:34 2010 From: mburns at redhat.com (Mike Burns) Date: Mon, 29 Mar 2010 11:35:34 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <1269639069-842-2-git-send-email-dpierce@redhat.com> References: <1269639069-842-1-git-send-email-dpierce@redhat.com> <1269639069-842-2-git-send-email-dpierce@redhat.com> Message-ID: <1269876934.3291.9.camel@localhost.localdomain> On Fri, 2010-03-26 at 17:31 -0400, Darryl L. Pierce wrote: > The ISO can now be built by going into the recipe directory and building > the ovirt-node-image.iso target. > > Signed-off-by: Darryl L. Pierce > --- > recipe/Makefile.am | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 68 insertions(+), 0 deletions(-) > > diff --git a/recipe/Makefile.am b/recipe/Makefile.am > index c8a7b94..a925f01 100644 > --- a/recipe/Makefile.am > +++ b/recipe/Makefile.am > @@ -7,6 +7,14 @@ OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) > > FEDORA = $(shell rpm --eval '%{fedora}') > ARCH = $(shell rpm --eval '%{_arch}') More of a convenience consistent with the top level Makefile. We should default ovirt-cache +OVIRT_CACHE_DIR ?= $(HOME)/ovirt-cache > +OVIRT_NODE_RECIPE = ovirt-node-recipe.ks > +PKG_FMT = iso > +PACKAGE = ovirt-node-image > +NODE_TMP = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp > +OVIRT_LOCAL_REPO ?= file://$(OVIRT_CACHE_DIR)/ovirt > +NODE_KS = $(NODE_TMP)/node.ks > +NVR = $(PACKAGE)-$(VERSION)-$(ARCH) > +SUM ?= sha1sum ovirt-node-image makefile defaulted this variable also for dev builds. +AUTH_KEYS ?= $(HOME)/.ssh/authorized_keys > > OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools > OVIRT_NODE_TOOLS_DATA = \ > @@ -51,4 +59,64 @@ ovirt-node-recipe.ks: > # XXX broken ksflatten leaves %include > sed -i 's/^%include /#&/' $@ > > +keys: > + if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \ > + cp -va $(AUTH_KEYS) ovirt-authorized_keys ;\ > + fi > + > +no_nscd: > + if pgrep -xl nscd; then \ > + echo "Please stop nscd" ;\ > + exit 1 ;\ > + fi > + > +# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT- > +# annotated rpm version strings. > +_ovirt_dev = \ > + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ > + $(srcdir)/*.spec.in && echo 1 || :) I think this should be top_srcdir since there is no spec file in the recipe directory. It needs to look at ovirt-node.spec.in in the top level directory. + $(top_srcdir)/*.spec.in && echo 1 || :) > + > +SELINUX_ENFORCING=$(shell /usr/sbin/getenforce) > +$(NVR).$(PKG_FMT): no_nscd keys > + mkdir -p $(NODE_TMP) > + mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH) > + ( \ > + case $(SELINUX_ENFORCING) in \ > + Enforcing) sudo /usr/sbin/setenforce Permissive ;; \ > + Permissive) ;; \ > + *) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \ > + then \ > + echo WARNING: SELinux disabled in kickstart ;\ > + else \ > + echo ERROR: SELinux enabled in kickstart, \ > + but disabled on the build machine ;\ > + exit 1 ;\ > + fi ;; \ > + esac ;\ > + ) > + rm -f $(NODE_KS) > + if [ "$(_ovirt_dev)" = 1 ]; then \ > + echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\ > + fi > + cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS) > + sudo livecd-creator --skip-minimize -c $(NODE_KS)\ > + -f $(PACKAGE) \ > + --tmpdir='$(NODE_TMP)' \ > + --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)' > + sudo chown $${USER} $(PACKAGE).$(PKG_FMT) > + ( \ > + if [ $(SELINUX_ENFORCING) = Enforcing ]; then \ > + sudo /usr/sbin/setenforce Enforcing || exit 1 ;\ > + fi \ > + ) > + > + ln -nf $(PACKAGE).$(PKG_FMT) $(NVR).$(PKG_FMT) > + > +$(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) > + $(SUM) $(NVR).$(PKG_FMT) > $(NVR).$(PKG_FMT).$(SUM) > + > +$(PACKAGE).$(PKG_FMT) node: ovirt-node-recipe.ks $(NVR).$(PKG_FMT).$(SUM) > + > +PUNGI = $(NODE_TMP)/tree/pungi > + > .PHONY: ovirt-node-recipe.ks repos.ks Other than the above things, I saw one other thing that I'm not sure if we should change or not. I had done a cleanup of my ovirt-cache directory before trying this build. I didn't rebuild the ovirt-node packages and the build failed because the default ovirt-local repo didn't exist. We could change the condition that determines whether to add the ovirt-local repo to check that it exists. If someone were to override the OVIRT_LOCAL_REPO environment variable with something other than a local file:// repo, it won't work. Thoughts? Mike From mburns at redhat.com Mon Mar 29 15:37:03 2010 From: mburns at redhat.com (Mike Burns) Date: Mon, 29 Mar 2010 11:37:03 -0400 Subject: [Ovirt-devel] [PATCH node] Update autobuild and autotest scripts for new build structure In-Reply-To: <1269642326-3751-1-git-send-email-mburns@redhat.com> References: <1269642326-3751-1-git-send-email-mburns@redhat.com> Message-ID: <1269877023.3291.10.camel@localhost.localdomain> On Fri, 2010-03-26 at 18:25 -0400, Mike Burns wrote: > Autobuild has to be updated to call make in the recipe directory > and move the resulting iso to the main build directory. > > Importing the existing autotest.sh script from ovirt-node-image > > Signed-off-by: Mike Burns > --- > autobuild.sh | 7 + > autotest.sh | 764 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 771 insertions(+), 0 deletions(-) > > diff --git a/autobuild.sh b/autobuild.sh > index 0ac1e58..8517164 100755 > --- a/autobuild.sh > +++ b/autobuild.sh > @@ -41,3 +41,10 @@ if [ -f /usr/bin/rpmbuild ]; then > fi > rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean *.tar.gz > fi > + > +#make iso > +cd recipe > +make previous line should be make ovirt-node-image.iso I will re-submit this patch when the final version of Darryl's patches get accepted. > + > +#copy iso back to main directory for autotest.sh > +cp *iso .. > diff --git a/autotest.sh b/autotest.sh > index 05a7907..32a60d9 100755 > --- a/autotest.sh > +++ b/autotest.sh > @@ -1,2 +1,766 @@ > #!/bin/bash > +# > +# oVirt node autotest script > +# > +# Copyright (C) 2009 Red Hat, Inc. > +# Written by Darryl L. Pierce > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; version 2 of the License. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write to the Free Software > +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, > +# MA 02110-1301, USA. A copy of the GNU General Public License is > +# also available at http://www.gnu.org/copyleft/gpl.html. > > +# To include autotesting on the build system, you need to insert the > +# following snippet *BEFORE* the text that reads "Output Stages": > +# ---8<[begin]--- > +# # Integration test > +# { > +# name = integration > +# label = Test group > +# module = Test::AutoBuild::Stage::Test > +# # Don't abort entire cycle if the module test fails > +# critical = 0 > +# } > +# ---8<[end]--- > +# > +# This will, for each module whose autobuild.sh is run, to have a matching > +# autotest.sh to run as well. > +# > +# To run these tests locally, you will need to open port 69 TCP and UDP and have > +# an ISO file. > + > +ME=$(basename "$0") > +WORKDIR=$(mktemp -d) > +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } > +die() { warn "$*"; exit 1; } > +debug() { if $debugging; then log "[DEBUG] %s" "$*"; fi } > + > +trap '__st=$?; cleanup_after_testing; exit $__st' 1 2 3 13 15 > +trap 'cleanup_after_testing' 0 > + > +# set -e > +# set -u > + > +log () { > + date=$(date) > + printf "${date} $*\n" > +} > + > +usage () { > + cat < +Usage: $ME [-n test_name] [LOGFILE] > + -i: set the ISO filename (defualt: ovirt-node-image.iso) > + -n: the name of the specific autotest to run (default: run all autotests) > + -d: enable more verbose output (default: disabled) > + -t: change the timeout between markers (in ms, default: 120) > + -v: enable tracing (default: disabled) > + -w: launch virt-viewer for each VM (default: no window shown) > + -h: display this help and exit > +EOF > +} > + > +# $1 - the test function to call > +execute_test () { > + local testname=$1 > + > + if [ -z $testname ]; then die "Missing test name"; fi > + > + log "Executing test: $testname" > + > + eval $testname > + > + rc=$? > + log "Completed test: $testname [result=$rc]" > + > + if [ $rc -ne 0 ]; then > + log "Build fails smoke tests." > + fi > + > + return $rc > +} > + > +# setup a node for pxeboot > +# $1 - the working directory > +# $2 - kernel arguments; if present then they replace all default flags > +setup_pxeboot () { > + local workdir=$1 > + local kernelargs=$2 > + local pxedefault=$workdir/tftpboot/pxelinux.cfg/default > + > + debug "setup for pxeboot: isofile=${isofile} workdir=${workdir} kernelargs='${kernelargs}' pxedefault=${pxedefault}" > + (cd $workdir && sudo livecd-iso-to-pxeboot $isofile) > /dev/null 2>&1 > + sudo chmod -R 777 $workdir > + > + # set default kernel arguments if none were provided > + # the defaults boot in standalone mode > + if [ -z "$kernelargs" ]; then > + kernelargs="standalone" > + fi > + > + local definition="DEFAULT pxeboot" > + definition="${definition}\nTIMEOUT 20" > + definition="${definition}\nPROMPT 0" > + definition="${definition}\nLABEL pxeboot" > + definition="${definition}\n KERNEL vmlinuz0" > + definition="${definition}\n IPAPPEND 2" > + definition="${definition}\n APPEND rootflags=loop initrd=initrd0.img root=/${isoname} rootfstype=auto console=tty0 check console=ttyS0,115200n8 $kernelargs" > + > + debug "pxeboot definition=\n${definition}" > + sudo bash -c "printf \"${definition}\" > $pxedefault" > +} > + > +# Starts a simple instance of dnsmasq. > +# $1 - the iface on which dnsmasq works > +# $2 - the root for tftp files > +# $3 - the mac address for the node (ignored if blank) > +# $4 - the nodename > +start_dnsmasq () { > + local iface=$1 > + local tftproot=$2 > + local macaddress=$3 > + local nodename=$4 > + local pidfile=$2/dnsmasq.pid > + > + stop_dnsmasq > + debug "Starting dnsmasq" > + dns_startup="sudo /usr/sbin/dnsmasq --read-ethers > + --dhcp-range=${NETWORK}.100,${NETWORK}.254,255.255.255.0,24h > + --conf-file= > + --interface=${iface} > + --bind-interfaces > + --except-interface=lo > + --dhcp-boot=tftpboot/pxelinux.0 > + --enable-tftp > + --tftp-root=${tftproot} > + --log-facility=$WORKDIR/dnsmasq-${nodename}.log > + --log-queries > + --log-dhcp > + --pid-file=${pidfile}" > + if [ -n "$macaddress" ]; then > + dns_startup="${dns_startup} --dhcp-host=${macaddress},${NODE_ADDRESS}" > + fi > + # start dnsmasq > + eval $dns_startup > + debug "pidfile=$pidfile" > + DNSMASQ_PID=$(sudo cat $pidfile) > + debug "DNSMASQ_PID=${DNSMASQ_PID}" > +} > + > +# Kills the running instance of dnsmasq. > +stop_dnsmasq () { > + if [ -n "${DNSMASQ_PID-}" -a "${DNSMASQ_PID-}" != "0" ]; then > + local check=$(ps -ef | awk "/${DNSMASQ_PID}/"' { if ($2 ~ '"${DNSMASQ_PID}"') print $2 }') > + > + if [[ "${check}" == "${DNSMASQ_PID}" ]]; then > + sudo kill -9 $DNSMASQ_PID > + return > + fi > + fi > + DNSMASQ_PID="0" > +} > + > +# Creates a virt network. > +# $1 - the node name > +# $2 - the network interface name > +# $3 - use DHCP (any value) > +# $4 - start dnsmsq (def. false) > +start_networking () { > + local nodename=$1 > + local ifacename=$2 > + local use_dhcp=${3-false} > + local start_dnsmasq=${4-false} > + local workdir=$5 > + local definition="" > + local network=$NETWORK > + local xmlfile=$WORKDIR/$nodename-$ifacename.xml > + > + debug "start_networking ()" > + for var in nodename ifacename use_dhcp start_dnsmasq workdir network xmlfile; do > + eval debug "::$var: \$$var" > + done > + > + definition="\n${ifacename}\n\n" > + definition="${definition}\n" > + if $use_dhcp; then > + definition="${definition}\n\n\n" > + fi > + definition="${definition}\n\n" > + > + debug "Saving network definition file to: ${xmlfile}\n" > + sudo printf "${definition}" > $xmlfile > + sudo virsh net-define $xmlfile > /dev/null 2>&1 > + debug "Starting network." > + sudo virsh net-start $ifacename > /dev/null 2>&1 > + > + if [ "${use_dhcp}" == "false" ]; then > + if $start_dnsmasq; then > + start_dnsmasq $ifacename $workdir "" $nodename > + fi > + fi > +} > + > +# Destroys the test network interface > +# $1 - the network name > +# $2 - stop dnsmasq (def. false) > +stop_networking () { > + local networkname=${1-} > + local stop_dnsmasq=${2-true} > + > + # if no network was supplied, then check for the global network > + if [ -z "$networkname" ]; then > + networkname=${NETWORK_NAME-} > + fi > + > + # exit if preserve was enabled > + if $preserve_vm; then return; fi > + > + if [ -n "${networkname}" ]; then > + debug "Destroying network interface: ${networkname}" > + check=$(sudo virsh net-list --all) > + if [[ "${check}" =~ "${networkname}" ]]; then > + if [[ "{$check}" =~ active ]]; then > + sudo virsh net-destroy $networkname > /dev/null 2>&1 > + fi > + sudo virsh net-undefine $networkname > /dev/null 2>&1 > + fi > + fi > + > + if $stop_dnsmasq; then > + stop_dnsmasq > + fi > +} > + > +# creates a HD disk file > +# $1 - filename for disk file > +# $2 - size (##M or ##G) > +create_hard_disk () { > + local filename=$1 > + local size=$2 > + > + debug "Creating hard disk: filename=${filename} size=${size}" > + sudo qemu-img create -f raw $filename "${size}M" > /dev/null 2>&1 > + sudo chcon -t virt_image_t $filename > /dev/null 2>&1 > +} > + > +# Creates the XML for a virtual machine. > +# $1 - the file to write the xml > +# $2 - the node name > +# $3 - memory size (in kb) > +# $4 - boot device > +# $5 - the local hard disk (if blank then no disk is used) > +# $6 - the cdrom disk (if blank then no cdrom is used) > +# $7 - the network bridge (if blank then 'default' is used) > +# $8 - optional arguments > +define_node () { > + local filename=$1 > + local nodename=$2 > + local memory=$3 > + local boot_device=$4 > + local harddrive=$5 > + local cddrive=$6 > + local bridge=${7-default} > + local options=${8-} > + local result="" > + > + # flexible options > + # define defaults, then allow the caller to override them as needed > + local arch=$(uname -i) > + local serial="true" > + local vncport="-1" > + local bootdev='hd' > + > + # first destroy the node > + destroy_node $nodename > + > + if [ -n "$options" ]; then eval "$options"; fi > + > + debug "define_node ()" > + for var in filename nodename memory harddrive cddrive bridge options arch serial vncport bootdev; do > +eval debug "::$var: \$$var" > + done > + > + result="\n${nodename}\n${memory}\n 1" > + > + # begin the os section > + # inject the boot device > + result="${result}\n\nhvm" > + result="${result}\n" > + result="${result}\n" > + > + # virtual machine features > + result="${result}\n" > + result="${result}\n" > + if [ -z "${noapic-}" ]; then result="${result}\n"; fi > + result="${result}\n" > + result="${result}\n" > + result="${result}\ndestroy" > + result="${result}\nrestart" > + result="${result}\nrestart" > + > + # add devices > + result="${result}\n" > + # inject the hard disk if defined > + if [ -n "$harddrive" ]; then > + debug "Adding a hard drive to the node" > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + fi > + # inject the cdrom drive if defined > + if [ -n "$cddrive" ]; then > + debug "Adding a CDROM drive to the node" > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + fi > + # inject the bridge network > + result="${result}\n" > + result="${result}\n" > + result="${result}\n" > + # inject the serial port > + if [ -n "$serial" ]; then > + result="${result}\n" > + fi > + # inject the vnc port > + if [ -n "$vncport" ]; then > + result="${result}\n" > + result="${result}\n" > + fi > + # finish the device section > + result="${result}\n" > + > + result="${result}\n" > + > + debug "Node definition: ${filename}" > + sudo printf "$result" > $filename > + > + # now define the vm > + sudo virsh define $filename > /dev/null 2>&1 > + > + if [ $? != 0 ]; then die "Unable to define virtual machine: $nodename"; fi > +} > + > +# $1 - the node name > +# $2 - the boot device (def. "hd") > +# $3 - the memory size in kb (def. 524288) > +# $4 - hard disk size (if blank then no hard disk) > +# $5 - the cd drive image file (if blank then no cd drive) > +# $6 - option arguments > +configure_node () { > + local nodename=$1 > + local boot_device=$2 > + local memory=$3 > + local hdsize=$4 > + local hdfile="" > + local cdfile=$5 > + local args=$6 > + local nodefile=$WORKDIR/$nodename.xml > + > + if [ -z "${boot_device}" ]; then boot_device="hd"; fi > + if [ -z "${memory}" ]; then memory="524288"; fi > + > + debug "configure_node ()" > + for var in nodename boot_device memory hdsize hdfile cdfile args nodefile; do > + eval debug "::$var: \$$var" > + done > + > + # create the hard disk file > + if [ -n "${hdsize}" ]; then > + hdfile=$WORKDIR/$nodename-hd.img > + create_hard_disk $hdfile $hdsize > + fi > + > + define_node $nodefile $nodename "${memory}" "${boot_device}" "${hdfile}" "${cdfile}" $IFACE_NAME "${args}" > +} > + > +# $1 - the node name > +# $2 - undefine the node (def. true) > +destroy_node () { > + local nodename=$1 > + local undefine=${2-true} > + > + # if preserving nodes then exit > + if $preserve_vm; then return; fi > + > + if [ -n "${nodename}" ]; then > + check=$(sudo virsh list --all) > + if [[ "${check}" =~ "${nodename}" ]]; then > + if [[ "${check}" =~ running ]]; then > + sudo virsh destroy $nodename > /dev/null 2>&1 > + fi > + if $undefine; then > + sudo virsh undefine $nodename > /dev/null 2>&1 > + fi > + fi > + fi > +} > + > +# for each test created, add it to the follow array: > +tests=''; testcount=0; > + > +# $1 - test name > +add_test () { > + tests="${tests} $1" > +} > + > +# $1 - node name > +start_virt_viewer () { > + local nodename=$1 > + > + sudo virt-viewer $nodename > /dev/null 2>&1& > +} > + > +# $1 - the node's name > +# $2 - kernel arguments > +# $3 - working directory > +boot_with_pxe () { > + local nodename=$1 > + local kernel_args=$2 > + local workdir=$3 > + > + debug "boot_with_pxe ()" > + debug "- workdir: ${workdir}" > + debug "- nodename: ${nodename}" > + debug "- kernel_args: ${kernel_args}" > + > + setup_pxeboot $workdir "${kernel_args}" > + > + sudo virsh start $nodename > /dev/null 2>&1 > + if $show_viewer; then > + start_virt_viewer $nodename > + fi > +} > + > +# $1 - the node's name > +boot_from_hd () { > + local nodename=$1 > + > + debug "boot_from_hd ()" > + debug "::nodename: ${nodename}" > + > + sudo virsh start $nodename > /dev/null 2>&1 > + if $show_viewer; then > + start_virt_viewer $nodename > + fi > +} > + > +# $1 - the node name > +# $2 - the old boot device > +# $3 - the new boot device > +substitute_boot_device () { > + local nodename=$1 > + local old_device=$2 > + local new_device=$3 > + local new_node_file=$WORKDIR/$nodename-new.xml > + > + if [ -n "${nodename}" ]; then > + local xml=$(sudo virsh dumpxml $nodename | sed "s/boot dev='"${old_device}"'/boot dev='"${new_device}"'/") > + > + sudo printf "${xml}" > $new_node_file > + > + sudo virsh define $new_node_file > + fi > +} > + > +add_test "test_stateless_pxe" > +test_stateless_pxe () { > + local nodename="${vm_prefix}-stateless-pxe" > + local workdir=$WORKDIR > + > + start_networking $nodename $IFACE_NAME false true $workdir > + > + configure_node "${nodename}" "network" "" "10000" "" "local noapic=true" > + boot_with_pxe "${nodename}" "standalone firstboot=no" "${workdir}" > + > + expect -c ' > +set timeout '${timeout_period}' > + > +log_file -noappend stateless-pxe.log > + > +spawn sudo virsh console '"${nodename}"' > + > +expect { > + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } > + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } > + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } > + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } > + -re "localhost.*login:" { send_log "\n\nMarker 5\n\n"; exit } > + timeout { > +send_log "\nTimeout waiting for marker..\n\n" > +exit 1 > + } eof { > +send_log "Unexpected end of file." > +exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > +exit 3' > + result=$? > + > + destroy_node $nodename > + stop_networking $IFACE_NAME true > + > + return $result > +} > + > +add_test "test_stateless_pxe_with_nohd" > +test_stateless_pxe_with_nohd () { > + local nodename="${vm_prefix}-stateless-pxe-nohd" > + local workdir=$WORKDIR > + > + start_networking $nodename $IFACE_NAME false true $workdir > + > + configure_node "${nodename}" "network" "" "" "" "local noapic=true" > + boot_with_pxe "${nodename}" "firstboot=no" "${workdir}" > + > + expect -c ' > +set timeout '${timeout_period}' > + > +log_file -noappend stateless-pxe.log > + > +spawn sudo virsh console '"${nodename}"' > + > +expect { > + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } > + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } > + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } > + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } > + -re "localhost.*login:" { send_log "\n\nMarker 5\n\n"; exit } > + timeout { > + send_log "\nTimeout waiting for marker..\n\n" > + exit 1 > + } eof { > + send_log "Unexpected end of file." > + exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > +exit 3' > + > + result=$? > + > + destroy_node $nodename > + stop_networking $IFACE_NAME true > + > + return $result > +} > + > +add_test "test_stateful_pxe" > +test_stateful_pxe () { > + local nodename="${vm_prefix}-stateful-pxe" > + local workdir=$WORKDIR > + local ipaddress=${NODE_ADDRESS} > + > + for var in nodename workdir ipaddress; do > + eval debug "::\$$var: $var" > + done > + > + start_networking $nodename $IFACE_NAME false true $workdir > + > + configure_node "${nodename}" "network" "" "10000" "" "local noapic=true" > + boot_with_pxe "${nodename}" "standalone storage_init=/dev/vda local_boot ip=${ipaddress}" ${workdir} > + > + # verify the booting and installation > + expect -c ' > +set timeout '${timeout_period}' > +log_file -noappend stateful-pxe.log > + > +spawn sudo virsh console '"${nodename}"' > + > +expect { > + -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue } > + -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue } > + -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue } > + -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue } > + -exact "Starting ovirt-firstpost:" { send_log "\n\nMarker 5\n\n"; exp_continue } > + -exact "Starting partitioning of /dev/vda" { send_log "\n\nMarker 6\n\n"; exp_continue } > + -exact "Restarting system" { send_log "\n\nMarker 7\n\n"; exit } > + timeout { > +send_log "\nTimeout waiting for marker..\n\n" > +exit 1 > + } eof { > +send_log "Unexpected end of file." > +exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > +exit 3' > + result=$? > + > + # only continue if we're in a good state > + if [ $result -eq 0 ]; then > + destroy_node "${nodename}" false > + substitute_boot_device "${nodename}" "network" "hd" > + boot_from_hd "${nodename}" > + > + expect -c ' > +set timeout '${timeout_period}' > +log_file stateful-pxe.log > + > +send_log "Restarted node, booting from hard disk.\n" > + > +spawn sudo virsh console '"${nodename}"' > + > +expect { > + -re "localhost.*login:" { send_log "\n\nLogin marker found\n\n"; exit } > + > + timeout { > +send_log "\nMarker not found.\n\n" > +exit 1 > + } eof { > +send_log "Unexpected end of file." > +exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > + > +exit 3 > +' > + > + expect -c ' > +set timeout 3 > +log_file stateful-pxe.log > + > +spawn ping -c 3 '"${ipaddress}"' > + > +expect { > + -exact "64 bytes from '"${ipaddress}"'" { send_log "\n\nGot ping response!\n"; send_log "\n\nNetworking verified!\n"; exit } > + > + timeout { > +send_log "\nMarker not found.\n\n" > +exit 1 > + } eof { > +send_log "Unexpected end of file." > +exit 2 > + } > +} > + > +send_log "\n\nUnexpected end of interaction.\n\n" > + > +exit 3' > + > +result=$? > + fi > + > + destroy_node $nodename > + stop_networking $IFACE_NAME true > + > + return $result > + > +} > + > +# configures the environment for testing > +setup_for_testing () { > + debug "WORKDIR=${WORKDIR}" > + debug "isofile=${isofile}" > + debug "isoname=${isoname}" > + IFACE_NAME=testbr$$ > + debug "IFACE_NAME=${IFACE_NAME}" > + NETWORK=192.168.$(echo "scale=0; print $$ % 255" | bc -l) > + debug "NETWORK=${NETWORK}" > + NODE_ADDRESS=$NETWORK.100 > + debug "NODE_ADDRESS=${NODE_ADDRESS}" > + DNSMASQ_PID=0 > + debug "preserve_vm=${preserve_vm}" > +} > + > +# cleans up any loose ends > +cleanup_after_testing () { > + debug "Cleaning up" > + stop_dnsmasq > + stop_networking > + # destroy any running vms > + vm_list=$(sudo virsh list --all | awk '/'${vm_prefix}-'/ { print $2 }') > + test -n "$vm_list" && for vm in $vm_list; do > + destroy_node $vm > + done > + stop_networking > + > + # do not delete the work directory if preserve was specified > + if $preserve_vm; then return; fi > + > + rm -rf $WORKDIR > +} > + > +# check commandline options > +test='' > +debugging=false > +isofile="${PWD}/ovirt-node-image.iso" > +show_viewer=false > +vm_prefix="$$" > +preserve_vm=false > +timeout_period="120" > + > +while getopts di:n:pt:vwh c; do > + case $c in > + d) debugging=true;; > + i) isofile=($OPTARG);; > + n) tests=($OPTARG);; > + p) preserve_vm=true;; > + t) timeout_period=($OPTARG);; > + v) set -v;; > + w) show_viewer=true;; > + h) usage; exit 0;; > + '?') die "invalid option \`-$OPTARG'";; > + :) die "missing argument to \`-$OPTARG' option";; > + *) die "internal error";; > + esac > +done > + > +isoname=$(basename $isofile) > +isofile="$(cd `dirname $isofile`; pwd)/${isoname}" > + > +if ! [ -s "${isofile}" ]; then > + die "Missing or invalid file: ${isofile}" > +fi > + > +shift $(($OPTIND - 1)) > + > +set +u > +if [ $# -gt 0 -a -n "$1" ]; then RESULTS=$1; else RESULTS=autotest.log; fi > +set -u > + > +result_file=$WORKDIR/results.log > +debug "result_file=${result_file}" > + > +log "Logging results to file: ${RESULTS}" > +{ > + setup_for_testing > + > + log "Begin Testing: ${isoname}" > + log "Tests: ${tests}" > + log "Timeout: ${timeout_period} ms" > + > + for test in ${tests}; do > + execute_test $test > + result=$? > + > + if [ $result != 0 ]; then > + echo "${result}" > $result_file > + break > + fi > + done > + > + log "End Testing: ${isoname}" > + > +} | sudo tee --append $RESULTS > + > +if [ -s "$result_file" ]; then > + exit $(cat $result_file) > +fi From dpierce at redhat.com Mon Mar 29 19:42:14 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Mar 2010 15:42:14 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <1269876934.3291.9.camel@localhost.localdomain> References: <1269639069-842-1-git-send-email-dpierce@redhat.com> <1269639069-842-2-git-send-email-dpierce@redhat.com> <1269876934.3291.9.camel@localhost.localdomain> Message-ID: <20100329194214.GH2948@mcpierce-desktop.usersys.redhat.com> On Mon, Mar 29, 2010 at 11:35:34AM -0400, Mike Burns wrote: > On Fri, 2010-03-26 at 17:31 -0400, Darryl L. Pierce wrote: > > The ISO can now be built by going into the recipe directory and building > > the ovirt-node-image.iso target. > > > > Signed-off-by: Darryl L. Pierce > > --- > > recipe/Makefile.am | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 files changed, 68 insertions(+), 0 deletions(-) > > > > diff --git a/recipe/Makefile.am b/recipe/Makefile.am > > index c8a7b94..a925f01 100644 > > --- a/recipe/Makefile.am > > +++ b/recipe/Makefile.am > > @@ -7,6 +7,14 @@ OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) > > > > FEDORA = $(shell rpm --eval '%{fedora}') > > ARCH = $(shell rpm --eval '%{_arch}') > More of a convenience consistent with the top level Makefile. We should > default ovirt-cache > +OVIRT_CACHE_DIR ?= $(HOME)/ovirt-cache Done. > > +OVIRT_NODE_RECIPE = ovirt-node-recipe.ks > > +PKG_FMT = iso > > +PACKAGE = ovirt-node-image > > +NODE_TMP = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp > > +OVIRT_LOCAL_REPO ?= file://$(OVIRT_CACHE_DIR)/ovirt > > +NODE_KS = $(NODE_TMP)/node.ks > > +NVR = $(PACKAGE)-$(VERSION)-$(ARCH) > > +SUM ?= sha1sum > ovirt-node-image makefile defaulted this variable also for dev builds. > +AUTH_KEYS ?= $(HOME)/.ssh/authorized_keys Done. > > > > OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools > > OVIRT_NODE_TOOLS_DATA = \ > > @@ -51,4 +59,64 @@ ovirt-node-recipe.ks: > > # XXX broken ksflatten leaves %include > > sed -i 's/^%include /#&/' $@ > > > > +keys: > > + if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \ > > + cp -va $(AUTH_KEYS) ovirt-authorized_keys ;\ > > + fi > > + > > +no_nscd: > > + if pgrep -xl nscd; then \ > > + echo "Please stop nscd" ;\ > > + exit 1 ;\ > > + fi > > + > > +# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT- > > +# annotated rpm version strings. > > +_ovirt_dev = \ > > + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ > > + $(srcdir)/*.spec.in && echo 1 || :) > I think this should be top_srcdir since there is no spec file in the > recipe directory. It needs to look at ovirt-node.spec.in in the top > level directory. > + $(top_srcdir)/*.spec.in && echo 1 || :) Ugh, we need a better way to deail with this since, in the long run, we shouldn't maintain a spec file in the source code repository (it properly belongs in the distro's packaging system). I'll work around this in the long run but, for now, will do as you suggest and point it up a level. > > + > > +SELINUX_ENFORCING=$(shell /usr/sbin/getenforce) > > +$(NVR).$(PKG_FMT): no_nscd keys > > + mkdir -p $(NODE_TMP) > > + mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH) > > + ( \ > > + case $(SELINUX_ENFORCING) in \ > > + Enforcing) sudo /usr/sbin/setenforce Permissive ;; \ > > + Permissive) ;; \ > > + *) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \ > > + then \ > > + echo WARNING: SELinux disabled in kickstart ;\ > > + else \ > > + echo ERROR: SELinux enabled in kickstart, \ > > + but disabled on the build machine ;\ > > + exit 1 ;\ > > + fi ;; \ > > + esac ;\ > > + ) > > + rm -f $(NODE_KS) > > + if [ "$(_ovirt_dev)" = 1 ]; then \ > > + echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\ > > + fi > > + cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS) > > + sudo livecd-creator --skip-minimize -c $(NODE_KS)\ > > + -f $(PACKAGE) \ > > + --tmpdir='$(NODE_TMP)' \ > > + --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)' > > + sudo chown $${USER} $(PACKAGE).$(PKG_FMT) > > + ( \ > > + if [ $(SELINUX_ENFORCING) = Enforcing ]; then \ > > + sudo /usr/sbin/setenforce Enforcing || exit 1 ;\ > > + fi \ > > + ) > > + > > + ln -nf $(PACKAGE).$(PKG_FMT) $(NVR).$(PKG_FMT) > > + > > +$(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) > > + $(SUM) $(NVR).$(PKG_FMT) > $(NVR).$(PKG_FMT).$(SUM) > > + > > +$(PACKAGE).$(PKG_FMT) node: ovirt-node-recipe.ks $(NVR).$(PKG_FMT).$(SUM) > > + > > +PUNGI = $(NODE_TMP)/tree/pungi > > + > > .PHONY: ovirt-node-recipe.ks repos.ks > > > Other than the above things, I saw one other thing that I'm not sure if > we should change or not. I had done a cleanup of my ovirt-cache > directory before trying this build. I didn't rebuild the ovirt-node > packages and the build failed because the default ovirt-local repo > didn't exist. We could change the condition that determines whether to > add the ovirt-local repo to check that it exists. If someone were to > override the OVIRT_LOCAL_REPO environment variable with something other > than a local file:// repo, it won't work. > > Thoughts? > > Mike > -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Mon Mar 29 19:53:06 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Mar 2010 15:53:06 -0400 Subject: [Ovirt-devel] Refactored new patch... Message-ID: <1269892387-21052-1-git-send-email-dpierce@redhat.com> This one incorporates feedback from mburns to default certain values. From dpierce at redhat.com Mon Mar 29 19:53:07 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Mar 2010 15:53:07 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <1269892387-21052-1-git-send-email-dpierce@redhat.com> References: <1269892387-21052-1-git-send-email-dpierce@redhat.com> Message-ID: <1269892387-21052-2-git-send-email-dpierce@redhat.com> The ISO can now be built by going into the recipe directory and building the ovirt-node-image.iso target. Signed-off-by: Darryl L. Pierce --- recipe/Makefile.am | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 89 insertions(+), 2 deletions(-) diff --git a/recipe/Makefile.am b/recipe/Makefile.am index c8a7b94..fb34437 100644 --- a/recipe/Makefile.am +++ b/recipe/Makefile.am @@ -1,12 +1,39 @@ +# Copyright (C) 2010, Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + FEDORA_MIRROR = http://mirrors.fedoraproject.org/mirrorlist CUR_RAWHIDE = 14 CUR_DEVEL = 13 CUR_PREVIEW = 12 -PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) -OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) +PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) +OVIRT_REPO_URL ?= http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) FEDORA = $(shell rpm --eval '%{fedora}') ARCH = $(shell rpm --eval '%{_arch}') +OVIRT_NODE_RECIPE = ovirt-node-recipe.ks +PKG_FMT = iso +PACKAGE = ovirt-node-image +OVIRT_CACHE_DIR ? =$(HOME)/ovirt-cache +NODE_TMP = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp +OVIRT_LOCAL_REPO ?= file://$(OVIRT_CACHE_DIR)/ovirt +NODE_KS = $(NODE_TMP)/node.ks +NVR = $(PACKAGE)-$(VERSION)-$(ARCH) +SUM ?= sha1sum +AUTH_KEYS ?= $(HOME)/.ssh/authorized_keys OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools OVIRT_NODE_TOOLS_DATA = \ @@ -51,4 +78,64 @@ ovirt-node-recipe.ks: # XXX broken ksflatten leaves %include sed -i 's/^%include /#&/' $@ +keys: + if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \ + cp -va $(AUTH_KEYS) ovirt-authorized_keys ;\ + fi + +no_nscd: + if pgrep -xl nscd; then \ + echo "Please stop nscd" ;\ + exit 1 ;\ + fi + +# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT- +# annotated rpm version strings. +_ovirt_dev = \ + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ + $(top_srcdir)/*.spec.in && echo 1 || :) + +SELINUX_ENFORCING=$(shell /usr/sbin/getenforce) +$(NVR).$(PKG_FMT): no_nscd keys + mkdir -p $(NODE_TMP) + mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH) + ( \ + case $(SELINUX_ENFORCING) in \ + Enforcing) sudo /usr/sbin/setenforce Permissive ;; \ + Permissive) ;; \ + *) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \ + then \ + echo WARNING: SELinux disabled in kickstart ;\ + else \ + echo ERROR: SELinux enabled in kickstart, \ + but disabled on the build machine ;\ + exit 1 ;\ + fi ;; \ + esac ;\ + ) + rm -f $(NODE_KS) + if [ "$(_ovirt_dev)" = 1 ]; then \ + echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\ + fi + cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS) + sudo livecd-creator --skip-minimize -c $(NODE_KS)\ + -f $(PACKAGE) \ + --tmpdir='$(NODE_TMP)' \ + --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)' + sudo chown $${USER} $(PACKAGE).$(PKG_FMT) + ( \ + if [ $(SELINUX_ENFORCING) = Enforcing ]; then \ + sudo /usr/sbin/setenforce Enforcing || exit 1 ;\ + fi \ + ) + + ln -nf $(PACKAGE).$(PKG_FMT) $(NVR).$(PKG_FMT) + +$(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) + $(SUM) $(NVR).$(PKG_FMT) > $(NVR).$(PKG_FMT).$(SUM) + +$(PACKAGE).$(PKG_FMT) node: ovirt-node-recipe.ks $(NVR).$(PKG_FMT).$(SUM) + +PUNGI = $(NODE_TMP)/tree/pungi + .PHONY: ovirt-node-recipe.ks repos.ks -- 1.6.6.1 From dpierce at redhat.com Mon Mar 29 19:55:39 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Mar 2010 15:55:39 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <1269876934.3291.9.camel@localhost.localdomain> References: <1269639069-842-1-git-send-email-dpierce@redhat.com> <1269639069-842-2-git-send-email-dpierce@redhat.com> <1269876934.3291.9.camel@localhost.localdomain> Message-ID: <20100329195539.GI2948@mcpierce-desktop.usersys.redhat.com> On Mon, Mar 29, 2010 at 11:35:34AM -0400, Mike Burns wrote: > Other than the above things, I saw one other thing that I'm not sure if > we should change or not. I had done a cleanup of my ovirt-cache > directory before trying this build. I didn't rebuild the ovirt-node > packages and the build failed because the default ovirt-local repo > didn't exist. We could change the condition that determines whether to > add the ovirt-local repo to check that it exists. If someone were to > override the OVIRT_LOCAL_REPO environment variable with something other > than a local file:// repo, it won't work. > > Thoughts? I'm game for doing this as a future patch rather than this one. I'm trying to minimally change the Makefile and just move it over for now. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Mon Mar 29 19:58:20 2010 From: mburns at redhat.com (Mike Burns) Date: Mon, 29 Mar 2010 15:58:20 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <1269892387-21052-2-git-send-email-dpierce@redhat.com> References: <1269892387-21052-1-git-send-email-dpierce@redhat.com> <1269892387-21052-2-git-send-email-dpierce@redhat.com> Message-ID: <1269892700.3291.12.camel@localhost.localdomain> On Mon, 2010-03-29 at 15:53 -0400, Darryl L. Pierce wrote: > The ISO can now be built by going into the recipe directory and building > the ovirt-node-image.iso target. > > Signed-off-by: Darryl L. Pierce > --- > recipe/Makefile.am | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++- > 1 files changed, 89 insertions(+), 2 deletions(-) > > diff --git a/recipe/Makefile.am b/recipe/Makefile.am > index c8a7b94..fb34437 100644 > --- a/recipe/Makefile.am > +++ b/recipe/Makefile.am > @@ -1,12 +1,39 @@ > +# Copyright (C) 2010, Red Hat, Inc. > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; version 2 of the License. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write to the Free Software > +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, > +# MA 02110-1301, USA. A copy of the GNU General Public License is > +# also available at http://www.gnu.org/copyleft/gpl.html. > + > FEDORA_MIRROR = http://mirrors.fedoraproject.org/mirrorlist > CUR_RAWHIDE = 14 > CUR_DEVEL = 13 > CUR_PREVIEW = 12 > -PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) > -OVIRT_REPO_URL = http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) > +PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) > +OVIRT_REPO_URL ?= http://ovirt.org/repos/ovirt/$(FEDORA)/$(ARCH) > > FEDORA = $(shell rpm --eval '%{fedora}') > ARCH = $(shell rpm --eval '%{_arch}') > +OVIRT_NODE_RECIPE = ovirt-node-recipe.ks > +PKG_FMT = iso > +PACKAGE = ovirt-node-image > +OVIRT_CACHE_DIR ? =$(HOME)/ovirt-cache > +NODE_TMP = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp > +OVIRT_LOCAL_REPO ?= file://$(OVIRT_CACHE_DIR)/ovirt > +NODE_KS = $(NODE_TMP)/node.ks > +NVR = $(PACKAGE)-$(VERSION)-$(ARCH) > +SUM ?= sha1sum > +AUTH_KEYS ?= $(HOME)/.ssh/authorized_keys > > OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools > OVIRT_NODE_TOOLS_DATA = \ > @@ -51,4 +78,64 @@ ovirt-node-recipe.ks: > # XXX broken ksflatten leaves %include > sed -i 's/^%include /#&/' $@ > > +keys: > + if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \ > + cp -va $(AUTH_KEYS) ovirt-authorized_keys ;\ > + fi > + > +no_nscd: > + if pgrep -xl nscd; then \ > + echo "Please stop nscd" ;\ > + exit 1 ;\ > + fi > + > +# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT- > +# annotated rpm version strings. > +_ovirt_dev = \ > + $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \ > + $(top_srcdir)/*.spec.in && echo 1 || :) > + > +SELINUX_ENFORCING=$(shell /usr/sbin/getenforce) > +$(NVR).$(PKG_FMT): no_nscd keys > + mkdir -p $(NODE_TMP) > + mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH) > + ( \ > + case $(SELINUX_ENFORCING) in \ > + Enforcing) sudo /usr/sbin/setenforce Permissive ;; \ > + Permissive) ;; \ > + *) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \ > + then \ > + echo WARNING: SELinux disabled in kickstart ;\ > + else \ > + echo ERROR: SELinux enabled in kickstart, \ > + but disabled on the build machine ;\ > + exit 1 ;\ > + fi ;; \ > + esac ;\ > + ) > + rm -f $(NODE_KS) > + if [ "$(_ovirt_dev)" = 1 ]; then \ > + echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\ > + fi > + cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS) > + sudo livecd-creator --skip-minimize -c $(NODE_KS)\ > + -f $(PACKAGE) \ > + --tmpdir='$(NODE_TMP)' \ > + --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)' > + sudo chown $${USER} $(PACKAGE).$(PKG_FMT) > + ( \ > + if [ $(SELINUX_ENFORCING) = Enforcing ]; then \ > + sudo /usr/sbin/setenforce Enforcing || exit 1 ;\ > + fi \ > + ) > + > + ln -nf $(PACKAGE).$(PKG_FMT) $(NVR).$(PKG_FMT) > + > +$(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) > + $(SUM) $(NVR).$(PKG_FMT) > $(NVR).$(PKG_FMT).$(SUM) > + > +$(PACKAGE).$(PKG_FMT) node: ovirt-node-recipe.ks $(NVR).$(PKG_FMT).$(SUM) > + > +PUNGI = $(NODE_TMP)/tree/pungi > + > .PHONY: ovirt-node-recipe.ks repos.ks ACK From dpierce at redhat.com Mon Mar 29 20:09:00 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Mar 2010 16:09:00 -0400 Subject: [Ovirt-devel] [PATCH] Moves building ovirt-node-image.iso into the ovirt-node repo. In-Reply-To: <1269892700.3291.12.camel@localhost.localdomain> References: <1269892387-21052-1-git-send-email-dpierce@redhat.com> <1269892387-21052-2-git-send-email-dpierce@redhat.com> <1269892700.3291.12.camel@localhost.localdomain> Message-ID: <20100329200900.GK2948@mcpierce-desktop.usersys.redhat.com> On Mon, Mar 29, 2010 at 03:58:20PM -0400, Mike Burns wrote: > ACK Thanks. This is now pushed upstream. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Mon Mar 29 20:12:31 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Mar 2010 16:12:31 -0400 Subject: [Ovirt-devel] [PATCH node] Update autobuild and autotest scripts for new build structure In-Reply-To: <1269642326-3751-1-git-send-email-mburns@redhat.com> References: <1269642326-3751-1-git-send-email-mburns@redhat.com> Message-ID: <20100329201231.GL2948@mcpierce-desktop.usersys.redhat.com> On Fri, Mar 26, 2010 at 06:25:26PM -0400, Mike Burns wrote: > Autobuild has to be updated to call make in the recipe directory > and move the resulting iso to the main build directory. > > Importing the existing autotest.sh script from ovirt-node-image > > Signed-off-by: Mike Burns > --- > autobuild.sh | 7 + > autotest.sh | 764 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 771 insertions(+), 0 deletions(-) > > diff --git a/autobuild.sh b/autobuild.sh > index 0ac1e58..8517164 100755 > --- a/autobuild.sh > +++ b/autobuild.sh > @@ -41,3 +41,10 @@ if [ -f /usr/bin/rpmbuild ]; then > fi > rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean *.tar.gz > fi > + > +#make iso > +cd recipe > +make The default target in the recipe directory is to make the repos.ks target. This line should explicitly call "make ovirt-node-image.iso" to generate the livecd image. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Mon Mar 29 20:13:25 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Mar 2010 16:13:25 -0400 Subject: [Ovirt-devel] [PATCH node] Update autobuild and autotest scripts for new build structure In-Reply-To: <1269877023.3291.10.camel@localhost.localdomain> References: <1269642326-3751-1-git-send-email-mburns@redhat.com> <1269877023.3291.10.camel@localhost.localdomain> Message-ID: <20100329201325.GM2948@mcpierce-desktop.usersys.redhat.com> On Mon, Mar 29, 2010 at 11:37:03AM -0400, Mike Burns wrote: > > +#make iso > > +cd recipe > > +make > previous line should be > make ovirt-node-image.iso > > I will re-submit this patch when the final version of Darryl's patches > get accepted. With that change: ACK (sorry, didn't see this email before sending my previous reply) -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Mon Mar 29 20:27:53 2010 From: mburns at redhat.com (Mike Burns) Date: Mon, 29 Mar 2010 16:27:53 -0400 Subject: [Ovirt-devel] [PATCH node] Update autobuild and autotest scripts for new build structure In-Reply-To: <20100329201325.GM2948@mcpierce-desktop.usersys.redhat.com> References: <1269642326-3751-1-git-send-email-mburns@redhat.com> <1269877023.3291.10.camel@localhost.localdomain> <20100329201325.GM2948@mcpierce-desktop.usersys.redhat.com> Message-ID: <1269894473.3291.13.camel@localhost.localdomain> On Mon, 2010-03-29 at 16:13 -0400, Darryl L. Pierce wrote: > On Mon, Mar 29, 2010 at 11:37:03AM -0400, Mike Burns wrote: > > > +#make iso > > > +cd recipe > > > +make > > previous line should be > > make ovirt-node-image.iso > > > > I will re-submit this patch when the final version of Darryl's patches > > get accepted. > > With that change: ACK > > (sorry, didn't see this email before sending my previous reply) > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel Thanks, Pushed upstream From mburns at redhat.com Tue Mar 30 15:21:54 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 30 Mar 2010 11:21:54 -0400 Subject: [Ovirt-devel] [PATCH node] Default OVIRT_CACHE_DIR to be in root autobuild directory Message-ID: <1269962514-21366-1-git-send-email-mburns@redhat.com> Previously was not getting set to anything resulting in cache being stored in ~/ovirt-cache. For systems where multiple autobuilds are running, this can lead to issues with builds for one version getting rpms generated by another version. Signed-off-by: Mike Burns --- autobuild.sh | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index f2b581d..b3c7f82 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -25,6 +25,8 @@ set -v test -f Makefile && make -k distclean || : +OVIRT_CACHE_DIR=${AUTOBUILD_SOURCE_ROOT}/.. + ./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT make make install -- 1.6.6.1 From jcclouduser at gmail.com Sat Mar 27 05:44:18 2010 From: jcclouduser at gmail.com (clouduser s) Date: Sat, 27 Mar 2010 11:14:18 +0530 Subject: [Ovirt-devel] Eucalyptus vs Deltacloud Message-ID: I am looking for the java opensource tool which i can manage the cloud infrastrucute. Such as i need to integrate the tool with my java web application. Could any one done the same as above or please suggest the tool as follows,.... deltacloud opennebula -------------- next part -------------- An HTML attachment was scrubbed... URL: From mburns at redhat.com Tue Mar 30 16:20:56 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 30 Mar 2010 12:20:56 -0400 Subject: [Ovirt-devel] [PATCH node] Default OVIRT_CACHE_DIR to be in root autobuild directory In-Reply-To: <1269962514-21366-1-git-send-email-mburns@redhat.com> References: <1269962514-21366-1-git-send-email-mburns@redhat.com> Message-ID: <1269966056.3291.1086.camel@localhost.localdomain> Please disregard, testing highlighted other issues. I'll post another patch shortly Mike On Tue, 2010-03-30 at 11:21 -0400, Mike Burns wrote: > Previously was not getting set to anything resulting in cache > being stored in ~/ovirt-cache. For systems where multiple autobuilds > are running, this can lead to issues with builds for one version > getting rpms generated by another version. > > Signed-off-by: Mike Burns > --- > autobuild.sh | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/autobuild.sh b/autobuild.sh > index f2b581d..b3c7f82 100755 > --- a/autobuild.sh > +++ b/autobuild.sh > @@ -25,6 +25,8 @@ set -v > > test -f Makefile && make -k distclean || : > > +OVIRT_CACHE_DIR=${AUTOBUILD_SOURCE_ROOT}/.. > + > ./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT > make > make install From mburns at redhat.com Tue Mar 30 16:23:24 2010 From: mburns at redhat.com (Mike Burns) Date: Tue, 30 Mar 2010 12:23:24 -0400 Subject: [Ovirt-devel] [PATCH node] Default OVIRT_CACHE_DIR to be in root autobuild directory Message-ID: <1269966204-24499-1-git-send-email-mburns@redhat.com> Previously was not getting set to anything resulting in cache being stored in ~/ovirt-cache. For systems where multiple autobuilds are running, this can lead to issues with builds for one version getting rpms generated by another version. Also, set ovirt-local repo to pull from the autobuild package root. Signed-off-by: Mike Burns --- autobuild.sh | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index f2b581d..92b3d32 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -25,6 +25,9 @@ set -v test -f Makefile && make -k distclean || : +OVIRT_CACHE_DIR=${AUTOBUILD_SOURCE_ROOT}/../ovirt-cache +OVIRT_LOCAL_REPO=file://${AUTOBUILD_PACKAGE_ROOT}/rpm/RPMS + ./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT make make install @@ -44,7 +47,10 @@ fi #make iso cd recipe -make ovirt-node-image.iso +make \ + OVIRT_LOCAL_REPO=$OVIRT_LOCAL_REPO \ + OVIRT_CACHE_DIR=$OVIRT_CACHE_DIR \ +ovirt-node-image.iso #copy iso back to main directory for autotest.sh cp *iso .. -- 1.6.6.1 From dpierce at redhat.com Wed Mar 31 13:14:12 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 31 Mar 2010 09:14:12 -0400 Subject: [Ovirt-devel] [PATCH node] Default OVIRT_CACHE_DIR to be in root autobuild directory In-Reply-To: <1269966204-24499-1-git-send-email-mburns@redhat.com> References: <1269966204-24499-1-git-send-email-mburns@redhat.com> Message-ID: <20100331131412.GN2948@mcpierce-desktop.usersys.redhat.com> On Tue, Mar 30, 2010 at 12:23:24PM -0400, Mike Burns wrote: > Previously was not getting set to anything resulting in cache > being stored in ~/ovirt-cache. For systems where multiple autobuilds > are running, this can lead to issues with builds for one version > getting rpms generated by another version. > > Also, set ovirt-local repo to pull from the autobuild package root. > > Signed-off-by: Mike Burns > --- > autobuild.sh | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/autobuild.sh b/autobuild.sh > index f2b581d..92b3d32 100755 > --- a/autobuild.sh > +++ b/autobuild.sh > @@ -25,6 +25,9 @@ set -v > > test -f Makefile && make -k distclean || : > > +OVIRT_CACHE_DIR=${AUTOBUILD_SOURCE_ROOT}/../ovirt-cache > +OVIRT_LOCAL_REPO=file://${AUTOBUILD_PACKAGE_ROOT}/rpm/RPMS > + > ./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT > make > make install > @@ -44,7 +47,10 @@ fi > > #make iso > cd recipe > -make ovirt-node-image.iso > +make \ > + OVIRT_LOCAL_REPO=$OVIRT_LOCAL_REPO \ > + OVIRT_CACHE_DIR=$OVIRT_CACHE_DIR \ > +ovirt-node-image.iso > > #copy iso back to main directory for autotest.sh > cp *iso .. > -- > 1.6.6.1 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Mar 31 14:28:11 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 31 Mar 2010 10:28:11 -0400 Subject: [Ovirt-devel] [PATCH node] avoid fedora-release conflict In-Reply-To: <1269636364-14909-1-git-send-email-apevec@redhat.com> References: <1269636364-14909-1-git-send-email-apevec@redhat.com> Message-ID: <1270045692.2287.1.camel@mburns-laptop.bos.redhat.com> On Fri, 2010-03-26 at 21:46 +0100, Alan Pevec wrote: > move banner modification to kickstart %post > --- > ovirt-node.spec.in | 14 +------------- > recipe/ovirt-node-image.ks | 9 +++++++++ > 2 files changed, 10 insertions(+), 13 deletions(-) > > diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in > index 032a5a9..eaf52cc 100644 > --- a/ovirt-node.spec.in > +++ b/ovirt-node.spec.in > @@ -154,25 +154,17 @@ python nodeadmin/setup.py install --root %{buildroot} > > echo "oVirt Node release %{version}-%{release}" > %{buildroot}%{_sysconfdir}/ovirt-release > mkdir -p %{buildroot}/%{_sysconfdir}/default > -echo "# File where default partitioning info is kept" > %{buildroot}/%{_sysconfdir}/default/ovirt > +echo "# File where default configuration is kept" > %{buildroot}/%{_sysconfdir}/default/ovirt > > # ovirt-logos > # should be ifarch i386 > -mkdir -p %{buildroot}/boot/grub > install -p -m 644 images/grub-splash.xpm.gz %{buildroot}%{app_root} > # end i386 bits > -mkdir -p %{buildroot}/usr/lib/anaconda-runtime > install -p -m 644 images/syslinux-vesa-splash.jpg %{buildroot}%{app_root} > # ovirt-logos > > # release files > echo "%{product_family} release %{version}%{?beta: %{beta}} (%{release})" > %{buildroot}/etc/ovirt-release > -cp %{buildroot}/etc/ovirt-release %{buildroot}/etc/issue > -echo "Kernel \r on an \m (\l)" >> %{buildroot}/etc/issue > -cp %{buildroot}/etc/issue %{buildroot}/etc/issue.net > -echo >> %{buildroot}/etc/issue > -ln -s ovirt-release %{buildroot}/etc/redhat-release > -ln -s ovirt-release %{buildroot}/etc/system-release > > # ovirt-config-boot post-install hooks > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-config-boot.d > @@ -247,10 +239,6 @@ fi > %defattr(-,root,root) > %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/ovirt-release > %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/default/ovirt > -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/redhat-release > -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/system-release > -%config(noreplace) %attr(0644,root,root) /etc/issue > -%config(noreplace) %attr(0644,root,root) /etc/issue.net > > %config(noreplace) %{_sysconfdir}/logrotate.d/ovirt-node > %config(noreplace) %{_sysconfdir}/cron.d/ovirt-logrotate > diff --git a/recipe/ovirt-node-image.ks b/recipe/ovirt-node-image.ks > index 270eb77..7c9361c 100644 > --- a/recipe/ovirt-node-image.ks > +++ b/recipe/ovirt-node-image.ks > @@ -84,6 +84,15 @@ linux0==1 && $1=="label" && $2!="linux0" { > mv $LIVE_ROOT/isolinux/isolinux.cfg.standalone $LIVE_ROOT/isolinux/isolinux.cfg > > cp $INSTALL_ROOT/usr/share/ovirt-node/syslinux-vesa-splash.jpg $LIVE_ROOT/isolinux/splash.jpg > + > +# overwrite user visible banners with the image versioning info > +PACKAGE=ovirt > +ln -snf $PACKAGE-release $INSTALL_ROOT/etc/redhat-release > +ln -snf $PACKAGE-release $INSTALL_ROOT/etc/system-release > +cp $INSTALL_ROOT/etc/$PACKAGE-release $INSTALL_ROOT/etc/issue > +echo "Kernel \r on an \m (\l)" >> $INSTALL_ROOT/etc/issue > +cp $INSTALL_ROOT/etc/issue $INSTALL_ROOT/etc/issue.net > + > %end > > %post ACK From mburns at redhat.com Wed Mar 31 15:48:17 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 31 Mar 2010 11:48:17 -0400 Subject: [Ovirt-devel] [PATCH node] Handle space in storage wwid Message-ID: <1270050497-7811-1-git-send-email-mburns@redhat.com> Quote everywhere that we reference wwid in o-c-storage, o-c-boot and ovirt-functions. Signed-off-by: Mike Burns --- scripts/ovirt-config-boot | 6 +- scripts/ovirt-config-storage | 178 +++++++++++++++++++++--------------------- scripts/ovirt-functions | 38 +++++----- 3 files changed, 111 insertions(+), 111 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index d545878..347fc18 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -88,7 +88,7 @@ ovirt_boot_setup() { rc=0 else candidate_dev=$(findfs LABEL=$candidate 2>/dev/null) - e2label $candidate_dev RootNew + e2label "$candidate_dev" RootNew rc=$? fi if [ $rc -ne 0 ]; then @@ -97,7 +97,7 @@ ovirt_boot_setup() { return $rc fi - mount $candidate_dev /liveos/ + mount "$candidate_dev" /liveos/ rm -rf /liveos/LiveOS mkdir -p /liveos/LiveOS @@ -175,7 +175,7 @@ EOF if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then umount /liveos # mark new Root ready to go, reboot() in ovirt-function switches it to active - e2label $candidate_dev RootUpdate + e2label "$candidate_dev" RootUpdate fi rm -rf $tmpdir diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 8d59a6b..9fee10e 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -36,12 +36,12 @@ swap_min_size=5 # return sd name for given #:# identifier get_sd_name() { - local id=$1 - local device_var=$2 + local id="$1" + local device_var="$2" local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1) if [ -n "$device_sys" ]; then - eval $device_var=$(basename $(dirname $device_sys)) + eval $device_var=$(basename $(dirname "$device_sys")) return fi eval $device_var=1 @@ -49,23 +49,23 @@ get_sd_name() { # gets the dependent block devices for multipath devices get_multipath_devices() { - local mpath_device=mpath-$(basename $1) - local deplist_var=$2 + local mpath_device=mpath-$(basename "$1") + local deplist_var="$2" local deplist="" #get dependencies for multipath device - local deps=$(dmsetup deps -u $mpath_device \ + local deps=$(dmsetup deps -u "$mpath_device" \ | sed -r 's/\(([0-9]+), ([0-9]+)\)/\1:\2/g' \ | sed 's/ /\n/g' | grep [0-9]:[0-9] ) local device="" - for dep in $deps + for dep in "$deps" do local device="" - get_sd_name $dep device - if [[ ! $device = 1 ]]; then - if [[ $deplist = "" ]]; then - deplist=$device + get_sd_name "$dep" device + if [[ ! "$device" = 1 ]]; then + if [[ "$deplist" = "" ]]; then + deplist="$device" else deplist="$deplist $device" fi @@ -79,8 +79,8 @@ get_multipath_devices() { #return sdX device if no multipath device translate_multipath_device() { #trim so that only sdX is stored, but support passing /dev/sdX - local dev=$1 - local mpath_var=$2 + local dev="$1" + local mpath_var="$2" if [ -z "$dev" ]; then if [ -n "$mpath_var" ]; then @@ -89,36 +89,36 @@ translate_multipath_device() { return fi if [[ "$dev" =~ "/dev/mapper" ]]; then - eval $mpath_var=$dev + eval $math_var="$dev" return fi - local dm_dev=/dev/$(multipath -ll $dev | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') + local dm_dev=/dev/$(multipath -ll "$dev" | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') local mpath_device= - get_dm_device $dm_dev mpath_device + get_dm_device "$dm_dev" mpath_device if [ -z "$mpath_device" ]; then - mpath_device=$dev + mpath_device="$dev" fi - eval $mpath_var=$mpath_device + eval $mpath_var="$mpath_device" } get_drive_size() { - local drive=$1 - local space_var=$2 + local drive="$1" + local space_var="$2" local size= - local udi=$(hal-find-by-property --key block.device --string $drive) + local udi=$(hal-find-by-property --key block.device --string "$drive") # if more than one UDI was found then iterate over them to find the base device if [[ "${udi}" =~ \$ ]]; then - udi=$(echo $udi | sed 's/\$/ /g') + udi=$(echo "$udi" | sed 's/\$/ /g') for found in ${udi}; do - if [[ "false" == $(hal-get-property --udi $found --key block.is_volume) ]]; then - udi=$found + if [[ "false" == $(hal-get-property --udi "$found" --key block.is_volume) ]]; then + udi="$found" break fi done @@ -127,7 +127,7 @@ get_drive_size() # If hal didn't find the device, it could be a virtio block device # or a multipath device # In this case, use sfdisk -s to get the size - size=$(sfdisk -s $drive 2>/dev/null) + size=$(sfdisk -s "$drive" 2>/dev/null) if [ -z "$size" ]; then size=0 fi @@ -147,7 +147,7 @@ get_drive_size() echo "$drive ($size MB)" test -z "$udi" || echo "Disk Identifier: $(basename "$udi")" if [ -n "$space_var" ]; then - eval $space_var=$size + eval $space_var="$size" fi } @@ -155,7 +155,7 @@ check_partition_sizes() { local disk_size need_size - local min_data_size=$DATA_SIZE + local min_data_size="$DATA_SIZE" if [ "$DATA_SIZE" = -1 ]; then min_data_size=5 fi @@ -164,7 +164,7 @@ check_partition_sizes() if [ "$OVIRT_ISCSI_ENABLED" == "y" ]; then get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE drive_list="BOOT" - BOOT_NEED_SIZE=$BOOT_SIZE + BOOT_NEED_SIZE="$BOOT_SIZE" else get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE @@ -172,7 +172,7 @@ check_partition_sizes() HOSTVG_NEED_SIZE=$(echo "scale=0;" \ "$SWAP_SIZE + $CONFIG_SIZE + $LOGGING_SIZE + $min_data_size" | bc -l) - if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then + if [ "$ROOTDRIVE" == "$HOSTVGDRIVE" ]; then drive_list="ROOT" ROOT_NEED_SIZE=$(echo "scale=0; $ROOT_SIZE * 2 + $HOSTVG_NEED_SIZE"| bc -l) else @@ -204,7 +204,7 @@ check_partition_sizes() # check if an existing HostVG exists on a device other than the target if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then devices="$(pvs -o pv_name,vg_name --noheadings | \ - grep "HostVG"|grep -v $HOSTVGDRIVE|awk '{ print $1 }')" + grep "HostVG"|grep -v "$HOSTVGDRIVE"|awk '{ print $1 }')" rc=0 if [ -n "$devices" ]; then printf "\n" @@ -230,7 +230,7 @@ check_partition_sizes() manual_input() { local manual_device - local return_var=$1 + local return_var="$1" while true; do read -rp "Enter disk device path: " manual_device if [ -z "$device" ]; then @@ -239,7 +239,7 @@ manual_input() fi translate_multipath_device "$manual_device" manual_device if [ -n "$manual_device" ]; then - if [ -b "$(readlink -f $device)" ]; then + if [ -b "$(readlink -f "$device")" ]; then eval $return_var="$manual_device" return 0 fi @@ -273,7 +273,7 @@ get_dev_name() test "X$drive_type" = Xdisk || continue local block_dev=$(hal-get-property --udi "$d" --key block.device) # Must start with a '/'. - case $block_dev in + case "$block_dev" in *' '*) # we use space as separator warn "block device name '$block_dev' contains space; skipping"; @@ -288,7 +288,7 @@ get_dev_name() done d="" for d in $byid_list; do - devices="$devices `readlink -f $d`"; + devices="$devices $(readlink -f "$d")"; done # FIXME: workaround for detecting virtio block devices @@ -296,7 +296,7 @@ get_dev_name() # FIXME: workaround for detecting cciss devices for dev in $(ls /dev/cciss 2>/dev/null); do - if [[ ! $dev =~ p[0-9]+\$ ]]; then + if [[ ! "$dev" =~ p[0-9]+\$ ]]; then devices="$devices /dev/cciss/dev" fi done @@ -306,7 +306,7 @@ get_dev_name() for dev in $(dmsetup ls --target=multipath | awk '{print $1}'); do devices="$devices /dev/mapper/$dev" local sd_devs="" - get_multipath_devices $dev sd_devs + get_multipath_devices "$dev" sd_devs devs_to_remove="${devs_to_remove} ${sd_devs}" done @@ -352,7 +352,7 @@ do_configure() printf "\n\nPlease select the disk to use for the Boot partition.\n\n" BOOTDRIVE=$(get_dev_name) || return 0 get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE - echo $BOOTDRIVE + echo "$BOOTDRIVE" else printf "\n\nPlease select the disk to use for the Root.\n\n" ROOTDRIVE=$(get_dev_name) || return 0 @@ -361,13 +361,13 @@ do_configure() printf "\n\nPlease select the disk to use for the HostVG.\n\n" HOSTVGDRIVE=$(get_dev_name) || return 0 local skipped=false - if check_existing_hostvg $HOSTVGDRIVE devs; then + if check_existing_hostvg "$HOSTVGDRIVE" devs; then for dev in $devs do printf "Removing HostVG on $dev will erase the drive and cannot be undone\n" if ask_yes_or_no "Do you want to remove HostVG from $dev (y/n)?"; then start_log - if ! wipe_lvm_on_disk $dev; then + if ! wipe_lvm_on_disk "$dev"; then stop_log return 1 fi @@ -379,7 +379,7 @@ do_configure() fi $skipped && printf "Installation cannot proceed with existing HostVG.\n" && return 0 get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE - echo $HOSTVGDRIVESPACE + echo "$HOSTVGDRIVESPACE" fi printf "\n\nPlease configure storage partitions.\n\n" printf "* Enter partition sizes in MB.\n" @@ -459,7 +459,7 @@ set /files$OVIRT_DEFAULTS/OVIRT_VOL_LOGGING_SIZE $LOGGING_SIZE set /files$OVIRT_DEFAULTS/OVIRT_VOL_DATA_SIZE $DATA_SIZE EOF - if [ -n $BOOTDRIVE ]; then + if [ -n "$BOOTDRIVE" ]; then augtool </dev/null|sort -u); do + for vg in $(pvs -o vg_name --noheadings "$dev" "$dev${dev_delim}[0-9]"* 2>/dev/null|sort -u); do if pvs -o pv_name,vg_name --noheadings | \ - grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then + grep "$vg" | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then log "The volume group \"$vg\" spans multiple disks." log "This operation cannot complete. Please manually" log "cleanup the storage using standard linux tools." @@ -583,7 +583,7 @@ reread_partitions() if [[ $drive =~ "/dev/mapper" ]]; then kpartx -a -p p $drive else - blockdev --rereadpt $drive + blockdev --rereadpt "$drive" fi } @@ -617,19 +617,19 @@ perform_partitioning() log "Partitioning drive: $BOOTDRIVE" log "Wiping old boot sector" dd if=/dev/zero of=$BOOTDRIVE bs=1024K count=1 - reread_partitions $BOOTDRIVE - partprobe -s $BOOTDRIVE + reread_partitions "$BOOTDRIVE" + partprobe -s "$BOOTDRIVE" log "Creating boot partition" - parted $BOOTDRIVE -s "mklabel ${LABEL_TYPE}" - parted $BOOTDRIVE -s "mkpartfs primary ext2 0M ${boot_size_si}M" - reread_partitions $BOOTDRIVE - partboot=$BOOTDRIVE1 - if [ ! -e $partboot ]; then - partboot=${BOOTDRIVE}p1 + parted "$BOOTDRIVE" -s "mklabel ${LABEL_TYPE}" + parted "$BOOTDRIVE" -s "mkpartfs primary ext2 0M ${boot_size_si}M" + reread_partitions "$BOOTDRIVE" + partboot="$BOOTDRIVE1" + if [ ! -e "$partboot" ]; then + partboot="${BOOTDRIVE}p1" fi # sleep to ensure filesystems are created before continuing sleep 10 - mke2fs ${partboot} -L Boot + mke2fs "${partboot}" -L Boot tune2fs -c 0 -i 0 ${partboot} log "Completed!" return @@ -639,58 +639,58 @@ perform_partitioning() log "Partitioning drive: $ROOTDRIVE" # FIXME: save a backup copy, just in case? log "Wiping old boot sector" - dd if=/dev/zero of=$ROOTDRIVE bs=1024K count=1 - reread_partitions $ROOTDRIVE - partprobe -s $ROOTDRIVE + dd if=/dev/zero of="$ROOTDRIVE" bs=1024K count=1 + reread_partitions "$ROOTDRIVE" + partprobe -s "$ROOTDRIVE" log "Labeling Drive: $ROOTDRIVE" - parted $ROOTDRIVE -s "mklabel ${LABEL_TYPE}" + parted "$ROOTDRIVE" -s "mklabel ${LABEL_TYPE}" - if [ $ROOTDRIVE != $HOSTVGDRIVE ]; then + if [ "$ROOTDRIVE" != "$HOSTVGDRIVE" ]; then log "Labeling Drive: $HOSTVGDRIVE" - parted $HOSTVGDRIVE -s "mklabel ${LABEL_TYPE}" + parted "$HOSTVGDRIVE" -s "mklabel ${LABEL_TYPE}" fi log "Creating Root and RootBackup Partitions" let RootBackup_end=${ROOT_SIZE}*2 parted $ROOTDRIVE -s "mkpart primary ext2 0M ${ROOT_SIZE}M" parted $ROOTDRIVE -s "mkpart primary ext2 ${ROOT_SIZE}M ${RootBackup_end}M" reread_partitions $ROOTDRIVE - partroot=${ROOTDRIVE}1 - partrootbackup=${ROOTDRIVE}2 - if [ ! -e $partroot ]; then - partroot=${ROOTDRIVE}p1 - partrootbackup=${ROOTDRIVE}p2 + partroot="${ROOTDRIVE}1" + partrootbackup="${ROOTDRIVE}2" + if [ ! -e "$partroot" ]; then + partroot="${ROOTDRIVE}p1" + partrootbackup="${ROOTDRIVE}p2" fi # sleep to ensure filesystems are created before continuing sleep 10 - mke2fs ${partroot} -L Root - mke2fs ${partrootbackup} -L RootBackup - tune2fs -c 0 -i 0 ${partroot} - tune2fs -c 0 -i 0 ${partrootbackup} + mke2fs "${partroot}" -L Root + mke2fs "${partrootbackup}" -L RootBackup + tune2fs -c 0 -i 0 "${partroot}" + tune2fs -c 0 -i 0 "${partrootbackup}" log "Creating LVM partition" - if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then + if [ "$ROOTDRIVE" == "$HOSTVGDRIVE" ]; then parted $HOSTVGDRIVE -s "mkpart primary ext2 ${RootBackup_end}M -1" hostvgpart="3" else - parted $HOSTVGDRIVE -s "mkpart primary ext2 0M -1" + parted "$HOSTVGDRIVE" -s "mkpart primary ext2 0M -1" hostvgpart="1" fi log "Toggling LVM on" - parted $HOSTVGDRIVE -s "set $hostvgpart lvm on" - parted $ROOTDRIVE -s "print" + parted "$HOSTVGDRIVE" -s "set $hostvgpart lvm on" + parted "$ROOTDRIVE" -s "print" udevadm settle 2> /dev/null || udevsettle - reread_partitions $HOSTVGDRIVE + reread_partitions "$HOSTVGDRIVE" # sync GPT to the legacy MBR partitions if [ "gpt" == "$LABEL_TYPE" ]; then log "Running gptsync to create legacy mbr" - gptsync $ROOTDRIVE + gptsync "$ROOTDRIVE" fi - partpv=${HOSTVGDRIVE}${hostvgpart} + partpv="${HOSTVGDRIVE}${hostvgpart}" if [ ! -e "$partpv" ]; then # e.g. /dev/cciss/c0d0p2 - partpv=${HOSTVGDRIVE}p${hostvgpart} + partpv="${HOSTVGDRIVE}p${hostvgpart}" fi log "Creating physical volume" if [ ! -e "$partpv" ]; then @@ -806,18 +806,18 @@ while true; do for OPTION in "$@"; do while true; do read -ep "Enter $OPTION: " - if [[ $REPLY == "q" || $REPLY == "Q" ]]; then + if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then return fi if [ "$OPTION" == "Target IP" ]; then - OVIRT_ISCSI_TARGET_IP=$REPLY + OVIRT_ISCSI_TARGET_IP="$REPLY" if [ -n "$REPLY" ]; then break; fi elif [ "$OPTION" == "Target Port" ]; then - OVIRT_ISCSI_TARGET_PORT=$REPLY + OVIRT_ISCSI_TARGET_PORT="$REPLY" if [ -z "$REPLY" ]; then OVIRT_ISCSI_TARGET_PORT="3260" break; @@ -826,11 +826,11 @@ while true; do fi elif [ "$OPTION" == "CHAP Username" ]; then - OVIRT_ISCSI_CHAP_USERNAME=$REPLY + OVIRT_ISCSI_CHAP_USERNAME="$REPLY" break elif [ "$OPTION" == "CHAP Password" ]; then - OVIRT_ISCSI_CHAP_PASSWORD=$REPLY + OVIRT_ISCSI_CHAP_PASSWORD="$REPLY" break; fi done @@ -868,7 +868,7 @@ set /files/etc/default/ovirt/OVIRT_ISCSI_CHAP_PASSWORD $OVIRT_ISCSI_CHAP_PASSWOR EOF fi - iscsiadm -p $OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT -m discovery -t sendtargets + iscsiadm -p "$OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT" -m discovery -t sendtargets log "Restarting iscsi service" service iscsi restart @@ -927,8 +927,8 @@ if [ -n "$OVIRT_INIT" ]; then # if present, use the drive selected with 'ovirt_init' boot parameter # setting these the same until kernel cmdline argument implemented translate_multipath_device "$OVIRT_INIT" DRIVE - ROOTDRIVE=$DRIVE - HOSTVGDRIVE=$DRIVE + ROOTDRIVE="$DRIVE" + HOSTVGDRIVE="$DRIVE" get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE fi @@ -943,7 +943,7 @@ if [ "$1" == "AUTO" ]; then log "Beginning automatic disk partitioning.\n" if [ -n "$OVIRT_INIT" ]; then # do not format if HostVG exists on selected disk... - check_existing_hostvg $HOSTVGDRIVE + check_existing_hostvg "$HOSTVGDRIVE" existingHostVG=$? # ... unless overridden by ovirt_firstboot parameter if is_firstboot || [ $existingHostVG -ne 0 ]; then diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index d8aa008..edf6267 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -148,7 +148,7 @@ EOF # wipe_volume_group() { - vg=$1 + vg="$1" for d in $(grep $vg /proc/mounts|awk '{print $2}'); do log "Unmounting $d" @@ -156,10 +156,10 @@ wipe_volume_group() done for d in $(grep $vg /proc/swaps|awk '{print $1}'); do log "Turning off $d" - swapoff $d + swapoff "$d" done log "Removing $vg" - vgremove -f $vg + vgremove -f "$vg" } # find_srv SERVICE PROTO @@ -719,10 +719,10 @@ reboot() { if [ "$OVIRT_ISCSI_ENABLED" = "yes" ]; then # setup new Root if update is prepared if findfs LABEL=RootUpdate 2>&1 >/dev/null; then - root_update_dev=$(findfs LABEL=RootUpdate 2>/dev/null) - root_dev=$(findfs LABEL=Root 2>/dev/null) - e2label $root_dev RootBackup - e2label $root_update_dev Root + root_update_dev="$(findfs LABEL=RootUpdate 2>/dev/null)" + root_dev="$(findfs LABEL=Root 2>/dev/null)" + e2label "$root_dev" RootBackup + e2label "$root_update_dev" Root fi fi # run post-install hooks @@ -812,12 +812,12 @@ network_up () { # Cleans partition tables wipe_partitions() { - local drive=$1 + local drive="$1" log "Wiping old boot sector" - dd if=/dev/zero of=$drive bs=1024K count=1 + dd if=/dev/zero of="$drive" bs=1024K count=1 # zero out the GPT secondary header log "Wiping secondary gpt header" - local disk_kb_count=$(sfdisk -s $drive 2>/dev/null) + local disk_kb_count=$(sfdisk -s "$drive" 2>/dev/null) dd if=/dev/zero of=$drive bs=1024 seek=$(($disk_kb_count - 1)) count=1 } @@ -840,35 +840,35 @@ test_ntp_configuration () { get_dm_device () { - local device=$1 + local device="$1" local return_var=$2 - major=$(stat -c '%t' $(readlink -f $device)) - minor=$(stat -c '%T' $(readlink -f $device)) + major=$(stat -c '%t' $(readlink -f "$device")) + minor=$(stat -c '%T' $(readlink -f "$device")) local dm_device= local rc=1 for dm in /dev/mapper/*; do - if [ $major = $(stat -c '%t' $dm) -a \ - $minor = $(stat -c '%T' $dm) ]; then - local dm_device=$dm + if [ $major = $(stat -c '%t' "$dm") -a \ + $minor = $(stat -c '%T' "$dm") ]; then + local dm_device="$dm" rc=0 break fi done - eval $return_var=$dm_device + eval $return_var="$dm_device" return $rc } #Function to determine partition and device names get_part_info() { - local drive_in=$1 + local drive_in="$1" local dev_var=$2 local part_var=$3 local devname_1 devname2 part_number local rc=0 - eval $(readlink -f $drive_in|awk {' + eval $(readlink -f "$drive_in" |awk {' print "devname_1=" substr($1,1,length($1)-1); print "devname_2=" substr($1,1,length($1)-2); part_number=substr($1,length($1),1); -- 1.6.6.1 From dpierce at redhat.com Wed Mar 31 15:53:29 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 31 Mar 2010 11:53:29 -0400 Subject: [Ovirt-devel] Incomplete patch Message-ID: <1270050810-21699-1-git-send-email-dpierce@redhat.com> This patch is non-functional at this point; i.e., while it seems to meet the requirements for having libvirt using the specified TFTP root specified, libvirt seems to not be doing so. From dpierce at redhat.com Wed Mar 31 15:53:30 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 31 Mar 2010 11:53:30 -0400 Subject: [Ovirt-devel] [PATCH] Change autotest to let libvirt use the TFTP root created. In-Reply-To: <1270050810-21699-1-git-send-email-dpierce@redhat.com> References: <1270050810-21699-1-git-send-email-dpierce@redhat.com> Message-ID: <1270050810-21699-2-git-send-email-dpierce@redhat.com> Signed-off-by: Darryl L. Pierce --- autotest.sh | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/autotest.sh b/autotest.sh index 32a60d9..09c0535 100755 --- a/autotest.sh +++ b/autotest.sh @@ -190,23 +190,24 @@ start_networking () { done definition="\n${ifacename}\n\n" - definition="${definition}\n" + definition="${definition}\n\n\n" if $use_dhcp; then definition="${definition}\n\n\n" fi definition="${definition}\n\n" debug "Saving network definition file to: ${xmlfile}\n" + debug "net-xml:\n${definition}\n" sudo printf "${definition}" > $xmlfile sudo virsh net-define $xmlfile > /dev/null 2>&1 debug "Starting network." sudo virsh net-start $ifacename > /dev/null 2>&1 - if [ "${use_dhcp}" == "false" ]; then - if $start_dnsmasq; then - start_dnsmasq $ifacename $workdir "" $nodename - fi - fi +# if [ "${use_dhcp}" == "false" ]; then +# if $start_dnsmasq; then +# start_dnsmasq $ifacename $workdir "" $nodename +# fi +# fi } # Destroys the test network interface -- 1.6.6.1 From dpierce at redhat.com Wed Mar 31 18:09:06 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 31 Mar 2010 14:09:06 -0400 Subject: [Ovirt-devel] [PATCH node] Handle space in storage wwid In-Reply-To: <1270050497-7811-1-git-send-email-mburns@redhat.com> References: <1270050497-7811-1-git-send-email-mburns@redhat.com> Message-ID: <20100331180906.GO2948@mcpierce-desktop.usersys.redhat.com> On Wed, Mar 31, 2010 at 11:48:17AM -0400, Mike Burns wrote: Comments inline. > Quote everywhere that we reference wwid in o-c-storage, o-c-boot > and ovirt-functions. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-boot | 6 +- > scripts/ovirt-config-storage | 178 +++++++++++++++++++++--------------------- > scripts/ovirt-functions | 38 +++++----- > 3 files changed, 111 insertions(+), 111 deletions(-) > > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > index d545878..347fc18 100755 > --- a/scripts/ovirt-config-boot > +++ b/scripts/ovirt-config-boot > @@ -88,7 +88,7 @@ ovirt_boot_setup() { > rc=0 > else > candidate_dev=$(findfs LABEL=$candidate 2>/dev/null) > - e2label $candidate_dev RootNew > + e2label "$candidate_dev" RootNew > rc=$? > fi > if [ $rc -ne 0 ]; then > @@ -97,7 +97,7 @@ ovirt_boot_setup() { > return $rc > fi > > - mount $candidate_dev /liveos/ > + mount "$candidate_dev" /liveos/ > > rm -rf /liveos/LiveOS > mkdir -p /liveos/LiveOS > @@ -175,7 +175,7 @@ EOF > if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then > umount /liveos > # mark new Root ready to go, reboot() in ovirt-function switches it to active > - e2label $candidate_dev RootUpdate > + e2label "$candidate_dev" RootUpdate > fi > > rm -rf $tmpdir > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index 8d59a6b..9fee10e 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -36,12 +36,12 @@ swap_min_size=5 > > # return sd name for given #:# identifier > get_sd_name() { > - local id=$1 > - local device_var=$2 > + local id="$1" > + local device_var="$2" > local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1) > > if [ -n "$device_sys" ]; then > - eval $device_var=$(basename $(dirname $device_sys)) > + eval $device_var=$(basename $(dirname "$device_sys")) > return > fi > eval $device_var=1 > @@ -49,23 +49,23 @@ get_sd_name() { > > # gets the dependent block devices for multipath devices > get_multipath_devices() { > - local mpath_device=mpath-$(basename $1) > - local deplist_var=$2 > + local mpath_device=mpath-$(basename "$1") > + local deplist_var="$2" > local deplist="" > > #get dependencies for multipath device > - local deps=$(dmsetup deps -u $mpath_device \ > + local deps=$(dmsetup deps -u "$mpath_device" \ > | sed -r 's/\(([0-9]+), ([0-9]+)\)/\1:\2/g' \ > | sed 's/ /\n/g' | grep [0-9]:[0-9] ) > > local device="" > - for dep in $deps > + for dep in "$deps" > do > local device="" > - get_sd_name $dep device > - if [[ ! $device = 1 ]]; then > - if [[ $deplist = "" ]]; then > - deplist=$device > + get_sd_name "$dep" device > + if [[ ! "$device" = 1 ]]; then > + if [[ "$deplist" = "" ]]; then > + deplist="$device" > else > deplist="$deplist $device" > fi > @@ -79,8 +79,8 @@ get_multipath_devices() { > #return sdX device if no multipath device > translate_multipath_device() { > #trim so that only sdX is stored, but support passing /dev/sdX > - local dev=$1 > - local mpath_var=$2 > + local dev="$1" > + local mpath_var="$2" > > if [ -z "$dev" ]; then > if [ -n "$mpath_var" ]; then > @@ -89,36 +89,36 @@ translate_multipath_device() { > return > fi > if [[ "$dev" =~ "/dev/mapper" ]]; then > - eval $mpath_var=$dev > + eval $math_var="$dev" > return > fi > > - local dm_dev=/dev/$(multipath -ll $dev | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') > + local dm_dev=/dev/$(multipath -ll "$dev" | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') > > local mpath_device= > - get_dm_device $dm_dev mpath_device > + get_dm_device "$dm_dev" mpath_device > > if [ -z "$mpath_device" ]; then > - mpath_device=$dev > + mpath_device="$dev" > fi > > - eval $mpath_var=$mpath_device > + eval $mpath_var="$mpath_device" > } > > > get_drive_size() > { > - local drive=$1 > - local space_var=$2 > + local drive="$1" > + local space_var="$2" > > local size= > - local udi=$(hal-find-by-property --key block.device --string $drive) > + local udi=$(hal-find-by-property --key block.device --string "$drive") > # if more than one UDI was found then iterate over them to find the base device > if [[ "${udi}" =~ \$ ]]; then > - udi=$(echo $udi | sed 's/\$/ /g') > + udi=$(echo "$udi" | sed 's/\$/ /g') > for found in ${udi}; do > - if [[ "false" == $(hal-get-property --udi $found --key block.is_volume) ]]; then > - udi=$found > + if [[ "false" == $(hal-get-property --udi "$found" --key block.is_volume) ]]; then > + udi="$found" > break > fi > done > @@ -127,7 +127,7 @@ get_drive_size() > # If hal didn't find the device, it could be a virtio block device > # or a multipath device > # In this case, use sfdisk -s to get the size > - size=$(sfdisk -s $drive 2>/dev/null) > + size=$(sfdisk -s "$drive" 2>/dev/null) > if [ -z "$size" ]; then > size=0 > fi > @@ -147,7 +147,7 @@ get_drive_size() > echo "$drive ($size MB)" > test -z "$udi" || echo "Disk Identifier: $(basename "$udi")" > if [ -n "$space_var" ]; then > - eval $space_var=$size > + eval $space_var="$size" > fi > } > > @@ -155,7 +155,7 @@ check_partition_sizes() > { > local disk_size need_size > > - local min_data_size=$DATA_SIZE > + local min_data_size="$DATA_SIZE" > if [ "$DATA_SIZE" = -1 ]; then > min_data_size=5 > fi > @@ -164,7 +164,7 @@ check_partition_sizes() > if [ "$OVIRT_ISCSI_ENABLED" == "y" ]; then > get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE > drive_list="BOOT" > - BOOT_NEED_SIZE=$BOOT_SIZE > + BOOT_NEED_SIZE="$BOOT_SIZE" > else > get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE > get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE > @@ -172,7 +172,7 @@ check_partition_sizes() > HOSTVG_NEED_SIZE=$(echo "scale=0;" \ > "$SWAP_SIZE + $CONFIG_SIZE + $LOGGING_SIZE + $min_data_size" | bc -l) > > - if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then > + if [ "$ROOTDRIVE" == "$HOSTVGDRIVE" ]; then > drive_list="ROOT" > ROOT_NEED_SIZE=$(echo "scale=0; $ROOT_SIZE * 2 + $HOSTVG_NEED_SIZE"| bc -l) > else > @@ -204,7 +204,7 @@ check_partition_sizes() > # check if an existing HostVG exists on a device other than the target > if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then > devices="$(pvs -o pv_name,vg_name --noheadings | \ > - grep "HostVG"|grep -v $HOSTVGDRIVE|awk '{ print $1 }')" > + grep "HostVG"|grep -v "$HOSTVGDRIVE"|awk '{ print $1 }')" > rc=0 > if [ -n "$devices" ]; then > printf "\n" > @@ -230,7 +230,7 @@ check_partition_sizes() > manual_input() > { > local manual_device > - local return_var=$1 > + local return_var="$1" > while true; do > read -rp "Enter disk device path: " manual_device > if [ -z "$device" ]; then > @@ -239,7 +239,7 @@ manual_input() > fi > translate_multipath_device "$manual_device" manual_device > if [ -n "$manual_device" ]; then > - if [ -b "$(readlink -f $device)" ]; then > + if [ -b "$(readlink -f "$device")" ]; then To avoid parsing errors, I'd change the double quotes to single here: + if [ -b "$(readline -f '$device')" ]; then > eval $return_var="$manual_device" > return 0 > fi > @@ -273,7 +273,7 @@ get_dev_name() > test "X$drive_type" = Xdisk || continue > local block_dev=$(hal-get-property --udi "$d" --key block.device) > # Must start with a '/'. > - case $block_dev in > + case "$block_dev" in > *' '*) > # we use space as separator > warn "block device name '$block_dev' contains space; skipping"; > @@ -288,7 +288,7 @@ get_dev_name() > done > d="" > for d in $byid_list; do > - devices="$devices `readlink -f $d`"; > + devices="$devices $(readlink -f "$d")"; Same here regarding the using multiple double quotes in a line: + devices="$devices $(readlink -f '$d')"; > done > > # FIXME: workaround for detecting virtio block devices > @@ -296,7 +296,7 @@ get_dev_name() > > # FIXME: workaround for detecting cciss devices > for dev in $(ls /dev/cciss 2>/dev/null); do > - if [[ ! $dev =~ p[0-9]+\$ ]]; then > + if [[ ! "$dev" =~ p[0-9]+\$ ]]; then > devices="$devices /dev/cciss/dev" > fi > done > @@ -306,7 +306,7 @@ get_dev_name() > for dev in $(dmsetup ls --target=multipath | awk '{print $1}'); do > devices="$devices /dev/mapper/$dev" > local sd_devs="" > - get_multipath_devices $dev sd_devs > + get_multipath_devices "$dev" sd_devs > devs_to_remove="${devs_to_remove} ${sd_devs}" > done > > @@ -352,7 +352,7 @@ do_configure() > printf "\n\nPlease select the disk to use for the Boot partition.\n\n" > BOOTDRIVE=$(get_dev_name) || return 0 > get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE > - echo $BOOTDRIVE > + echo "$BOOTDRIVE" > else > printf "\n\nPlease select the disk to use for the Root.\n\n" > ROOTDRIVE=$(get_dev_name) || return 0 > @@ -361,13 +361,13 @@ do_configure() > printf "\n\nPlease select the disk to use for the HostVG.\n\n" > HOSTVGDRIVE=$(get_dev_name) || return 0 > local skipped=false > - if check_existing_hostvg $HOSTVGDRIVE devs; then > + if check_existing_hostvg "$HOSTVGDRIVE" devs; then > for dev in $devs > do > printf "Removing HostVG on $dev will erase the drive and cannot be undone\n" > if ask_yes_or_no "Do you want to remove HostVG from $dev (y/n)?"; then > start_log > - if ! wipe_lvm_on_disk $dev; then > + if ! wipe_lvm_on_disk "$dev"; then > stop_log > return 1 > fi > @@ -379,7 +379,7 @@ do_configure() > fi > $skipped && printf "Installation cannot proceed with existing HostVG.\n" && return 0 > get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE > - echo $HOSTVGDRIVESPACE > + echo "$HOSTVGDRIVESPACE" > fi > printf "\n\nPlease configure storage partitions.\n\n" > printf "* Enter partition sizes in MB.\n" > @@ -459,7 +459,7 @@ set /files$OVIRT_DEFAULTS/OVIRT_VOL_LOGGING_SIZE $LOGGING_SIZE > set /files$OVIRT_DEFAULTS/OVIRT_VOL_DATA_SIZE $DATA_SIZE > EOF > > - if [ -n $BOOTDRIVE ]; then > + if [ -n "$BOOTDRIVE" ]; then > augtool < set /files$OVIRT_DEFAULTS/OVIRT_BOOT_INIT $BOOTDRIVE > EOF > @@ -478,7 +478,7 @@ do_review() > local data_size_display="$DATA_SIZE MB" > if [ "$DATA_SIZE" = -1 ]; then > > - if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then > + if [ "$ROOTDRIVE" == "$HOSTVGDRIVE" ]; then > local remaining_mb=$(( $ROOTDRIVESPACE - $SWAP_SIZE \ > - $ROOT_SIZE * 2 - $CONFIG_SIZE - $LOGGING_SIZE )) > test $remaining_mb -lt 0 && is_negative=1 > @@ -529,7 +529,7 @@ check_existing_hostvg() > grep "HostVG" | awk '{print $1}' )" > else > devices="$(pvs -o pv_name,vg_name --noheadings | \ > - grep -v ${install_dev} | grep "HostVG" | awk '{print $1}' )" > + grep -v "${install_dev}" | grep "HostVG" | awk '{print $1}' )" > fi > rc=1 > if [ -n "$devices" ]; then > @@ -537,7 +537,7 @@ check_existing_hostvg() > printf "There appears to already be an installation on another device:\n" > for device in $devices; do > get_multipath_devices ${device%p[0-9]} sd_dev > - sd_dev=$(echo $sd_dev | awk '{print $1}') > + sd_dev=$(echo "$sd_dev" | awk '{print $1}') > udi=$(hal-find-by-property --key block.device --string /dev/${sd_dev}) > printf "\t$device ($(basename "$udi"))\n" > done > @@ -546,7 +546,7 @@ check_existing_hostvg() > rc=0 > fi > > - test -z $devices_var || eval $devices_var=$devices > + test -z "$devices_var" || eval "$devices_var"="$devices" > > return $rc > > @@ -563,9 +563,9 @@ wipe_lvm_on_disk() > if [[ "$dev" =~ "/dev/sd" ]]; then > part_delim="" > fi > - for vg in $(pvs -o vg_name --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do > + for vg in $(pvs -o vg_name --noheadings "$dev" "$dev${dev_delim}[0-9]"* 2>/dev/null|sort -u); do > if pvs -o pv_name,vg_name --noheadings | \ > - grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then > + grep "$vg" | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then > log "The volume group \"$vg\" spans multiple disks." > log "This operation cannot complete. Please manually" > log "cleanup the storage using standard linux tools." > @@ -583,7 +583,7 @@ reread_partitions() > if [[ $drive =~ "/dev/mapper" ]]; then > kpartx -a -p p $drive > else > - blockdev --rereadpt $drive > + blockdev --rereadpt "$drive" > fi > } > > @@ -617,19 +617,19 @@ perform_partitioning() > log "Partitioning drive: $BOOTDRIVE" > log "Wiping old boot sector" > dd if=/dev/zero of=$BOOTDRIVE bs=1024K count=1 > - reread_partitions $BOOTDRIVE > - partprobe -s $BOOTDRIVE > + reread_partitions "$BOOTDRIVE" > + partprobe -s "$BOOTDRIVE" > log "Creating boot partition" > - parted $BOOTDRIVE -s "mklabel ${LABEL_TYPE}" > - parted $BOOTDRIVE -s "mkpartfs primary ext2 0M ${boot_size_si}M" > - reread_partitions $BOOTDRIVE > - partboot=$BOOTDRIVE1 > - if [ ! -e $partboot ]; then > - partboot=${BOOTDRIVE}p1 > + parted "$BOOTDRIVE" -s "mklabel ${LABEL_TYPE}" > + parted "$BOOTDRIVE" -s "mkpartfs primary ext2 0M ${boot_size_si}M" > + reread_partitions "$BOOTDRIVE" > + partboot="$BOOTDRIVE1" > + if [ ! -e "$partboot" ]; then > + partboot="${BOOTDRIVE}p1" > fi > # sleep to ensure filesystems are created before continuing > sleep 10 > - mke2fs ${partboot} -L Boot > + mke2fs "${partboot}" -L Boot > tune2fs -c 0 -i 0 ${partboot} > log "Completed!" > return > @@ -639,58 +639,58 @@ perform_partitioning() > log "Partitioning drive: $ROOTDRIVE" > # FIXME: save a backup copy, just in case? > log "Wiping old boot sector" > - dd if=/dev/zero of=$ROOTDRIVE bs=1024K count=1 > - reread_partitions $ROOTDRIVE > - partprobe -s $ROOTDRIVE > + dd if=/dev/zero of="$ROOTDRIVE" bs=1024K count=1 > + reread_partitions "$ROOTDRIVE" > + partprobe -s "$ROOTDRIVE" > log "Labeling Drive: $ROOTDRIVE" > - parted $ROOTDRIVE -s "mklabel ${LABEL_TYPE}" > + parted "$ROOTDRIVE" -s "mklabel ${LABEL_TYPE}" > > - if [ $ROOTDRIVE != $HOSTVGDRIVE ]; then > + if [ "$ROOTDRIVE" != "$HOSTVGDRIVE" ]; then > log "Labeling Drive: $HOSTVGDRIVE" > - parted $HOSTVGDRIVE -s "mklabel ${LABEL_TYPE}" > + parted "$HOSTVGDRIVE" -s "mklabel ${LABEL_TYPE}" > fi > log "Creating Root and RootBackup Partitions" > let RootBackup_end=${ROOT_SIZE}*2 > parted $ROOTDRIVE -s "mkpart primary ext2 0M ${ROOT_SIZE}M" > parted $ROOTDRIVE -s "mkpart primary ext2 ${ROOT_SIZE}M ${RootBackup_end}M" > reread_partitions $ROOTDRIVE > - partroot=${ROOTDRIVE}1 > - partrootbackup=${ROOTDRIVE}2 > - if [ ! -e $partroot ]; then > - partroot=${ROOTDRIVE}p1 > - partrootbackup=${ROOTDRIVE}p2 > + partroot="${ROOTDRIVE}1" > + partrootbackup="${ROOTDRIVE}2" > + if [ ! -e "$partroot" ]; then > + partroot="${ROOTDRIVE}p1" > + partrootbackup="${ROOTDRIVE}p2" > fi > # sleep to ensure filesystems are created before continuing > sleep 10 > - mke2fs ${partroot} -L Root > - mke2fs ${partrootbackup} -L RootBackup > - tune2fs -c 0 -i 0 ${partroot} > - tune2fs -c 0 -i 0 ${partrootbackup} > + mke2fs "${partroot}" -L Root > + mke2fs "${partrootbackup}" -L RootBackup > + tune2fs -c 0 -i 0 "${partroot}" > + tune2fs -c 0 -i 0 "${partrootbackup}" > log "Creating LVM partition" > > - if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then > + if [ "$ROOTDRIVE" == "$HOSTVGDRIVE" ]; then > parted $HOSTVGDRIVE -s "mkpart primary ext2 ${RootBackup_end}M -1" > hostvgpart="3" > else > - parted $HOSTVGDRIVE -s "mkpart primary ext2 0M -1" > + parted "$HOSTVGDRIVE" -s "mkpart primary ext2 0M -1" > hostvgpart="1" > fi > log "Toggling LVM on" > - parted $HOSTVGDRIVE -s "set $hostvgpart lvm on" > - parted $ROOTDRIVE -s "print" > + parted "$HOSTVGDRIVE" -s "set $hostvgpart lvm on" > + parted "$ROOTDRIVE" -s "print" > udevadm settle 2> /dev/null || udevsettle > - reread_partitions $HOSTVGDRIVE > + reread_partitions "$HOSTVGDRIVE" > > # sync GPT to the legacy MBR partitions > if [ "gpt" == "$LABEL_TYPE" ]; then > log "Running gptsync to create legacy mbr" > - gptsync $ROOTDRIVE > + gptsync "$ROOTDRIVE" > fi > > - partpv=${HOSTVGDRIVE}${hostvgpart} > + partpv="${HOSTVGDRIVE}${hostvgpart}" > if [ ! -e "$partpv" ]; then > # e.g. /dev/cciss/c0d0p2 > - partpv=${HOSTVGDRIVE}p${hostvgpart} > + partpv="${HOSTVGDRIVE}p${hostvgpart}" > fi > log "Creating physical volume" > if [ ! -e "$partpv" ]; then > @@ -806,18 +806,18 @@ while true; do > for OPTION in "$@"; do > while true; do > read -ep "Enter $OPTION: " > - if [[ $REPLY == "q" || $REPLY == "Q" ]]; then > + if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then > return > fi > > if [ "$OPTION" == "Target IP" ]; then > - OVIRT_ISCSI_TARGET_IP=$REPLY > + OVIRT_ISCSI_TARGET_IP="$REPLY" > if [ -n "$REPLY" ]; then > break; > fi > > elif [ "$OPTION" == "Target Port" ]; then > - OVIRT_ISCSI_TARGET_PORT=$REPLY > + OVIRT_ISCSI_TARGET_PORT="$REPLY" > if [ -z "$REPLY" ]; then > OVIRT_ISCSI_TARGET_PORT="3260" > break; > @@ -826,11 +826,11 @@ while true; do > fi > > elif [ "$OPTION" == "CHAP Username" ]; then > - OVIRT_ISCSI_CHAP_USERNAME=$REPLY > + OVIRT_ISCSI_CHAP_USERNAME="$REPLY" > break > > elif [ "$OPTION" == "CHAP Password" ]; then > - OVIRT_ISCSI_CHAP_PASSWORD=$REPLY > + OVIRT_ISCSI_CHAP_PASSWORD="$REPLY" > break; > fi > done > @@ -868,7 +868,7 @@ set /files/etc/default/ovirt/OVIRT_ISCSI_CHAP_PASSWORD $OVIRT_ISCSI_CHAP_PASSWOR > EOF > fi > > - iscsiadm -p $OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT -m discovery -t sendtargets > + iscsiadm -p "$OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT" -m discovery -t sendtargets > log "Restarting iscsi service" > service iscsi restart > > @@ -927,8 +927,8 @@ if [ -n "$OVIRT_INIT" ]; then > # if present, use the drive selected with 'ovirt_init' boot parameter > # setting these the same until kernel cmdline argument implemented > translate_multipath_device "$OVIRT_INIT" DRIVE > - ROOTDRIVE=$DRIVE > - HOSTVGDRIVE=$DRIVE > + ROOTDRIVE="$DRIVE" > + HOSTVGDRIVE="$DRIVE" > get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE > fi > > @@ -943,7 +943,7 @@ if [ "$1" == "AUTO" ]; then > log "Beginning automatic disk partitioning.\n" > if [ -n "$OVIRT_INIT" ]; then > # do not format if HostVG exists on selected disk... > - check_existing_hostvg $HOSTVGDRIVE > + check_existing_hostvg "$HOSTVGDRIVE" > existingHostVG=$? > # ... unless overridden by ovirt_firstboot parameter > if is_firstboot || [ $existingHostVG -ne 0 ]; then > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index d8aa008..edf6267 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -148,7 +148,7 @@ EOF > # > wipe_volume_group() > { > - vg=$1 > + vg="$1" > > for d in $(grep $vg /proc/mounts|awk '{print $2}'); do > log "Unmounting $d" > @@ -156,10 +156,10 @@ wipe_volume_group() > done > for d in $(grep $vg /proc/swaps|awk '{print $1}'); do > log "Turning off $d" > - swapoff $d > + swapoff "$d" > done > log "Removing $vg" > - vgremove -f $vg > + vgremove -f "$vg" > } > > # find_srv SERVICE PROTO > @@ -719,10 +719,10 @@ reboot() { > if [ "$OVIRT_ISCSI_ENABLED" = "yes" ]; then > # setup new Root if update is prepared > if findfs LABEL=RootUpdate 2>&1 >/dev/null; then > - root_update_dev=$(findfs LABEL=RootUpdate 2>/dev/null) > - root_dev=$(findfs LABEL=Root 2>/dev/null) > - e2label $root_dev RootBackup > - e2label $root_update_dev Root > + root_update_dev="$(findfs LABEL=RootUpdate 2>/dev/null)" > + root_dev="$(findfs LABEL=Root 2>/dev/null)" > + e2label "$root_dev" RootBackup > + e2label "$root_update_dev" Root > fi > fi > # run post-install hooks > @@ -812,12 +812,12 @@ network_up () { > > # Cleans partition tables > wipe_partitions() { > - local drive=$1 > + local drive="$1" > log "Wiping old boot sector" > - dd if=/dev/zero of=$drive bs=1024K count=1 > + dd if=/dev/zero of="$drive" bs=1024K count=1 > # zero out the GPT secondary header > log "Wiping secondary gpt header" > - local disk_kb_count=$(sfdisk -s $drive 2>/dev/null) > + local disk_kb_count=$(sfdisk -s "$drive" 2>/dev/null) > dd if=/dev/zero of=$drive bs=1024 seek=$(($disk_kb_count - 1)) count=1 > } > > @@ -840,35 +840,35 @@ test_ntp_configuration () { > > get_dm_device () > { > - local device=$1 > + local device="$1" > local return_var=$2 > - major=$(stat -c '%t' $(readlink -f $device)) > - minor=$(stat -c '%T' $(readlink -f $device)) > + major=$(stat -c '%t' $(readlink -f "$device")) > + minor=$(stat -c '%T' $(readlink -f "$device")) > local dm_device= > local rc=1 > for dm in /dev/mapper/*; do > - if [ $major = $(stat -c '%t' $dm) -a \ > - $minor = $(stat -c '%T' $dm) ]; then > - local dm_device=$dm > + if [ $major = $(stat -c '%t' "$dm") -a \ > + $minor = $(stat -c '%T' "$dm") ]; then > + local dm_device="$dm" > rc=0 > break > fi > done > > - eval $return_var=$dm_device > + eval $return_var="$dm_device" > > return $rc > } > > #Function to determine partition and device names > get_part_info() { > - local drive_in=$1 > + local drive_in="$1" > local dev_var=$2 > local part_var=$3 > local devname_1 devname2 part_number > local rc=0 > > - eval $(readlink -f $drive_in|awk {' > + eval $(readlink -f "$drive_in" |awk {' > print "devname_1=" substr($1,1,length($1)-1); > print "devname_2=" substr($1,1,length($1)-2); > part_number=substr($1,length($1),1); > -- > 1.6.6.1 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel With those couple of nitpicks, ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Mar 31 18:36:39 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 31 Mar 2010 14:36:39 -0400 Subject: [Ovirt-devel] [PATCH node] Handle space in storage wwid In-Reply-To: <20100331180906.GO2948@mcpierce-desktop.usersys.redhat.com> References: <1270050497-7811-1-git-send-email-mburns@redhat.com> <20100331180906.GO2948@mcpierce-desktop.usersys.redhat.com> Message-ID: <1270060599.2287.6.camel@mburns-laptop.bos.redhat.com> On Wed, 2010-03-31 at 14:09 -0400, Darryl L. Pierce wrote: > On Wed, Mar 31, 2010 at 11:48:17AM -0400, Mike Burns wrote: > > Comments inline. > > > Quote everywhere that we reference wwid in o-c-storage, o-c-boot > > and ovirt-functions. > > > > Signed-off-by: Mike Burns > > --- > > scripts/ovirt-config-boot | 6 +- > > scripts/ovirt-config-storage | 178 +++++++++++++++++++++--------------------- > > scripts/ovirt-functions | 38 +++++----- > > 3 files changed, 111 insertions(+), 111 deletions(-) > > > > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > > index d545878..347fc18 100755 > > --- a/scripts/ovirt-config-boot > > +++ b/scripts/ovirt-config-boot > > @@ -88,7 +88,7 @@ ovirt_boot_setup() { > > rc=0 > > else > > candidate_dev=$(findfs LABEL=$candidate 2>/dev/null) > > - e2label $candidate_dev RootNew > > + e2label "$candidate_dev" RootNew > > rc=$? > > fi > > if [ $rc -ne 0 ]; then > > @@ -97,7 +97,7 @@ ovirt_boot_setup() { > > return $rc > > fi > > > > - mount $candidate_dev /liveos/ > > + mount "$candidate_dev" /liveos/ > > > > rm -rf /liveos/LiveOS > > mkdir -p /liveos/LiveOS > > @@ -175,7 +175,7 @@ EOF > > if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then > > umount /liveos > > # mark new Root ready to go, reboot() in ovirt-function switches it to active > > - e2label $candidate_dev RootUpdate > > + e2label "$candidate_dev" RootUpdate > > fi > > > > rm -rf $tmpdir > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > > index 8d59a6b..9fee10e 100755 > > --- a/scripts/ovirt-config-storage > > +++ b/scripts/ovirt-config-storage > > @@ -36,12 +36,12 @@ swap_min_size=5 > > > > # return sd name for given #:# identifier > > get_sd_name() { > > - local id=$1 > > - local device_var=$2 > > + local id="$1" > > + local device_var="$2" > > local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1) > > > > if [ -n "$device_sys" ]; then > > - eval $device_var=$(basename $(dirname $device_sys)) > > + eval $device_var=$(basename $(dirname "$device_sys")) > > return > > fi > > eval $device_var=1 > > @@ -49,23 +49,23 @@ get_sd_name() { > > > > # gets the dependent block devices for multipath devices > > get_multipath_devices() { > > - local mpath_device=mpath-$(basename $1) > > - local deplist_var=$2 > > + local mpath_device=mpath-$(basename "$1") > > + local deplist_var="$2" > > local deplist="" > > > > #get dependencies for multipath device > > - local deps=$(dmsetup deps -u $mpath_device \ > > + local deps=$(dmsetup deps -u "$mpath_device" \ > > | sed -r 's/\(([0-9]+), ([0-9]+)\)/\1:\2/g' \ > > | sed 's/ /\n/g' | grep [0-9]:[0-9] ) > > > > local device="" > > - for dep in $deps > > + for dep in "$deps" > > do > > local device="" > > - get_sd_name $dep device > > - if [[ ! $device = 1 ]]; then > > - if [[ $deplist = "" ]]; then > > - deplist=$device > > + get_sd_name "$dep" device > > + if [[ ! "$device" = 1 ]]; then > > + if [[ "$deplist" = "" ]]; then > > + deplist="$device" > > else > > deplist="$deplist $device" > > fi > > @@ -79,8 +79,8 @@ get_multipath_devices() { > > #return sdX device if no multipath device > > translate_multipath_device() { > > #trim so that only sdX is stored, but support passing /dev/sdX > > - local dev=$1 > > - local mpath_var=$2 > > + local dev="$1" > > + local mpath_var="$2" > > > > if [ -z "$dev" ]; then > > if [ -n "$mpath_var" ]; then > > @@ -89,36 +89,36 @@ translate_multipath_device() { > > return > > fi > > if [[ "$dev" =~ "/dev/mapper" ]]; then > > - eval $mpath_var=$dev > > + eval $math_var="$dev" > > return > > fi > > > > - local dm_dev=/dev/$(multipath -ll $dev | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') > > + local dm_dev=/dev/$(multipath -ll "$dev" | egrep dm-[0-9]+ | sed -r 's/^.& (dm-[0-9]+) .*$/\1/') > > > > local mpath_device= > > - get_dm_device $dm_dev mpath_device > > + get_dm_device "$dm_dev" mpath_device > > > > if [ -z "$mpath_device" ]; then > > - mpath_device=$dev > > + mpath_device="$dev" > > fi > > > > - eval $mpath_var=$mpath_device > > + eval $mpath_var="$mpath_device" > > } > > > > > > get_drive_size() > > { > > - local drive=$1 > > - local space_var=$2 > > + local drive="$1" > > + local space_var="$2" > > > > local size= > > - local udi=$(hal-find-by-property --key block.device --string $drive) > > + local udi=$(hal-find-by-property --key block.device --string "$drive") > > # if more than one UDI was found then iterate over them to find the base device > > if [[ "${udi}" =~ \$ ]]; then > > - udi=$(echo $udi | sed 's/\$/ /g') > > + udi=$(echo "$udi" | sed 's/\$/ /g') > > for found in ${udi}; do > > - if [[ "false" == $(hal-get-property --udi $found --key block.is_volume) ]]; then > > - udi=$found > > + if [[ "false" == $(hal-get-property --udi "$found" --key block.is_volume) ]]; then > > + udi="$found" > > break > > fi > > done > > @@ -127,7 +127,7 @@ get_drive_size() > > # If hal didn't find the device, it could be a virtio block device > > # or a multipath device > > # In this case, use sfdisk -s to get the size > > - size=$(sfdisk -s $drive 2>/dev/null) > > + size=$(sfdisk -s "$drive" 2>/dev/null) > > if [ -z "$size" ]; then > > size=0 > > fi > > @@ -147,7 +147,7 @@ get_drive_size() > > echo "$drive ($size MB)" > > test -z "$udi" || echo "Disk Identifier: $(basename "$udi")" > > if [ -n "$space_var" ]; then > > - eval $space_var=$size > > + eval $space_var="$size" > > fi > > } > > > > @@ -155,7 +155,7 @@ check_partition_sizes() > > { > > local disk_size need_size > > > > - local min_data_size=$DATA_SIZE > > + local min_data_size="$DATA_SIZE" > > if [ "$DATA_SIZE" = -1 ]; then > > min_data_size=5 > > fi > > @@ -164,7 +164,7 @@ check_partition_sizes() > > if [ "$OVIRT_ISCSI_ENABLED" == "y" ]; then > > get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE > > drive_list="BOOT" > > - BOOT_NEED_SIZE=$BOOT_SIZE > > + BOOT_NEED_SIZE="$BOOT_SIZE" > > else > > get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE > > get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE > > @@ -172,7 +172,7 @@ check_partition_sizes() > > HOSTVG_NEED_SIZE=$(echo "scale=0;" \ > > "$SWAP_SIZE + $CONFIG_SIZE + $LOGGING_SIZE + $min_data_size" | bc -l) > > > > - if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then > > + if [ "$ROOTDRIVE" == "$HOSTVGDRIVE" ]; then > > drive_list="ROOT" > > ROOT_NEED_SIZE=$(echo "scale=0; $ROOT_SIZE * 2 + $HOSTVG_NEED_SIZE"| bc -l) > > else > > @@ -204,7 +204,7 @@ check_partition_sizes() > > # check if an existing HostVG exists on a device other than the target > > if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then > > devices="$(pvs -o pv_name,vg_name --noheadings | \ > > - grep "HostVG"|grep -v $HOSTVGDRIVE|awk '{ print $1 }')" > > + grep "HostVG"|grep -v "$HOSTVGDRIVE"|awk '{ print $1 }')" > > rc=0 > > if [ -n "$devices" ]; then > > printf "\n" > > @@ -230,7 +230,7 @@ check_partition_sizes() > > manual_input() > > { > > local manual_device > > - local return_var=$1 > > + local return_var="$1" > > while true; do > > read -rp "Enter disk device path: " manual_device > > if [ -z "$device" ]; then > > @@ -239,7 +239,7 @@ manual_input() > > fi > > translate_multipath_device "$manual_device" manual_device > > if [ -n "$manual_device" ]; then > > - if [ -b "$(readlink -f $device)" ]; then > > + if [ -b "$(readlink -f "$device")" ]; then > > To avoid parsing errors, I'd change the double quotes to single here: > + if [ -b "$(readline -f '$device')" ]; then > > > eval $return_var="$manual_device" > > return 0 > > fi > > @@ -273,7 +273,7 @@ get_dev_name() > > test "X$drive_type" = Xdisk || continue > > local block_dev=$(hal-get-property --udi "$d" --key block.device) > > # Must start with a '/'. > > - case $block_dev in > > + case "$block_dev" in > > *' '*) > > # we use space as separator > > warn "block device name '$block_dev' contains space; skipping"; > > @@ -288,7 +288,7 @@ get_dev_name() > > done > > d="" > > for d in $byid_list; do > > - devices="$devices `readlink -f $d`"; > > + devices="$devices $(readlink -f "$d")"; > > Same here regarding the using multiple double quotes in a line: > + devices="$devices $(readlink -f '$d')"; > > > done > > > > # FIXME: workaround for detecting virtio block devices > > @@ -296,7 +296,7 @@ get_dev_name() > > > > # FIXME: workaround for detecting cciss devices > > for dev in $(ls /dev/cciss 2>/dev/null); do > > - if [[ ! $dev =~ p[0-9]+\$ ]]; then > > + if [[ ! "$dev" =~ p[0-9]+\$ ]]; then > > devices="$devices /dev/cciss/dev" > > fi > > done > > @@ -306,7 +306,7 @@ get_dev_name() > > for dev in $(dmsetup ls --target=multipath | awk '{print $1}'); do > > devices="$devices /dev/mapper/$dev" > > local sd_devs="" > > - get_multipath_devices $dev sd_devs > > + get_multipath_devices "$dev" sd_devs > > devs_to_remove="${devs_to_remove} ${sd_devs}" > > done > > > > @@ -352,7 +352,7 @@ do_configure() > > printf "\n\nPlease select the disk to use for the Boot partition.\n\n" > > BOOTDRIVE=$(get_dev_name) || return 0 > > get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE > > - echo $BOOTDRIVE > > + echo "$BOOTDRIVE" > > else > > printf "\n\nPlease select the disk to use for the Root.\n\n" > > ROOTDRIVE=$(get_dev_name) || return 0 > > @@ -361,13 +361,13 @@ do_configure() > > printf "\n\nPlease select the disk to use for the HostVG.\n\n" > > HOSTVGDRIVE=$(get_dev_name) || return 0 > > local skipped=false > > - if check_existing_hostvg $HOSTVGDRIVE devs; then > > + if check_existing_hostvg "$HOSTVGDRIVE" devs; then > > for dev in $devs > > do > > printf "Removing HostVG on $dev will erase the drive and cannot be undone\n" > > if ask_yes_or_no "Do you want to remove HostVG from $dev (y/n)?"; then > > start_log > > - if ! wipe_lvm_on_disk $dev; then > > + if ! wipe_lvm_on_disk "$dev"; then > > stop_log > > return 1 > > fi > > @@ -379,7 +379,7 @@ do_configure() > > fi > > $skipped && printf "Installation cannot proceed with existing HostVG.\n" && return 0 > > get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE > > - echo $HOSTVGDRIVESPACE > > + echo "$HOSTVGDRIVESPACE" > > fi > > printf "\n\nPlease configure storage partitions.\n\n" > > printf "* Enter partition sizes in MB.\n" > > @@ -459,7 +459,7 @@ set /files$OVIRT_DEFAULTS/OVIRT_VOL_LOGGING_SIZE $LOGGING_SIZE > > set /files$OVIRT_DEFAULTS/OVIRT_VOL_DATA_SIZE $DATA_SIZE > > EOF > > > > - if [ -n $BOOTDRIVE ]; then > > + if [ -n "$BOOTDRIVE" ]; then > > augtool < > set /files$OVIRT_DEFAULTS/OVIRT_BOOT_INIT $BOOTDRIVE > > EOF > > @@ -478,7 +478,7 @@ do_review() > > local data_size_display="$DATA_SIZE MB" > > if [ "$DATA_SIZE" = -1 ]; then > > > > - if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then > > + if [ "$ROOTDRIVE" == "$HOSTVGDRIVE" ]; then > > local remaining_mb=$(( $ROOTDRIVESPACE - $SWAP_SIZE \ > > - $ROOT_SIZE * 2 - $CONFIG_SIZE - $LOGGING_SIZE )) > > test $remaining_mb -lt 0 && is_negative=1 > > @@ -529,7 +529,7 @@ check_existing_hostvg() > > grep "HostVG" | awk '{print $1}' )" > > else > > devices="$(pvs -o pv_name,vg_name --noheadings | \ > > - grep -v ${install_dev} | grep "HostVG" | awk '{print $1}' )" > > + grep -v "${install_dev}" | grep "HostVG" | awk '{print $1}' )" > > fi > > rc=1 > > if [ -n "$devices" ]; then > > @@ -537,7 +537,7 @@ check_existing_hostvg() > > printf "There appears to already be an installation on another device:\n" > > for device in $devices; do > > get_multipath_devices ${device%p[0-9]} sd_dev > > - sd_dev=$(echo $sd_dev | awk '{print $1}') > > + sd_dev=$(echo "$sd_dev" | awk '{print $1}') > > udi=$(hal-find-by-property --key block.device --string /dev/${sd_dev}) > > printf "\t$device ($(basename "$udi"))\n" > > done > > @@ -546,7 +546,7 @@ check_existing_hostvg() > > rc=0 > > fi > > > > - test -z $devices_var || eval $devices_var=$devices > > + test -z "$devices_var" || eval "$devices_var"="$devices" > > > > return $rc > > > > @@ -563,9 +563,9 @@ wipe_lvm_on_disk() > > if [[ "$dev" =~ "/dev/sd" ]]; then > > part_delim="" > > fi > > - for vg in $(pvs -o vg_name --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do > > + for vg in $(pvs -o vg_name --noheadings "$dev" "$dev${dev_delim}[0-9]"* 2>/dev/null|sort -u); do > > if pvs -o pv_name,vg_name --noheadings | \ > > - grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then > > + grep "$vg" | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then > > log "The volume group \"$vg\" spans multiple disks." > > log "This operation cannot complete. Please manually" > > log "cleanup the storage using standard linux tools." > > @@ -583,7 +583,7 @@ reread_partitions() > > if [[ $drive =~ "/dev/mapper" ]]; then > > kpartx -a -p p $drive > > else > > - blockdev --rereadpt $drive > > + blockdev --rereadpt "$drive" > > fi > > } > > > > @@ -617,19 +617,19 @@ perform_partitioning() > > log "Partitioning drive: $BOOTDRIVE" > > log "Wiping old boot sector" > > dd if=/dev/zero of=$BOOTDRIVE bs=1024K count=1 > > - reread_partitions $BOOTDRIVE > > - partprobe -s $BOOTDRIVE > > + reread_partitions "$BOOTDRIVE" > > + partprobe -s "$BOOTDRIVE" > > log "Creating boot partition" > > - parted $BOOTDRIVE -s "mklabel ${LABEL_TYPE}" > > - parted $BOOTDRIVE -s "mkpartfs primary ext2 0M ${boot_size_si}M" > > - reread_partitions $BOOTDRIVE > > - partboot=$BOOTDRIVE1 > > - if [ ! -e $partboot ]; then > > - partboot=${BOOTDRIVE}p1 > > + parted "$BOOTDRIVE" -s "mklabel ${LABEL_TYPE}" > > + parted "$BOOTDRIVE" -s "mkpartfs primary ext2 0M ${boot_size_si}M" > > + reread_partitions "$BOOTDRIVE" > > + partboot="$BOOTDRIVE1" > > + if [ ! -e "$partboot" ]; then > > + partboot="${BOOTDRIVE}p1" > > fi > > # sleep to ensure filesystems are created before continuing > > sleep 10 > > - mke2fs ${partboot} -L Boot > > + mke2fs "${partboot}" -L Boot > > tune2fs -c 0 -i 0 ${partboot} > > log "Completed!" > > return > > @@ -639,58 +639,58 @@ perform_partitioning() > > log "Partitioning drive: $ROOTDRIVE" > > # FIXME: save a backup copy, just in case? > > log "Wiping old boot sector" > > - dd if=/dev/zero of=$ROOTDRIVE bs=1024K count=1 > > - reread_partitions $ROOTDRIVE > > - partprobe -s $ROOTDRIVE > > + dd if=/dev/zero of="$ROOTDRIVE" bs=1024K count=1 > > + reread_partitions "$ROOTDRIVE" > > + partprobe -s "$ROOTDRIVE" > > log "Labeling Drive: $ROOTDRIVE" > > - parted $ROOTDRIVE -s "mklabel ${LABEL_TYPE}" > > + parted "$ROOTDRIVE" -s "mklabel ${LABEL_TYPE}" > > > > - if [ $ROOTDRIVE != $HOSTVGDRIVE ]; then > > + if [ "$ROOTDRIVE" != "$HOSTVGDRIVE" ]; then > > log "Labeling Drive: $HOSTVGDRIVE" > > - parted $HOSTVGDRIVE -s "mklabel ${LABEL_TYPE}" > > + parted "$HOSTVGDRIVE" -s "mklabel ${LABEL_TYPE}" > > fi > > log "Creating Root and RootBackup Partitions" > > let RootBackup_end=${ROOT_SIZE}*2 > > parted $ROOTDRIVE -s "mkpart primary ext2 0M ${ROOT_SIZE}M" > > parted $ROOTDRIVE -s "mkpart primary ext2 ${ROOT_SIZE}M ${RootBackup_end}M" > > reread_partitions $ROOTDRIVE > > - partroot=${ROOTDRIVE}1 > > - partrootbackup=${ROOTDRIVE}2 > > - if [ ! -e $partroot ]; then > > - partroot=${ROOTDRIVE}p1 > > - partrootbackup=${ROOTDRIVE}p2 > > + partroot="${ROOTDRIVE}1" > > + partrootbackup="${ROOTDRIVE}2" > > + if [ ! -e "$partroot" ]; then > > + partroot="${ROOTDRIVE}p1" > > + partrootbackup="${ROOTDRIVE}p2" > > fi > > # sleep to ensure filesystems are created before continuing > > sleep 10 > > - mke2fs ${partroot} -L Root > > - mke2fs ${partrootbackup} -L RootBackup > > - tune2fs -c 0 -i 0 ${partroot} > > - tune2fs -c 0 -i 0 ${partrootbackup} > > + mke2fs "${partroot}" -L Root > > + mke2fs "${partrootbackup}" -L RootBackup > > + tune2fs -c 0 -i 0 "${partroot}" > > + tune2fs -c 0 -i 0 "${partrootbackup}" > > log "Creating LVM partition" > > > > - if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then > > + if [ "$ROOTDRIVE" == "$HOSTVGDRIVE" ]; then > > parted $HOSTVGDRIVE -s "mkpart primary ext2 ${RootBackup_end}M -1" > > hostvgpart="3" > > else > > - parted $HOSTVGDRIVE -s "mkpart primary ext2 0M -1" > > + parted "$HOSTVGDRIVE" -s "mkpart primary ext2 0M -1" > > hostvgpart="1" > > fi > > log "Toggling LVM on" > > - parted $HOSTVGDRIVE -s "set $hostvgpart lvm on" > > - parted $ROOTDRIVE -s "print" > > + parted "$HOSTVGDRIVE" -s "set $hostvgpart lvm on" > > + parted "$ROOTDRIVE" -s "print" > > udevadm settle 2> /dev/null || udevsettle > > - reread_partitions $HOSTVGDRIVE > > + reread_partitions "$HOSTVGDRIVE" > > > > # sync GPT to the legacy MBR partitions > > if [ "gpt" == "$LABEL_TYPE" ]; then > > log "Running gptsync to create legacy mbr" > > - gptsync $ROOTDRIVE > > + gptsync "$ROOTDRIVE" > > fi > > > > - partpv=${HOSTVGDRIVE}${hostvgpart} > > + partpv="${HOSTVGDRIVE}${hostvgpart}" > > if [ ! -e "$partpv" ]; then > > # e.g. /dev/cciss/c0d0p2 > > - partpv=${HOSTVGDRIVE}p${hostvgpart} > > + partpv="${HOSTVGDRIVE}p${hostvgpart}" > > fi > > log "Creating physical volume" > > if [ ! -e "$partpv" ]; then > > @@ -806,18 +806,18 @@ while true; do > > for OPTION in "$@"; do > > while true; do > > read -ep "Enter $OPTION: " > > - if [[ $REPLY == "q" || $REPLY == "Q" ]]; then > > + if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then > > return > > fi > > > > if [ "$OPTION" == "Target IP" ]; then > > - OVIRT_ISCSI_TARGET_IP=$REPLY > > + OVIRT_ISCSI_TARGET_IP="$REPLY" > > if [ -n "$REPLY" ]; then > > break; > > fi > > > > elif [ "$OPTION" == "Target Port" ]; then > > - OVIRT_ISCSI_TARGET_PORT=$REPLY > > + OVIRT_ISCSI_TARGET_PORT="$REPLY" > > if [ -z "$REPLY" ]; then > > OVIRT_ISCSI_TARGET_PORT="3260" > > break; > > @@ -826,11 +826,11 @@ while true; do > > fi > > > > elif [ "$OPTION" == "CHAP Username" ]; then > > - OVIRT_ISCSI_CHAP_USERNAME=$REPLY > > + OVIRT_ISCSI_CHAP_USERNAME="$REPLY" > > break > > > > elif [ "$OPTION" == "CHAP Password" ]; then > > - OVIRT_ISCSI_CHAP_PASSWORD=$REPLY > > + OVIRT_ISCSI_CHAP_PASSWORD="$REPLY" > > break; > > fi > > done > > @@ -868,7 +868,7 @@ set /files/etc/default/ovirt/OVIRT_ISCSI_CHAP_PASSWORD $OVIRT_ISCSI_CHAP_PASSWOR > > EOF > > fi > > > > - iscsiadm -p $OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT -m discovery -t sendtargets > > + iscsiadm -p "$OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT" -m discovery -t sendtargets > > log "Restarting iscsi service" > > service iscsi restart > > > > @@ -927,8 +927,8 @@ if [ -n "$OVIRT_INIT" ]; then > > # if present, use the drive selected with 'ovirt_init' boot parameter > > # setting these the same until kernel cmdline argument implemented > > translate_multipath_device "$OVIRT_INIT" DRIVE > > - ROOTDRIVE=$DRIVE > > - HOSTVGDRIVE=$DRIVE > > + ROOTDRIVE="$DRIVE" > > + HOSTVGDRIVE="$DRIVE" > > get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE > > fi > > > > @@ -943,7 +943,7 @@ if [ "$1" == "AUTO" ]; then > > log "Beginning automatic disk partitioning.\n" > > if [ -n "$OVIRT_INIT" ]; then > > # do not format if HostVG exists on selected disk... > > - check_existing_hostvg $HOSTVGDRIVE > > + check_existing_hostvg "$HOSTVGDRIVE" > > existingHostVG=$? > > # ... unless overridden by ovirt_firstboot parameter > > if is_firstboot || [ $existingHostVG -ne 0 ]; then > > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > > index d8aa008..edf6267 100644 > > --- a/scripts/ovirt-functions > > +++ b/scripts/ovirt-functions > > @@ -148,7 +148,7 @@ EOF > > # > > wipe_volume_group() > > { > > - vg=$1 > > + vg="$1" > > > > for d in $(grep $vg /proc/mounts|awk '{print $2}'); do > > log "Unmounting $d" > > @@ -156,10 +156,10 @@ wipe_volume_group() > > done > > for d in $(grep $vg /proc/swaps|awk '{print $1}'); do > > log "Turning off $d" > > - swapoff $d > > + swapoff "$d" > > done > > log "Removing $vg" > > - vgremove -f $vg > > + vgremove -f "$vg" > > } > > > > # find_srv SERVICE PROTO > > @@ -719,10 +719,10 @@ reboot() { > > if [ "$OVIRT_ISCSI_ENABLED" = "yes" ]; then > > # setup new Root if update is prepared > > if findfs LABEL=RootUpdate 2>&1 >/dev/null; then > > - root_update_dev=$(findfs LABEL=RootUpdate 2>/dev/null) > > - root_dev=$(findfs LABEL=Root 2>/dev/null) > > - e2label $root_dev RootBackup > > - e2label $root_update_dev Root > > + root_update_dev="$(findfs LABEL=RootUpdate 2>/dev/null)" > > + root_dev="$(findfs LABEL=Root 2>/dev/null)" > > + e2label "$root_dev" RootBackup > > + e2label "$root_update_dev" Root > > fi > > fi > > # run post-install hooks > > @@ -812,12 +812,12 @@ network_up () { > > > > # Cleans partition tables > > wipe_partitions() { > > - local drive=$1 > > + local drive="$1" > > log "Wiping old boot sector" > > - dd if=/dev/zero of=$drive bs=1024K count=1 > > + dd if=/dev/zero of="$drive" bs=1024K count=1 > > # zero out the GPT secondary header > > log "Wiping secondary gpt header" > > - local disk_kb_count=$(sfdisk -s $drive 2>/dev/null) > > + local disk_kb_count=$(sfdisk -s "$drive" 2>/dev/null) > > dd if=/dev/zero of=$drive bs=1024 seek=$(($disk_kb_count - 1)) count=1 > > } > > > > @@ -840,35 +840,35 @@ test_ntp_configuration () { > > > > get_dm_device () > > { > > - local device=$1 > > + local device="$1" > > local return_var=$2 > > - major=$(stat -c '%t' $(readlink -f $device)) > > - minor=$(stat -c '%T' $(readlink -f $device)) > > + major=$(stat -c '%t' $(readlink -f "$device")) > > + minor=$(stat -c '%T' $(readlink -f "$device")) > > local dm_device= > > local rc=1 > > for dm in /dev/mapper/*; do > > - if [ $major = $(stat -c '%t' $dm) -a \ > > - $minor = $(stat -c '%T' $dm) ]; then > > - local dm_device=$dm > > + if [ $major = $(stat -c '%t' "$dm") -a \ > > + $minor = $(stat -c '%T' "$dm") ]; then > > + local dm_device="$dm" > > rc=0 > > break > > fi > > done > > > > - eval $return_var=$dm_device > > + eval $return_var="$dm_device" > > > > return $rc > > } > > > > #Function to determine partition and device names > > get_part_info() { > > - local drive_in=$1 > > + local drive_in="$1" > > local dev_var=$2 > > local part_var=$3 > > local devname_1 devname2 part_number > > local rc=0 > > > > - eval $(readlink -f $drive_in|awk {' > > + eval $(readlink -f "$drive_in" |awk {' > > print "devname_1=" substr($1,1,length($1)-1); > > print "devname_2=" substr($1,1,length($1)-2); > > part_number=substr($1,length($1),1); > > -- > > 1.6.6.1 > > > > _______________________________________________ > > Ovirt-devel mailing list > > Ovirt-devel at redhat.com > > https://www.redhat.com/mailman/listinfo/ovirt-devel > > With those couple of nitpicks, ACK. > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel Pushing without the nits as per discussion on IRC. Single quotes cause the variables to be treated as literals. $ touch "test 1" $ d="test 1" $ readlink -f "$d" /tmp/tmp.YkXO7N2oXD/test 1 $ readlink -f '$d' /tmp/tmp.YkXO7N2oXD/$d $ devices="$devices $(readlink -f '$d')" $ devices="$devices $(readlink -f "$d")" $ echo $devices /tmp/tmp.YkXO7N2oXD/$d /tmp/tmp.YkXO7N2oXD/test 1 $ devices= $ devices="$devices $(readlink -f \"$d\")" readlink: extra operand `1"' Try `readlink --help' for more information. From dpierce at redhat.com Wed Mar 31 19:40:45 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 31 Mar 2010 15:40:45 -0400 Subject: [Ovirt-devel] [PATCH] Upgrading the server to work with Rails 2.3.4. Message-ID: <1270064445-16147-1-git-send-email-dpierce@redhat.com> Signed-off-by: Darryl L. Pierce --- src/app/controllers/application_controller.rb | 2 +- src/config/environment.rb | 2 +- src/config/initializers/new_rails_defaults.rb | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb index 7e2041f..4c4666e 100644 --- a/src/app/controllers/application_controller.rb +++ b/src/app/controllers/application_controller.rb @@ -25,7 +25,7 @@ class ApplicationController < ActionController::Base # FIXME: once all controller classes include this, remove here include ApplicationService - init_gettext "ovirt" +# init_gettext "ovirt" layout :choose_layout before_filter :is_logged_in, :get_help_section diff --git a/src/config/environment.rb b/src/config/environment.rb index 913b9f9..9c1a9fa 100644 --- a/src/config/environment.rb +++ b/src/config/environment.rb @@ -20,7 +20,7 @@ # Be sure to restart your web server when you modify this file. # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') diff --git a/src/config/initializers/new_rails_defaults.rb b/src/config/initializers/new_rails_defaults.rb index 8ec3186..acfb93e 100644 --- a/src/config/initializers/new_rails_defaults.rb +++ b/src/config/initializers/new_rails_defaults.rb @@ -16,4 +16,8 @@ ActiveSupport.use_standard_json_time_format = true # Don't escape HTML entities in JSON, leave that for the #json_escape helper. # if you're including raw json in an HTML page. -ActiveSupport.escape_html_entities_in_json = false \ No newline at end of file +ActiveSupport.escape_html_entities_in_json = false + +def PGconn.quote_ident(name) + %("#{name}") +end -- 1.6.6.1 From apevec at gmail.com Wed Mar 31 21:00:47 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 31 Mar 2010 23:00:47 +0200 Subject: [Ovirt-devel] [PATCH node] Use vg uuid when detecting whether vg spans multiple disks In-Reply-To: <1269608982-9047-1-git-send-email-mburns@redhat.com> References: <1269608982-9047-1-git-send-email-mburns@redhat.com> Message-ID: ACK From apevec at gmail.com Wed Mar 31 21:04:42 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 31 Mar 2010 23:04:42 +0200 Subject: [Ovirt-devel] [PATCH node] Filter out /dev/dm-* devices from device list In-Reply-To: <1269354749-15054-1-git-send-email-mburns@redhat.com> References: <1269354749-15054-1-git-send-email-mburns@redhat.com> Message-ID: ACK From mburns at redhat.com Wed Mar 31 21:12:16 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 31 Mar 2010 17:12:16 -0400 Subject: [Ovirt-devel] [PATCH node] Filter out /dev/dm-* devices from device list In-Reply-To: References: <1269354749-15054-1-git-send-email-mburns@redhat.com> Message-ID: <1270069936.2287.21.camel@mburns-laptop.bos.redhat.com> On Wed, 2010-03-31 at 23:04 +0200, Alan Pevec wrote: > ACK > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel These two were rebased and pushed