[one-users] start and shutdoen VMs - no problem, just trying to contribute
Ruben S. Montero
rsmontero at opennebula.org
Sat Dec 22 15:06:01 PST 2012
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 <
francesco.camisa at policlinicosanmarco.it> 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
> Users at lists.opennebula.org
> 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 | rsmontero at opennebula.org | @OpenNebula
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20121223/a7d210b8/attachment-0001.htm>
More information about the Users
mailing list