Re: [one-users] how to predeploy image

2011-04-14 Thread Łukasz Grabowski
Hi Carlos,

Thanks for help. I modified tm_clone.sh and it is working fine now.
I am enclosing below the part of the script which was modified (from 43th
line).

Regards,
Łukasz



if [ `ssh $DST_HOST 'ls '$DST_PATH' '` ]; then
  log Disk image predeployed
else

  log Creating directory $DST_DIR
  exec_and_log ssh $DST_HOST mkdir -p $DST_DIR


  case $SRC in
  http://*)
  log Downloading $SRC
  exec_and_log ssh $DST_HOST wget -O $DST_PATH $SRC
  ;;

  *)
  log Cloning $SRC
  exec_and_log scp $SRC $DST
  ;;
  esac

  exec_and_log ssh $DST_HOST chmod a+w $DST_PATH

fi





2011/4/13 Carlos Martín Sánchez cmar...@opennebula.org

 Hi Łukasz,

 You could use the tm_dummy driver. That tm script returns always 0 and does
 nothing else.
 But using that tm_driver, you will have to manually move the files for all
 VMs, not just some of them.

 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.

 Regards,
 Carlos.
 --
 Carlos Martín, MSc
 Project Major Contributor
 OpenNebula - The Open Source Toolkit for Cloud Computing
 www.OpenNebula.org http://www.opennebula.org/ | cmar...@opennebula.org


 2011/4/12 Łukasz Grabowski grabb...@gmail.com

 Hi,

 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.
 How can I predeploy a VM's image? I would appreciate clarification.

 I had several ideas how to make it work but I didn't succeed.
 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.
 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.
 3. I tried even set the source in DISK section in VM template to the
 copied file in the destination.
 However, everytime I can see in VM log, that the image is copied.

 I am enclosing VM log and VM template
 Tue Apr 12 19:46:59 2011 [DiM][I]: New VM state is ACTIVE.
 Tue Apr 12 19:46:59 2011 [LCM][I]: New VM state is PROLOG.
 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
 Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: DST:
 /var/lib/one//50/images/disk.0
 Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Creating directory
 /var/lib/one//50/images
 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.
 Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Cloning
 debian:/var/lib/one/50/images/disk.0
 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.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Creating 1024Mb image in
 /var/lib/one//50/images/disk.1
 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.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Initializing swap space
 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.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed mkdir -p
 /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed cp -R
 /var/lib/one/50/context.sh /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed cp -R
 /srv/cloud/vm_contextualization/init.sh
 /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed mkisofs -o
 /var/c8f990f3e542b79b3bb691c6c20a2684/disk.2 -J -R
 /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed rm -rf
 /var/c8f990f3e542b79b3bb691c6c20a2684.
 Tue Apr 12 19:48:46 2011 [LCM][I]: New VM state is BOOT
 Tue Apr 12 19:48:46 2011 [VMM][I]: Generating deployment file:
 /var/lib/one/50/deployment.0
 Tue Apr 12 19:48:52 2011 [LCM][I]: New VM state is RUNNING
 Tue Apr 12 19:48:59 2011 [LCM][I]: New VM state is SHUTDOWN
 Tue Apr 12 19:49:05 

Re: [one-users] how to predeploy image

2011-04-13 Thread Carlos Martín Sánchez
Hi Łukasz,

You could use the tm_dummy driver. That tm script returns always 0 and does
nothing else.
But using that tm_driver, you will have to manually move the files for all
VMs, not just some of them.

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.

Regards,
Carlos.
--
Carlos Martín, MSc
Project Major Contributor
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org http://www.opennebula.org/ | cmar...@opennebula.org


2011/4/12 Łukasz Grabowski grabb...@gmail.com

 Hi,

 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.
 How can I predeploy a VM's image? I would appreciate clarification.

 I had several ideas how to make it work but I didn't succeed.
 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.
 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.
 3. I tried even set the source in DISK section in VM template to the copied
 file in the destination.
 However, everytime I can see in VM log, that the image is copied.

 I am enclosing VM log and VM template
 Tue Apr 12 19:46:59 2011 [DiM][I]: New VM state is ACTIVE.
 Tue Apr 12 19:46:59 2011 [LCM][I]: New VM state is PROLOG.
 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
 Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: DST:
 /var/lib/one//50/images/disk.0
 Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Creating directory
 /var/lib/one//50/images
 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.
 Tue Apr 12 19:48:44 2011 [TM][I]: tm_clone.sh: Cloning
 debian:/var/lib/one/50/images/disk.0
 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.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Creating 1024Mb image in
 /var/lib/one//50/images/disk.1
 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.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_mkswap.sh: Initializing swap space
 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.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed mkdir -p
 /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed cp -R
 /var/lib/one/50/context.sh /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed cp -R
 /srv/cloud/vm_contextualization/init.sh
 /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed mkisofs -o
 /var/c8f990f3e542b79b3bb691c6c20a2684/disk.2 -J -R
 /var/c8f990f3e542b79b3bb691c6c20a2684/isofiles.
 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.
 Tue Apr 12 19:48:46 2011 [TM][I]: tm_context.sh: Executed rm -rf
 /var/c8f990f3e542b79b3bb691c6c20a2684.
 Tue Apr 12 19:48:46 2011 [LCM][I]: New VM state is BOOT
 Tue Apr 12 19:48:46 2011 [VMM][I]: Generating deployment file:
 /var/lib/one/50/deployment.0
 Tue Apr 12 19:48:52 2011 [LCM][I]: New VM state is RUNNING
 Tue Apr 12 19:48:59 2011 [LCM][I]: New VM state is SHUTDOWN
 Tue Apr 12 19:49:05 2011 [LCM][I]: New VM state is EPILOG
 Tue Apr 12 19:49:07 2011 [TM][I]: tm_delete.sh: Deleting
 /var/lib/one//50/images
 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.
 Tue Apr 12 19:49:07 2011 [DiM][I]: New VM state is DONE




 VM template
 ---
 NAME = debian-context

 CPU= 1
 MEMORY = 512

 # --- kernel  boot device ---

 OS = [
   kernel   = /boot/vmlinuz-2.6.32-5-xen-amd64,
   initrd   = /boot/initrd.img-2.6.32-5-xen-amd64,
   root = xvda2 ]

 DISK = [
   source   = /var/lib/one/50/images/disk.0,
   target   = xvda2,
   readonly = no