Contact

3 thoughts on “Contact

  1. Ryan Spatz

    I have a question about getting Oracle VM Manager to work on Ubuntu. I am using 14.04.2. I followed everything that you said in your blog however I am not able to browse to the console. https://localhost.com:7002/ovm/console …. What are you doing to connect? Also is the package installing Weblogic 12c? If you could point me in the right direction that would be great. Thank you.

  2. Andrea Monti

    Hi,

    I found your script really useful, and since I added a few modifications to make it work with OVM 3.3 I found that it would be nice to share it.
    So here it is:


    #!/bin/bash
    # chkconfig:
    # description:
    #
    #: Script Name : rename-vdisks.sh
    #: Version : 1.4.0
    #: Author : Andrea Monti http://yawod.wordpress.com/ , based on the work of Matthew Mattoon - http://blog.allanglesit.com/2013/02/ovmcli-standardize-the-naming-of-virtual-disks/
    #: Author : Matthew Mattoon - http://blog.allanglesit.com
    #: Date Created : January 26, 2013
    #: Date Updated : April 2, 2015
    #: Description : Renames all OVM 3.x virtual disks to a standard naming convention.
    #: : limitations: it does not recognize Physical disk and Virtual CD on OVM 3.2
    #: Examples : rename-vdisks.sh -m OVMMANAGER -p PORT -u USER -v
    #: : rename-vdisks.sh -m ovmserver.localdomain -v
    #: : rename-vdisks.sh -m ovmserver.localdomain -w -d
    #

    usage()
    {
    cat <\|Command:\|Status:\|Time:\|Data:' | sed 's/ /:/g' | sed 's/ /_/g' `
    do
    id=`echo $i | cut -d ":" -f 3`
    echo "Examining vmdiskmapping $id "
    # read name id slot emdev vdisk vm <<\|Command:\|Status:\|Time:\|Data:' | sed 's/Emulated Block Device/EmulatedBlockDevice/' | sed 's/Virtual Disk Id/VirtualDiskId/' | sed 's/Vm Id/VmId/' | sed 's/ //' | sed 's/ = /=/g' | sed 's/ \[/:\[/g')
    if [ "$really_verbose" = "1" ]
    then
    echo "ssh -p $ovmport $ovmuser@$ovmmgr \"show vmdiskmapping id=\""
    ssh -p $ovmport $ovmuser@$ovmmgr "show vmdiskmapping id=$id"
    echo
    echo ssh output formatted
    ssh -p $ovmport $ovmuser@$ovmmgr "show vmdiskmapping id=$id" \
    | grep -v 'OVM>\|Command:\|Status:\|Time:\|Data:' \
    | sed 's/Emulated Block Device/EmulatedBlockDevice/' \
    | sed 's/Virtual Disk Id/VirtualDiskId/' \
    | sed 's/Virtual Disk/VirtualDisk/' \
    | sed 's/Vm Id/VmId/' \
    | sed 's/ //' \
    | sed 's/ = /=/g' \
    | sed 's/ \[/:\[/g' \
    | sed 's/ /_/g' \
    | grep -v 'Locked=\|Name='
    echo
    fi
    #read emdev id slot vdisk vm <<<$(ssh -p $ovmport $ovmuser@$ovmmgr "show vmdiskmapping id=$id" \
    read slot emdev vdisk vm id <<\|Command:\|Status:\|Time:\|Data:' \
    | sed 's/Emulated Block Device/EmulatedBlockDevice/' \
    | sed 's/Virtual Disk Id/VirtualDiskId/' \
    | sed 's/Virtual Disk/VirtualDisk/' \
    | sed 's/Vm Id/VmId/' \
    | sed 's/ //' \
    | sed 's/ = /=/g' \
    | sed 's/ \[/:\[/g' \
    | sed 's/ /_/g' \
    | grep -v 'Locked=\|Name=' )

    #name=` echo $name | cut -d = -f 2`
    id=` echo $id | cut -d = -f 2 | cut -d ":" -f 1`
    slot=` echo $slot | cut -d = -f 2`
    emdev=` echo $emdev | cut -d = -f 2`
    vdiskid=` echo $vdisk | cut -d = -f 2 | cut -d ":" -f 1`
    vdiskname=` echo $vdisk | cut -d = -f 2 | cut -d ":" -f 2 | sed 's/\[\|\]//g'`
    vm=` echo $vm | cut -d = -f 2 | cut -d ":" -f 2 | sed 's/\[\|\]//g'`
    # uso sed per rimuovere ^M - carriage return
    vdisktype=` echo $vdisk | sed 's/
    //g' | cut -d = -f 1`

    if [ "$verbose" = "1" ]
    then
    # echo "name=$name"
    echo "id=$id"
    echo "slot=$slot"
    echo "emdev=$emdev"
    echo "vdiskid=$vdiskid"
    echo "vdiskname=$vdiskname"
    echo "vdisktype=$vdisktype"
    fi

    if [ "$vdisktype" = "Virtual_Cd" ]
    then
    echo "Disk [ $vdiskname ] is a Virtual CD attached to this vm. It will not be renamed."
    echo ""
    continue
    fi

    if [ "$vdisktype" = "Physical_Disk" ]
    then
    echo "Disk [ $vdiskname ] is a physical disk attached to this vm. It will not be renamed."
    echo ""
    continue
    fi

    # elif [ -n "$vdiskid" ]

    ################################

    if [ "$slot" != "0" ]
    then
    slotname=data"$slot".img
    else
    slotname=system.img
    fi
    newvdiskname="$vm"_"$slotname"

    if [ "$really_verbose" = "1" ]
    then
    echo ssh -p $ovmport $ovmuser@$ovmmgr \"show virtualdisk id=$vdiskid\"
    ssh -p $ovmport $ovmuser@$ovmmgr "show virtualdisk id=$vdiskid"
    echo
    echo ssh -p $ovmport $ovmuser@$ovmmgr \"show virtualdisk id=$vdiskid\" formatted
    ssh -p $ovmport $ovmuser@$ovmmgr "show virtualdisk id=$vdiskid" | grep -v 'OVM>\|Command:\|Status:\|Time:\|Data:' | sed 's/Max (GiB)/Max(GiB)/' | sed 's/Used (GiB)/Used(GiB)/' | sed 's/Repository Id/RepositoryId/' | sed 's/Vm /Vm/' | sed 's/ //' | sed 's/ = /=/g' | sed 's/ \[/:\[/g'
    echo
    fi

    imginfo=( `ssh -p $ovmport $ovmuser@$ovmmgr "show virtualdisk id=$vdiskid" | grep -v 'OVM>\|Command:\|Status:\|Time:\|Data:' | sed 's/Max (GiB)/Max(GiB)/' | sed 's/Used (GiB)/Used(GiB)/' | sed 's/Repository Id/RepositoryId/' | sed 's/Vm /Vm/' | sed 's/ //' | sed 's/ = /=/g' | sed 's/ \[/:\[/g'` )

    # imgname=` printf "%s\n" "${imginfo[0]}" | cut -d = -f 2`
    # imgid=` printf "%s\n" "${imginfo[1]}" | cut -d = -f 2`
    # imgmaxsize=` printf "%s\n" "${imginfo[2]}" | cut -d = -f 2`
    # imgusedsize=` printf "%s\n" "${imginfo[3]}" | cut -d = -f 2`
    # imgshareable=`printf "%s\n" "${imginfo[4]}" | cut -d = -f 2`
    # imgrepoid=` printf "%s\n" "${imginfo[5]}" | cut -d = -f 2 | cut -d : -f 1`
    # imgreponame=` printf "%s\n" "${imginfo[5]}" | cut -d = -f 2 | cut -d : -f 2 | sed 's/\[\|\]//g'`

    if [ "$really_verbose" = "1" ]
    then
    echo searching for shareable disks start...
    ssh -p $ovmport $ovmuser@$ovmmgr "show virtualdisk id=$vdiskid" | grep -v 'OVM>\|Command:\|Status:\|Time:\|Data:' | sed 's/ //' | sed 's/ = /=/g' | grep Shareable=
    echo searching for shareable disks end
    fi
    imgshareable=( `ssh -p $ovmport $ovmuser@$ovmmgr "show virtualdisk id=$vdiskid" | grep -v 'OVM>\|Command:\|Status:\|Time:\|Data:' | sed 's/ //' | sed 's/ = /=/g' | grep Shareable= | cut -d = -f 2` )

    if [ "$verbose" = "1" ]
    then
    echo " VM Name : $vm"
    echo " Disk Id : $vdiskid"
    echo " Disk Name : $vdiskname"
    echo " Slot Number : $slot"
    echo " Shareable : $imgshareable"
    echo " Disk Type : $vdisktype"
    fi

    if [ -n "$vdiskid" ]
    then
    if [ "$imgshareable" = "Yes" ]
    then
    for item in `printf "%s\n" "${imginfo[@]}" | grep Vm | cut -d : -f 2 | sed 's/\[\|\]//g'`
    do
    shareddiskvmnames+="$item"_
    done
    newvdiskname="${shareddiskvmnames}${slotname}"
    unset shareddiskvmnames
    fi
    if [ "$vdiskname" != "$newvdiskname" ]
    then
    if [ "$verbose" = "1" ]
    then
    echo " Disk Name : $vdiskname"
    echo " New Disk Name : $newvdiskname"
    fi
    echo "Renaming [ $vdiskname ] to follow Standard [ $newvdiskname ] "
    echo "ssh -p $ovmport $ovmuser@$ovmmgr \"edit virtualdisk id=$vdiskid name=$newvdiskname\" | grep \"Status:\" "
    if [ "$dryrun" = "1" ]
    then
    echo ""
    else
    ssh -p $ovmport $ovmuser@$ovmmgr "edit virtualdisk id=$vdiskid name=$newvdiskname" | grep "Status:"
    echo ""
    fi
    else
    echo "Name [ $vdiskname ] follows Standard [ $newvdiskname ]"
    echo ""
    fi
    else
    echo "Virtual CDROM Detected. Rename not Required."
    echo ""
    fi
    done

  3. Akmal

    Help My… I’m try build SAN Server from OS Openindiana, spesifikasi’s hardware : IBM X 3560 M4 BD, Memory 16 GB, Hardisk 4 x 4 TB, Fiber Channel Qlogic QLA2562 dual Port 8 Gb. Mode Target. Initiator IBM Flex System. Conection Mode Phastrough initiator to Target.
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>