[one-users] how to predeploy image

Łukasz Grabowski grabbs07 at gmail.com
Tue Apr 12 10:53:25 PDT 2011


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" ]

DISK = [
  type     = swap,
  size     = 1024,
  readonly = "no",
  target = "xvda1" ]

NIC=[network="private"]

HAIZEA = [ start = "+00:01:10",
        duration = "00:02:00",
        preemptible = "no" ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110412/a4fd6e83/attachment-0001.htm>


More information about the Users mailing list