[one-users] Hooks Issue with Vmware

Bharat Bagai bagai_bharat at hotmail.com
Wed Oct 19 00:58:03 PDT 2011


HI All

First of All i notice that "Add Graphics" option that are link to VNC does not available with VMWARE Wizard under Templates option. 

Second, When i tried to implement HOOKS with VMWARE Hypervisor, it struck while deployment. The following are the configuration 

oned.conf
------------------------------------------------------------------------------------------
VM_HOOK = [
    name      = "image",
    on        = "RUNNING",
    command   = "/var/lib/one/hooks/email_trigger.sh",
    arguments = "$VMID " "$NAME" "$VCPU" "$MEMORY" ]
---------------------------------------------------------------------------------------
email_trigger.sh
--------------------------------------------------------------------------------------------
#!/bin/bash
echo "New VM is created with the following attributes:" >> /var/lib/one/hooks/test.txt
echo "VM ID: " $1 >> /var/lib/one/hooks/test.txt
echo "VM Name: " $2 >> /var/lib/one/hooks/test.txt
echo "Number of CPU(s): " $3 >> /var/lib/one/hooks/test.txt
echo "Memory: " $4 >> /var/lib/one/hooks/test.txt

cat /var/lib/one/hooks/test.txt | mail -s "New VM Created" <email ID>

mv /var/lib/one/hooks/test.txt /var/lib/one/hooks/test.txt_VMID_$1

----------------------------------------------------------------------------------------------------------

VM.log
---------------------------------------------------------------------------------------------------------------------
 tail -f /var/lib/one/var/23/vm.log
Wed Oct 19 13:10:00 2011 [TM][D]: tm_clone.sh: DST: /var/lib/one/var/images/23/images/disk.0
Wed Oct 19 13:10:00 2011 [TM][I]: tm_clone.sh: Creating directory /var/lib/one/var/images/23/images
Wed Oct 19 13:10:00 2011 [TM][I]: tm_clone.sh: Executed "mkdir -p /var/lib/one/var/images/23/images".
Wed Oct 19 13:10:00 2011 [TM][I]: tm_clone.sh: Executed "chmod a+w /var/lib/one/var/images/23/images".
Wed Oct 19 13:10:00 2011 [TM][I]: tm_clone.sh: Cloning /var/lib/one/var/images/1f4ea25cc8404c2aed5c7ad3c09debba/images
Wed Oct 19 13:10:00 2011 [TM][I]: tm_clone.sh: Executed "cp -r /var/lib/one/var/images/1f4ea25cc8404c2aed5c7ad3c09debba /var/lib/one/var/images/23/images/disk.0".
Wed Oct 19 13:10:00 2011 [TM][I]: tm_clone.sh: Executed "chmod a+rw /var/lib/one/var/images/23/images/disk.0".
Wed Oct 19 13:10:00 2011 [TM][I]: ExitCode: 0
Wed Oct 19 13:10:00 2011 [LCM][I]: New VM state is BOOT
Wed Oct 19 13:10:00 2011 [VMM][I]: Generating deployment file: /var/lib/one/var/23/deployment.0

-------------------------------------------------------------------------------------------------------------------------------------------

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20111019/36f265fb/attachment.htm>


More information about the Users mailing list