[one-users] Contextualization VM during deployment

Tino Vazquez tinova at fdi.ucm.es
Fri Jul 2 10:13:24 PDT 2010


Hi Jeff,

Let's check what CONTEXT OpenNebula tries to use. Depending on how you
configured your hosts (NFS or SSH), this will be defined in

$ONE_LOCATION/etc/tm_ssh/tm_ssh.conf

$ONE_LOCATION/etc/tm_nfs/tm_nfs.conf

and they should point to

$ONE_LOCATION/lib/tm_commands/ssh

$ONE_LOCATION/lib/tm_commands/nfs

respectively.

Best,

-Tino


--
Constantino Vázquez Blanco | dsa-research.org/tinova
Virtualization Technology Engineer / Researcher
OpenNebula Toolkit | opennebula.org



On Thu, Jun 24, 2010 at 5:14 PM,  <igmph1 at gmail.com> wrote:
> 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
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



More information about the Users mailing list