Hi Carlos, <br><br>Thanks for help. I modified tm_clone.sh and it is working fine now.<br>I am enclosing below the part of the script which was modified (from 43th line).<br><br>Regards,<br>Łukasz<br><br><br><br>if [ `ssh $DST_HOST 'ls '$DST_PATH' '` ]; then<br>
log "Disk image predeployed"<br>else<br><br> log "Creating directory $DST_DIR"<br> exec_and_log "ssh $DST_HOST mkdir -p $DST_DIR"<br><br><br> case $SRC in<br> http://*)<br> log "Downloading $SRC"<br>
exec_and_log "ssh $DST_HOST wget -O $DST_PATH $SRC"<br> ;;<br><br> *)<br> log "Cloning $SRC"<br> exec_and_log "scp $SRC $DST"<br> ;;<br> esac<br><br> exec_and_log "ssh $DST_HOST chmod a+w $DST_PATH"<br>
<br>fi<br> <br><br><br><br><br><div class="gmail_quote">2011/4/13 Carlos Martín Sánchez <span dir="ltr"><<a href="mailto:cmartin@opennebula.org">cmartin@opennebula.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Łukasz,<br><br>You could use the tm_dummy driver. That tm script returns always 0 and does nothing else.<br>But using that tm_driver, you will have to manually move the files for all VMs, not just some of them.<br><br>
It would be best if you could modify the driver (tm_clone.sh, look for it in your lib location) to issue the mkdir and scp commands only if the destination file is not already present. It should be pretty straight-forward.<br>
<br>Regards,<br>Carlos.<br clear="all"><span style="border-collapse: collapse; color: rgb(136, 136, 136); font-family: arial,sans-serif; font-size: 13px;">--<br>Carlos Martín, MSc<br>Project Major Contributor<br><span style="background-color: rgb(255, 255, 204); color: rgb(34, 34, 34);">OpenNebula</span> - The Open Source Toolkit for Cloud Computing<br>
<a href="http://www.opennebula.org/" style="color: rgb(42, 93, 176);" target="_blank">www.<span style="background-color: rgb(255, 255, 204); color: rgb(34, 34, 34);">OpenNebula</span>.org</a> | <a href="mailto:cmartin@opennebula.org" style="color: rgb(42, 93, 176);" target="_blank">cmartin@<span style="background-color: rgb(255, 255, 204); color: rgb(34, 34, 34);">opennebula</span>.org</a></span><br>
<br><br><div class="gmail_quote"><div><div></div><div class="h5">2011/4/12 Łukasz Grabowski <span dir="ltr"><<a href="mailto:grabbs07@gmail.com" target="_blank">grabbs07@gmail.com</a>></span><br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">
Hi,<br><br>I am using OpenNebula 1.4 and Haizea 1.0. I want to predeploy an image so that the VM could start at the scheduled by haizea time.<br>How can I predeploy a VM's image? I would appreciate clarification.<br>
<br>
I had several ideas how to make it work but I didn't succeed.<br>1. I tried to copy a prepared image to the default directory (/var/lib/one/<VM-id>/images/) in which it should be stored when a new VM is created.<br>
2. Then I tried to do the same and to create transfer.0.prolog file (after reading one of the generated by opennebula) but it didn't work.<br>3. I tried even set the source in DISK section in VM template to the copied file in the destination.<br>
However, everytime I can see in VM log, that the image is copied.<br><br>I am enclosing VM log and VM template <br>Tue Apr 12 19:46:59 2011 [DiM][I]: New VM state is ACTIVE.<br>Tue Apr 12 19:46:59 2011 [LCM][I]: New VM state is PROLOG.<br>
Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: debian:/var/lib/one/50/images/disk.0 194.29.169.42:/var/lib/one//50/images/disk.0<br>Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: DST: /var/lib/one//50/images/disk.0<br>Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Creating directory /var/lib/one//50/images<br>
Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Executed "ssh 194.29.169.42 mkdir -p /var/lib/one//50/images".<br>Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Cloning debian:/var/lib/one/50/images/disk.0<br>Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Executed "scp debian:/var/lib/one/50/images/disk.0 194.29.169.42:/var/lib/one//50/images/disk.0".<br>
Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Executed "ssh 194.29.169.42 chmod a+w /var/lib/one//50/images/disk.0".<br>Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Creating 1024Mb image in /var/lib/one//50/images/disk.1<br>
Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Executed "ssh 194.29.169.42 mkdir -p /var/lib/one//50/images".<br>Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Executed "ssh 194.29.169.42 dd if=/dev/zero of=/var/lib/one//50/images/disk.1 bs=1 count=1 seek=1024M".<br>
Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Initializing swap space<br>Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Executed "ssh 194.29.169.42 /sbin/mkswap /var/lib/one//50/images/disk.1".<br>Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Executed "ssh 194.29.169.42 chmod a+w /var/lib/one//50/images/disk.1".<br>
Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed "mkdir -p /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles".<br>Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed "cp -R /var/lib/one/50/context.sh /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles".<br>
Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed "cp -R /srv/cloud/vm_contextualization/id_rsa.pub /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles".<br>Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed "cp -R /srv/cloud/vm_contextualization/init.sh /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles".<br>
Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed "mkisofs -o /var/c8f990f3e542b79b3bb691c6c20a2684/disk.2 -J -R /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles".<br>Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed "scp /var/c8f990f3e542b79b3bb691c6c20a2684/disk.2 194.29.169.42:/var/lib/one//50/images/disk.2".<br>
Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed "rm -rf /var/c8f990f3e542b79b3bb691c6c20a2684".<br>Tue Apr 12 19:48:46 2011 [LCM][I]: New VM state is BOOT<br>Tue Apr 12 19:48:46 2011 [VMM][I]: Generating deployment file: /var/lib/one/50/deployment.0<br>
Tue Apr 12 19:48:52 2011 [LCM][I]: New VM state is RUNNING<br>Tue Apr 12 19:48:59 2011 [LCM][I]: New VM state is SHUTDOWN<br>Tue Apr 12 19:49:05 2011 [LCM][I]: New VM state is EPILOG<br>Tue Apr 12 19:49:07 2011 [TM][I]: tm_delete.sh: Deleting /var/lib/one//50/images<br>
Tue Apr 12 19:49:07 2011 [TM][I]: tm_delete.sh: Executed "ssh 194.29.169.42 rm -rf /var/lib/one//50/images".<br>Tue Apr 12 19:49:07 2011 [DiM][I]: New VM state is DONE<br><br><br><br><br>VM template<br>---------------------------------------------------------------<br>
NAME = debian-context<br><br>CPU = 1<br>MEMORY = 512<br><br># --- kernel & boot device ---<br><br>OS = [<br> kernel = "/boot/vmlinuz-2.6.32-5-xen-amd64",<br> initrd = "/boot/initrd.img-2.6.32-5-xen-amd64",<br>
root = "xvda2" ]<br><br>DISK = [<br> source = "/var/lib/one/50/images/disk.0",<br> target = "xvda2",<br> readonly = "no" ]<br><br>DISK = [<br> type = swap,<br> size = 1024,<br>
readonly = "no",<br> target = "xvda1" ]<br><br>NIC=[network="private"]<br><br>HAIZEA = [ start = "+00:01:10",<br> duration = "00:02:00",<br> preemptible = "no" ]<br>
<br><br><br><br><br>
<br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br>
</blockquote></div><br>