[one-users] Fw: Workflow Management in Open Nebula

Carlos Martín Sánchez cmartin at opennebula.org
Mon Sep 26 06:24:43 PDT 2011


Hi,

2011/9/23 Joydipto Banerjee <joydipto.b at in.ibm.com>

> Can you please guide us on how the hook can query the above details from
> *.vm or *.img ?
>

The hook is executed as oneadmin, so you can use any interface to query the
data from the core. You can use the CLI (e.g. onevm show <id>, oneimage show
<id>), maybe with the -x option.
If your hook is a ruby or java program, you can also use the APIs [1,2]

After I execution, I see that the VM stays in "BOOT" state ...and the
> following lines are written to the log file ..
>  Fri Sep 23 17:10:51 2011 [LCM][I]: New VM state is BOOT
> Fri Sep 23 17:10:51 2011 [VMM][I]: Generating deployment file:
> /srv/cloud/one/var/37/deployment.0
>
> How can the admin manually enable this VM if he/she chooses to 'approve'
> the request ?
>

The VM is in boot because the scheduler deployed it. To make the scheduler
ignore the new VMs, just execute the hold action from the CREATE hook (onevm
hold <id>).
A VM on hold will stay in that state until you execute a onevm enable <id>
[3]


Regards,
Carlos.

[1] http://opennebula.org/documentation:rel3.0:ruby
[2] http://opennebula.org/documentation:rel3.0:java
[3]
http://opennebula.org/documentation:rel3.0:vm_guide_2#virtual_machine_life-cycle

--
Carlos Martín, MSc
Project Major Contributor
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org <http://www.opennebula.org/> | cmartin at opennebula.org


2011/9/23 Joydipto Banerjee <joydipto.b at in.ibm.com>

> Hello again ..
> I have tested hooks in 2.2 also and it works fine ...so please ignore my
> previous email. Apologize.
>
> I have been able to follow your instructions to a certain extent ...but
> need your help on the following :
>
>
> *for step 1: *
>
> The hook can query OpenNebula for details about the user, the VM or any
> other resources used in the requested VM like Images or VNets. That email
> could look like this:
>
> The user john_doe (8) wants to deploy a VM with
> VM ID  : 31
> CPU    : 2
> MEMORY : 1024
> DISK   : IMAGE ID 15
>          Ubuntu Server
>          10G
>
> Can you please guide us on how the hook can query the above details from
> *.vm or *.img ?
>
> *for step 2:*
>
> I have inserted the following in the  oned.conf file :
>
> VM_HOOK = [
>     name      = "To_Trigger_Email_On_VM_Creation",
>     on        = "CREATE",
>     command   = "joydipto_mail_trigger.sh",
>     arguments = "$VMID" ]
>
> After I execution, I see that the VM stays in "BOOT" state ...and the
> following lines are written to the log file ..
>  Fri Sep 23 17:10:51 2011 [LCM][I]: New VM state is BOOT
> Fri Sep 23 17:10:51 2011 [VMM][I]: Generating deployment file:
> /srv/cloud/one/var/37/deployment.0
>
> How can the admin manually enable this VM if he/she chooses to 'approve'
> the request ?
>
> Thanks in advance.
>
> Regards,
> Joydipto.
>
> ----- Forwarded by Joydipto Banerjee/India/IBM on 09/23/2011 05:34 PM -----
>
> From:        Joydipto Banerjee/India/IBM
> To:        Carlos Martín Sánchez <cmartin at opennebula.org>
> Date:        09/23/2011 03:45 PM
> Subject:        Re: [one-users] Workflow Management in Open Nebula
> ------------------------------
>
>
> Many Thanks Carlos.
>
> I forgot to mention that we are using Open Nebula 2.2. The documentation
> links that you suggested mention Open Nebula 3.0
>
> So, does the solution that you mentioned for incorporating 'workflow' hold
> for OpenNebula 2.2 also ?
>
> Thanks and Regards,
> Joydipto.
>
>
> *JOYDIPTO BANERJEE*
> ------------------------------
>  [image: 2D barcode - encoded with contact information] *Phone:*91-98300-34416
> *
> E-mail:* *joydipto.b at in.ibm.com* <joydipto.b at in.ibm.com>
> [image: IBM]
>
> DLF IT Park, Tower C
> Kolkata, 700156
> India
>
>
>
>
>
> From:        Carlos Martín Sánchez <cmartin at opennebula.org>
> To:        Joydipto Banerjee/India/IBM at IBMIN
> Cc:        users at lists.opennebula.org
> Date:        09/16/2011 10:41 PM
> Subject:        Re: [one-users] Workflow Management in Open Nebula
> ------------------------------
>
>
>
> Hi,
>
> We don't have any tool to manage the workflow, but OpenNebula can be easily
> tweaked with a few shell script lines.
> The scenario you describe can be achieved using hooks [1] in the following
> way:
>
> 1 - After a VM creation (or a Template instantiation), a VM "on create"
> hook can be triggered to hold the VM (the scheduler ignores VMs in this
> state) and send that notification email.
> The hook can query OpenNebula for details about the user, the VM or any
> other resources used in the requested VM like Images or VNets. That email
> could look like this:
>
> The user john_doe (8) wants to deploy a VM with
> VM ID  : 31
> CPU    : 2
> MEMORY : 1024
> DISK   : IMAGE ID 15
>          Ubuntu Server
>          10G
>
> 2 - If the administrator decides to approve the request, then he simply has
> to enable that VM. For a denied request, the VM can be deleted.
> This could be done manually, using the CLI or Sunstone.
> I guess it shouldn't be too difficult to configure a mail delivery agent
> such as procmail to enable or delete the VM after reciving a "yes/no" email
> reply from the administrator.
>
> 3 - Another hook can be triggered when the VM reaches the running state.
> This one will send an email to the owner user with the login instructions,
> including VM details like the assigned IP.
> You have to come up with a way to store the user's email. Maybe a small
> sqlite DB, a new table in OpenNebula's DB, or even use the email as the
> OpenNebula username.
>
> This is a basic configuration to get you started, but the hook mechanism
> can be combined with:
> - ACLs [2] : you may want to fine-tune the allowed user actions
> - usage quotas [3] : after certain limits, the new VM creation requests
> would be denied without bothering the administrator with more emails
> - Sunstone tuning [4] : you could modify sunstone to adapt it to your
> needs. Views can be configured to show only certain tabs, or maybe hide some
> buttons. You could even include a new text input box that would allow users
> to include a personalized message for the administrator each time a VM is
> created. The "on create" hook can look for that attribute in the VM template
> and add it to the email.
>
> Best regards,
> Carlos.
>
> [1] *http://opennebula.org/documentation:rel3.0:hooks*<http://opennebula.org/documentation:rel3.0:hooks>
> [2] *http://opennebula.org/documentation:rel3.0:manage_acl*<http://opennebula.org/documentation:rel3.0:manage_acl>
> [3] *http://opennebula.org/documentation:rel3.0:quota_auth*<http://opennebula.org/documentation:rel3.0:quota_auth>
> [4] *http://opennebula.org/documentation:rel3.0:sunstone#plugins*<http://opennebula.org/documentation:rel3.0:sunstone#plugins>
> --
> Carlos Martín, MSc
> Project Major Contributor
> OpenNebula - The Open Source Toolkit for Cloud Computing*
> **www.**OpenNebula**.org* <http://www.opennebula.org/> | *cmartin@**
> opennebula**.org* <cmartin at opennebula.org>
>
>
> On Fri, Sep 16, 2011 at 11:43 AM, Joydipto Banerjee <*
> joydipto.b at in.ibm.com* <joydipto.b at in.ibm.com>> wrote:
> Hi - Does anyone know if there exists a workflow management system in Open
> Nebula.
> I am thinking of a scenario where a User requests a Virtual Machine(VM)
> through the Open Nebula Sunstone web interface, after which an email
> notification is sent to the Cloud Administrator to approve/reject the
> request.
>
> Post VM creation, an automatic email is sent back to the end user, giving
> him the details of IP of the new image and login details (userid , password
> ).
>
> Are such scenarios possible ?
>
> Thanks in advance.
>
> _______________________________________________
> Users mailing list*
> **Users at lists.opennebula.org* <Users at lists.opennebula.org>*
> **http://lists.opennebula.org/listinfo.cgi/users-opennebula.org*<http://lists.opennebula.org/listinfo.cgi/users-opennebula.org>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110926/eac13cda/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 6422 bytes
Desc: not available
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110926/eac13cda/attachment-0002.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 2022 bytes
Desc: not available
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110926/eac13cda/attachment-0002.gif>


More information about the Users mailing list