[one-users] option to prevent a VM instance from being deployed
Simon Boulet
simon at nostalgeek.com
Thu Dec 20 18:15:12 PST 2012
Hi,
On Thu, Dec 20, 2012 at 10:35 AM, Hyun Woo Kim <hyunwoo at fnal.gov> wrote:
>
>
> 1. apply the patch in the first place
>
The patch applies cleanly to the latest 3.8.1.
Also don't forget to set VM_SUBMIT_ON_HOLD = "YES" in your oned.conf.
> 2. define a new VM_HOOK in oned.conf that looks like
> VM_HOOK= [
> name = "special_hold"
> on = "CREATE"
> command = "a new script"
> argument = "$VMID $TEMPLATE" ]
>
3. create the "a new script" which decodes $TEMPLATE first and
> looks for a "a custom VM attribute"
> and depending on the value of the attribute, onevm release $VMID
>
>
Here is a sample hook.
In you oned.conf :
VM_HOOK= [
name = "special_hold",
on = "CREATE",
command = "/tmp/special_hold",
arguments = "$ID" ]
And create the /tmp/special_hook script:
#!/bin/sh
VM_ID=$1
if [ "`onevm show $VM_ID|grep -c ^SUBMIT_PENDING=\\"YES\\"`" = "1" ]; then
onevm release $VM_ID
fi
Make sure to chmod +x /tmp/special_hook.
This script will release VM that have the special SUBMIT_PENDING="YES"
attribute in their template.
> I also would like to know if your patch has been tested in a production
> cluster.
>
>
I haven't tested the patch in production yet. However, I'm confident it's
safe to use. In fact, it was accepted and will be integrated in the next
OpenNebula release.
Thanks
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20121220/d74f2f6c/attachment-0002.htm>
More information about the Users
mailing list