Hi Rolandas,

I'd say that your better option is to move those commands to the init.sh
script. Just put in the CONTEXT all the variables you may need, I'm
guessing that would be $NIC[IP,NETWORK=\"NET-NAME\"]. These variables will
be written by OpenNebula in the context.sh file, which you can "source"
from init.sh

More information in [1].

Regards

[1] http://opennebula.org/documentation:rel3.2:cong
--
Carlos Martín, MSc
Project Engineer
OpenNebula - The Open Source Toolkit for Data Center Virtualization
www.OpenNebula.org | cmar...@opennebula.org |
@OpenNebula<http://twitter.com/opennebula><cmar...@opennebula.org>


On Mon, Jan 30, 2012 at 8:22 PM, Rolandas Naujikas <
rolandas.nauji...@mif.vu.lt> wrote:

> Hi,
>
> I just did upgrade to 3.2.1 and it didn't solve my problem.
> I'm getting:
>
> oneadmin@cloud00:~$ onetemplate instantiate sunray-xen
> [TemplateInstantiate] Error allocating a new virtual machine.
>
> Finally I found the cause. I want to have HOSTNAME="vm\$((echo
> $NIC[IP,NETWORK=\"NET-NAME\"]|cut -d. -f4) - 35))" in CONTEXT. It is
> accepted as valid template, but fails to start (in very strange ways).
> With that I want to solve problem with setting hostname depending on IP.
> There are no way to use DNS or other ways to do that. I tried in VM, but
> it is not reliable ("getent hosts $IP" returns nothing when network is
> not ready yet).
>
> Regards, Rolandas
>
> P.S. I'm trying to use opennebula to manage production services VM, with
> fixed IP<=>HOSTNAME (with pools also).
>
> On 2012-01-30 19:42, Rolandas Naujikas wrote:
> > Hi,
> >
> > It worked but now it doesn't work anymore.
> > I cannot create any VM from templates with network from virtual
> > networks. Those virtual networks have unused leases.
> >
> > For example sunray-xen template with "NIC=[ NETWORK=SUNRAY ]" and
> > onevnet show SUNRAY as
> >
> > VIRTUAL NETWORK 7 INFORMATION
> >
> > ID             : 7
> > NAME           : SUNRAY
> > USER           : rolnas
> > GROUP          : oneadmin
> > TYPE           : RANGED
> > BRIDGE         : br428
> > VLAN           : No
> > PHYSICAL DEVICE:
> > VLAN ID        :
> > USED LEASES    : 0
> >
> > PERMISSIONS
> >
> > OWNER          : um-
> > GROUP          : ---
> > OTHER          : ---
> >
> > VIRTUAL NETWORK TEMPLATE
> >
> > NETWORK_MASK=255.255.0.0
> >
> > RANGE
> >
> > IP_START       : 192.168.42.36
> > IP_END         : 192.168.42.40
> >
> > And now onetemplate instantiate sunray-xen shows only:
> > [TemplateInstantiate] Error allocating a new virtual machine. Could not
> > get virtual network for VM.
> >
> > Regards, Rolandas
> >
> > P.S. The version is OpenNebula 3.2.0
> > P.S. When I put references to images and network by ID (not name): Error
> > allocating a new virtual machine (nothing specific).
>
> _______________________________________________
> Users mailing list
> Users@lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
_______________________________________________
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Reply via email to