[one-users] Contextualization VM during deployment

Martin Kopta martin at kopta.eu
Fri Jul 30 01:31:24 PDT 2010


Hi, I reply to a message with certain ID [1] sent in June [2] by 'igmph1' (Jeff)
about problem during deploying contextualized VMS.

Here is the original message [3] (114 lines)

> Hello,
>
> I have problem with customizing to the VM during deployment. I use
> CONTEXT variable.
>
> I need set the hostname and IP address for the each VM.
>
> The VM's template:
>
> -----------------------------------   Start Template
> --------------------------------
> #NAME   = ubuntu
> CPU    = 1
> MEMORY = 512
>
> OS      = [ BOOT   = hd ]
>
> DISK   = [
>   source   = "/storage/templates/ibob_ubuntu/disk2.qcow2",
>   target   = "sda",
>   readonly = "no" ]
>
> DISK   = [
>   source   = "/storage/templates/ibob_ubuntu/disk1.qcow2",
>   target   = "sdb",
>   readonly = "no" ]
>
>
> DISK = [
>         type   = swap,
>         size   = 2048,
>         target = sdb]
>
> CONTEXT = [
>   hostname  = "$NAME",
>   ip_public = "$NIC[IP, NETWORK=\"wan01\"]",
>   files     = "/storage/templates/vms_configuration/init.sh"
> ]
>
>
> NIC    = [ NETWORK="wan01"]
>
> GRAPHICS = [type="vnc",listen="0.0.0.0",port="-1"]
>
> INPUT    = [ type = "tablet" ]
> ---------------------------------------End Template
> ------------------------------------------------------------
>
> -------------------------------------- Error in oned.log
> --------------------------------------------------------
> Thu Jun 24 16:39:58 2010 [TM][D]: Message received: LOG - 72
> tm_mkswap.sh: Initializing swap space
>
> Thu Jun 24 16:39:58 2010 [TM][D]: Message received: LOG - 72
> tm_mkswap.sh: Executed "/sbin/mkswap /var/lib/one/72/images/disk.2".
>
> Thu Jun 24 16:39:58 2010 [TM][D]: Message received: LOG - 72
> tm_mkswap.sh: Executed "chmod a+w /var/lib/one/72/images/disk.2".
>
> Thu Jun 24 16:39:58 2010 [TM][D]: Message received: LOG - 72 COMMAND
> not found: CONTEXT /var/lib/one/72/context.sh
> /storage/templates/vms_configuration/init.sh
> hive001:/storage/vms/72/images/disk.3.
>
> Thu Jun 24 16:39:58 2010 [TM][D]: Message received: TRANSFER FAILURE
> 72 COMMAND not found: CONTEXT /var/lib/one/72/context.sh
> /storage/templates/vms_configuration/init.sh
> hive001:/storage/vms/72/images/disk.3.
>
> Thu Jun 24 16:39:59 2010 [TM][D]: Message received: LOG - 72
> tm_delete.sh: Deleting /var/lib/one/72/images
>
> Thu Jun 24 16:39:59 2010 [TM][D]: Message received: LOG - 72
> tm_delete.sh: Executed "rm -rf /var/lib/one/72/images".
>
>
> -------------------------------------- End
> --------------------------------------------------------------------------
>
> cat /var/lib/one/72/context.sh
>
> # Context variables generated by OpenNebula
> FILES="/storage/templates/vms_configuration/init.sh"
> HOSTNAME="one-72"
> IP_PUBLIC="10.10.10.3"
>
> ----------------------------------- end
> ----------------------------------------------------------------------------
>
>
> cat /storage/templates/vms_configuration/init.sh
>
> #!/bin/bash
>
> if [ -f /mnt/context.sh ]
>   . /mnt/context.sh
> fi
>
> hostname $HOSTNAME
> ifconfig eth0 $IP_PUBLIC
>
> ---------------------------------- end
> -----------------------------------------------------------------------------
> IP_PUBLIC is correct IP address.
>
> If anyone solved this problem, please send steps how to fix it.
>
> Regards,
> Jeff


Jeffs problem was caused by improper handling Opennebula instalation. Latests
stable of Opennebula distributed with Ubuntu Server 10.04 LTS used by Jeff at
time of described problem was (and is to this day [4]) Opennebula version 1.2.
This version doesn't have CONTEXT feature, so Jeff decided to remove Ubuntu
version of ONE. Then he downloaded binary package of ONE-1.4 for Ubuntu from
opennebula.org and installed it. After that, he was dealing with his problem
described above. The main problem was, that Jeff hadn't remove /etc/one during
the upgrade from 1.2 to 1.4. Since Opennebula stores some application login
within /etc/one directory, parts of ONE-1.2 and ONE-1.4 were mixed up, leading
to unknown command (CONTEXT) being sent from ONE core to handling scripts in
/etc/one.

Conclusion:

  * While upgrading, always backup and remove configuration and everything
    related to old instalation.
  * Application logic shouldn't be contained in /etc directory
  * It would be nice if Opennebula could check its own consistency


Best regards,
  Martin Kopta

[1] <AANLkTikyYKibXG8IiyzzsdrRyDvEwRSyVqAJ8SK-47u9 at mail.gmail.com>
[2] Thu, 24 Jun 2010 17:14:00 +0200
[3] http://lists.opennebula.org/pipermail/users-opennebula.org/2010-June/002245.html
[4] Fri, 30 Jul 2010 10:19:56 +0200
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20100730/900f004e/attachment-0003.pgp>


More information about the Users mailing list