Hi Francesco,

Thanks for sharing, I just curious about the sleep statement after the
instantiate command. Is there any timing problems there? Is there anything
that OpenNebula could do better to get rid of the sleep?

Cheers

Ruben


On Thu, Dec 20, 2012 at 7:48 PM, Francesco Camisa <
[email protected]> wrote:

> I wrote these to very simple script to start and shutdown a few VMs that
> need to be up and/or shutdown in our cluster.
>
> They work for us. Please forgive me if they don't work off the bat (my
> shop is Italian based so I had to translate them).
>
> Here we go.
>
> To start the VMs:
>
> # start-core-vm
>
>
> onetemplate="/usr/bin/onetemplate"
> sleep="/bin/sleep"
> seconds=150
> vmliststart="<vm1> <vm2> ..."
>
> for vm in $vmliststart
>         do
>                 echo 'Do you want to start '$vm' ?'
>                 echo
>                 echo "type\" yes \" , any other key to abort!"
>                 read -n 4 CONFIRMATION
>                 case "$CONFIRMATION" in
>                 yes|Yes|YES)
>                         $onetemplate instantiate $vm --name $vm
>                         echo 'wait '$seconds' seconds'
>                         $sleep $seconds
>                         ;;
>                 *)
>                         echo -e "\n"
>                         echo ''$vm' was not started'
>                         echo -e "\n"
>                         ;;
>                 esac
>         done
> exit 0
>
> To stop the VMs:
>
> # start-core-vm
>
>
> onetemplate="/usr/bin/onetemplate"
> sleep="/bin/sleep"
> seconds=150
> vmliststart="<vm1> <vm2> ..."
>
> for vm in $vmliststart
>         do
>                 echo 'Do you want to start '$vm' ?'
>                 echo
>                 echo "type\" yes \" , any other key to abort!"
>                 read -n 4 CONFIRMATION
>                 case "$CONFIRMATION" in
>                 yes|Yes|YES)
>                         $onetemplate instantiate $vm --name $vm
>                         echo 'wait '$seconds' seconds'
>                         $sleep $seconds
>                         ;;
>                 *)
>                         echo -e "\n"
>                         echo ''$vm' was not started'
>                         echo -e "\n"
>                         ;;
>                 esac
>         done
> exit 0
>
>
>
> Francesco Camisa
> Vice Direttore Generale
> Policlinico San Marco
> via Zanotto 40
> 30173 Mestre-VE
> Italy
> tel +39 041 5071 618
> fax +39 041 0998 956
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Ruben S. Montero, PhD
Project co-Lead and Chief Architect
OpenNebula - The Open Source Solution for Data Center Virtualization
www.OpenNebula.org | [email protected] | @OpenNebula
_______________________________________________
Users mailing list
[email protected]
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Reply via email to