[Ovirt-devel] [PATCH node] Added support for local storage configuration.

Daniel P. Berrange berrange at redhat.com
Wed Nov 12 21:41:12 UTC 2008


On Wed, Nov 12, 2008 at 04:24:16PM -0500, Darryl L. Pierce wrote:
> This patch wipes out the entire disk on the node and replaces it with
> +        case $REPLY in
> +            Y|y)
> +                printf "Preparing local storage. Please wait..."
> +
> +                {
> +                vgroups=$(vgdisplay -C | awk '{ print $1" "; }')
> +                vgremove -f $vgroups
> +
> +                dd if=/dev/zero of=$DRIVE bs=1K count=1
> +                blockdev --rereadpt $DRIVE
> +                partprobe -s $DRIVE
> +
> +                parted $DRIVE -s "mklabel msdos"
> +                parted $DRIVE -s "mkpart primary ext2 0.0 ${BOOT_SIZE}M"
> +                parted $DRIVE -s "mkpart primary ext2 ${BOOT_SIZE}M -1s"
> +                parted $DRIVE -s "set 2 lvm on"
> +
> +                pvcreate "${DRIVE}2"
> +                pvck
> +                vgcreate /dev/HostVG "${DRIVE}2"
> +
> +                lvcreate --name Swap    /dev/HostVG --size ${SWAP_SIZE}M
> +                lvcreate --name Root    /dev/HostVG --size ${ROOT_SIZE}M
> +                lvcreate --name Config  /dev/HostVG --size ${CONFIG_SIZE}M
> +                lvcreate --name Logging /dev/HostVG --size ${LOGGING_SIZE}M
> +                lvcreate --name Data    /dev/HostVG --size ${DATA_SIZE}M
> +
> +                mke2fs -T ext2 "${DRIVE}1"         -L "BOOT"
> +                mke2fs -T swap /dev/HostVG/Swap

This is still broken as per my previous mail

> +                mke2fs -T ext2 /dev/HostVG/Root    -L "ROOT"
> +                mke2fs -T ext3 /dev/HostVG/Config  -L "CONFIG"
> +                mke2fs -T ext3 /dev/HostVG/Logging -L "LOGGING"
> +                mke2fs -T ext3 /dev/HostVG/Data    -L "DATA"
> +                } > partition.log 2>&1
> +

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the ovirt-devel mailing list