[one-users] Resize operation to one and sunstone

Juanra amon.raj at gmail.com
Fri Aug 10 02:26:08 PDT 2012


Hello list.

I have made a shell script that resizes a disk to get all free space. I put
it in rc.local and after it I run resize2fs.

I am using lvm and qemu and first I resize the disk in host, but I want to
know how can I add a command to opennebula that calls lvresize or qemu-img
convert ??.


Thanks in advice.

PD: This is script I am using.

#!/bin/bash

INICIO=`sfdisk -u S -l /dev/vda | sed -n '6 p' | sed "s/^ *//;s/ *$//;s/
\{1,\}/ /g" | cut -d" " -f2`
FIN=`sfdisk -u S -l /dev/vda | sed -n '6 p' | sed "s/^ *//;s/ *$//;s/
\{1,\}/ /g" | cut -d" " -f3`
TAM=`sfdisk -u S -s /dev/vda`

if [ "$TAM" != "$FIN" ]; then
        echo $INICIO $FIN $TAM > /root/resize.txt
        echo "$INICIO,,L *" | sfdisk -u S -f /dev/vda
        shutdown -rF now
fi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120810/655663eb/attachment.htm>


More information about the Users mailing list