From halves at linux.vnet.ibm.com Wed May 25 12:29:02 2011 From: halves at linux.vnet.ibm.com (Higor Aparecido Vieira Alves) Date: Wed, 25 May 2011 09:29:02 -0300 Subject: [Ovirt-devel] Hook script to preserve one partition untouched during install Message-ID: <1306326542.3585.3.camel@halves.br.ibm.com> This hook script tries to address the fact that a RHEV-H installation will format all the storage devices available in the machine in order to create HostVG and AppVG with all the available space. It may be the case that RHEV-H needs to respect and co-exist with a proposed partitioning scheme, not getting all the storage space for HostVG and AppVG volume groups. The proposed solution adds the required logic as a hook script to ovirt-config-boot service that is activated only during the end of the installation process (firstboot parameter), right before rebooting into the installed RHEV-H. In high level, this script behaves as the following: a) Consume a kernel parameter that indicates which is the HDD device and partition to preserve. The syntax for this kernel parameter is the following: ignore_vol=/dev/sdb:1 In this example, /dev/sdb is the device, and partition #1 will be left untouched. Notice that the device listed in ignore_vol cannot be present in storage_init also --- devices in storage_init will be formated by the RHEV-H install process. Also, AppVG logical volumes sizes should not be specified in storage_vol kernel parameter. Hence, the RHEV-H installation process will only create HostVG with the device not listed in ignore_vol. b) Implement some partition probe scanning logic that identifies the adjacent partitions to be preserved. Initially this hook script will duplicate some functionalities of the ovirt-config-storage function. Long term, if it integrated into ovirt-config-storage function, then the additional logic is no longer needed. c) With that information, and if required, remove all partitions but the ones set to be preserved. d) Create the AppVG with backup and data partitions on the reminder of the disk (the region with the partitions that were removed) e) Format backup and data partitions f) add data partition to fstab ## ## Partition Script ## #!/bin/bash #VERSION: 0.10 LOG_FILE="/var/log/partition.log" RETURN="" CMDLINE="/proc/cmdline" VG_NAME="AppVG" LV_BACKUP="Backup" LV_BACKUP_SIZE="-l 100%FREE" LV_DATA="Data2" LV_DATA_SIZE="-L 290M" # Write log messages in /var/log/partition # Parameters: # - MSG: Log message log() { local MSG=$1 echo "$MSG" >> $LOG_FILE } # Scan a hard disk to find all available partitions to create # AppVG Volume Group. # Parameter: # - DISK: hard disk to be analized (example, sdb) # - PARTITION: partition number to be preserved (example, 1) # Return: # - ARRAY_PV: array with partitions available disk_scan() { local DISK=$1 local PART=$2 local DM='' local DM_NAME='' local PATTERN='' local DIR='' RETURN='' if [ -z "$DISK" -o -z "$PART" ]; then log "ERROR: $FUNCTION missing parameter" return 1 fi if [ ! -e "/dev/$DISK" -o ! -e "/dev/$DISK$PART" ]; then log "ERROR: $DISK or $DISK$PART not found" return 1 fi DM=$(ls /sys/block/$DISK/holders/) if [ -n "$DM" ]; then log "Found a device mapper assigned to $DISK" DM_NAME=$(cat /sys/block/${DM[0]}/dm/name) if [ $? -ne 0 ]; then log "ERROR: 'name' not present at /sys/block/$DEVICE/dm/name" return 1 fi PATTERN="*""$DM_NAME""p?" DIR="/dev/disk/by-id/" RETURN=( $(find "$DIR" -type l -name "$PATTERN" -regex ".*[^ $PART]$") ) if [ $? -ne 0 ]; then log "ERROR: Can not identify partitions available in $DISK/$DM_NAME" return 1 fi else PATTERN="$DISK?" DIR="/dev/" RETURN=( $(find "$DIR" -type b -name "$PATTERN" -regex ".*[^ $PART]$") ) if [ $? -ne 0 ]; then log "ERROR: Can not identify partitions available in $DISK/$DM_NAME" return 1 fi fi return 0 } main() { local DEVICE='' local IGNORE_VOL='' local VG='' local PV='' local ARRAY_PV='' local OUTPUT='' local DISK'' local PART='' if grep -q "firstboot" $CMDLINE && grep -q "ignore_vol" $CMDLINE; then IGNORE_VOL=$(cat $CMDLINE | sed 's/^.*ignore_vol=//' | awk '{print $1}') else log "Parameters firstboot or ignore_vol not found in $CMDLINE. Aborting" return 1 fi DISK=`echo $IGNORE_VOL | sed -e 's/^\/dev\///' -e 's/:.*$//'\ -e 's/[[:digit:]].*$//'` PART=$(echo $IGNORE_VOL | sed -e 's/^.*://' -e 's/^.*[[:lower:]]//') if ! disk_scan $DISK $PART; then log "ERROR: Can not scan $DISK" return 1 fi ARRAY_PV=${RETURN[*]} if [ ${#ARRAY_PV[*]} -eq 0 ]; then log "ERROR: Partitions not found, verify your disk." return 1 fi for PV in ${ARRAY_PV[*]}; do # Looking if partition has a PV pvs --noheadings "$PV" if [ $? -eq 0 ]; then log "Physical Volume found in $PV" # Looking if PV has Volume Group OUTPUT=( $(pvs --noheadings -o vg_name "$PV") ) if [ ${#OUTPUT[*]} -gt 0 ]; then log "PV $PV has $VG Volume Group" VG=${OUTPUT[0]} # Looking if Volume Group has Logical Volumes OUTPUT=( $(lvs --noheadings -o lv_name "$VG") ) if [ ${#OUTPUT[*]} -gt 0 ]; then log "$VG has Logical Volumes: ${OUTPUT[*]}" log "Removing Logical Volumes" lvremove -ff "$VG" if [ $? -ne 0 ]; then log "Error: Can not remove Logical Volumes" return 1 fi fi log "Removing Volume Group" vgremove -ff "$VG" if [ $? -ne 0 ]; then log "Error: Can not remove Volume Group" return 1 fi fi else log "Creating Physical Volume" pvcreate "$PV" if [ $? -ne 0 ]; then log "Error: Can not create Physical Volume" return 1 fi fi done log "Creating Volume Group" vgcreate "$VG_NAME" "${ARRAY_PV[*]}" if [ $? -ne 0 ]; then log "Error: Can not create Volume Group" return 1 fi log "Creating Logical Volume $LV_DATA" lvcreate ${LV_DATA_SIZE} -n ${LV_DATA} ${VG_NAME} if [ $? -ne 0 ]; then log "Error: Can not create Logical Volume" return 1 fi lvcreate ${LV_BACKUP_SIZE} -n ${LV_BACKUP} ${VG_NAME} if [ $? -ne 0 ]; then log "Error: Can not create Logical Volume" return 1 fi DEVICE="/dev/${VG_NAME}/${LV_BACKUP}" mkfs -t ext4 $DEVICE if [ $? -ne 0 ]; then log "Error: Can not format Logical Volume" return 1 fi DEVICE="/dev/${VG_NAME}/${LV_DATA}" mkfs -t ext4 $DEVICE if [ $? -ne 0 ]; then log "Error: Can not format Logical Volume" return 1 fi if ! grep -q "$DEVICE" /etc/fstab; then log "Automounting $DEVICE..." echo "$DEVICE /data2 ext4 defaults,noatime 0 0" >> /etc/fstab fi } main exit $? From pronix.service at gmail.com Thu May 26 07:05:21 2011 From: pronix.service at gmail.com (dima vasiletc) Date: Thu, 26 May 2011 11:05:21 +0400 Subject: [Ovirt-devel] ovirt development are stopped ? Message-ID: <4DDDFBB1.8070401@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello During few months ovirt stay without commits. Are redhat complete it or create something more interesting ? - -- ? ?????????, ??????? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJN3fuiAAoJEK+lCKq8rONR1bAH/igFk7xiUXTwVpmijYQ4k8e4 I3ecMPFcD2oF75Ctw1mozSE/0jsETY5Xf3w0AUTqCI8u02o0h4JkdZctpxagi0CQ RhVHskcpQmAdijnDCmoiUs4z+Oop+xlcXF1xGdRT2qawd52YsYM85QjV4jLL//bG o70itp5G4o+2qhF2mJzXiZn9E7hscJBWY52pTm0LjCdRjGKQNJ4kd0GmvSnaCF4t j4PT0GtmfOSJM3MJ4YNRdSv/WPPx/AFNu6140SON3lRgIT4zrcT+rfjnZBEn0cTK 003t2FESKT4CXTQa47zhz2iks149SNNOkX/wvSuQu5NHDifPudGtxThM2d3ZI+M= =T2VR -----END PGP SIGNATURE----- From pmyers at redhat.com Thu May 26 12:35:49 2011 From: pmyers at redhat.com (Perry Myers) Date: Thu, 26 May 2011 08:35:49 -0400 Subject: [Ovirt-devel] ovirt development are stopped ? In-Reply-To: <4DDDFBB1.8070401@gmail.com> References: <4DDDFBB1.8070401@gmail.com> Message-ID: <4DDE4925.90201@redhat.com> On 05/26/2011 03:05 AM, dima vasiletc wrote: > Hello > During few months ovirt stay without commits. > Are redhat complete it or create something more interesting ? We're actively working on oVirt Node. Our development team is in the process of making some major sync-ups to the upstream git repo. So hopefully any day now we'll have a shiny new oVirt Node based on Fedora 15 that folks can try out. As for oVirt Server, there may be other community members that are still working on it, but at the present time there is no one from Red Hat working on that project. Please see the below email from earlier this year: https://www.redhat.com/archives/ovirt-devel/2011-January/msg00000.html Thanks, Perry From geoffocallaghan at gmail.com Sat May 28 02:52:57 2011 From: geoffocallaghan at gmail.com (Geoff O'Callaghan) Date: Sat, 28 May 2011 12:52:57 +1000 Subject: [Ovirt-devel] ovirt development are stopped ? Message-ID: On Thu, May 26, 2011 at 10:35 PM, Perry Myers wrote: > On 05/26/2011 03:05 AM, dima vasiletc wrote: > > Hello > > During few months ovirt stay without commits. > > Are redhat complete it or create something more interesting ? > > We're actively working on oVirt Node. Our development team is in the > process of making some major sync-ups to the upstream git repo. So > hopefully any day now we'll have a shiny new oVirt Node based on Fedora > 15 that folks can try out. > > Great to hear! I'm guessing this is being tracked internally to redhat rather than in a public mailing list? Is that right? If so, is it moving to a public list. If it's already public, but not here on ovirt-devel can you let me know where please? [snip] Tks Geoff -------------- next part -------------- An HTML attachment was scrubbed... URL: From mburns at redhat.com Sat May 28 03:08:49 2011 From: mburns at redhat.com (Mike Burns) Date: Fri, 27 May 2011 23:08:49 -0400 Subject: [Ovirt-devel] ovirt development are stopped ? In-Reply-To: References: Message-ID: <1306552129.15015.15.camel@mburns-laptop.usersys.redhat.com> On Sat, 2011-05-28 at 12:52 +1000, Geoff O'Callaghan wrote: > On Thu, May 26, 2011 at 10:35 PM, Perry Myers wrote: > > > On 05/26/2011 03:05 AM, dima vasiletc wrote: > > > Hello > > > During few months ovirt stay without commits. > > > Are redhat complete it or create something more interesting ? > > > > We're actively working on oVirt Node. Our development team is in the > > process of making some major sync-ups to the upstream git repo. So > > hopefully any day now we'll have a shiny new oVirt Node based on Fedora > > 15 that folks can try out. > > > > Great to hear! I'm guessing this is being tracked internally to redhat > rather than in a public mailing list? Is that right? If so, is it moving to > a public list. If it's already public, but not here on ovirt-devel can you > let me know where please? > [snip] > > Tks > Geoff This is the right list. We'll be moving stuff back out here in the next week or so and all future development will be done publicly. Mike > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel