Hi, On Fri, Jan 23, 2015 at 2:06 PM, Madko <madk...@gmail.com> wrote: > > > We'd like to have 4 VMs > > 1 VM with role "LVS", no problem here, using a lvs VM template > 3 VM with role "WEB", using a web VM template. I need to set explicitly > their hostnames, no digit allowed (let's say obfuscated-vm-name-a, > obfuscated-vm-name-b and obfuscated-vm-name-ab) > > how do I set each hostname in the service template? >
I think the best option is to have one role for each VM. My guess is that if we came up with a new generic syntax to define a vm_template_contents for each VM, it would probably be just as inconvenient as having one Role per VM. But for your specific case, maybe you can define a string with a list of hostnames, e.g. : "host_a,host_b,host_c" And then create a context script to coordinate which hostname has to be set for each instance. The onegate component [1] may be useful for this. Regards. [1] http://docs.opennebula.org/4.10/advanced_administration/application_flow_and_auto-scaling/appflow_use_cli.html#sharing-information-between-vms -- Carlos Martín, MSc Project Engineer OpenNebula - Flexible Enterprise Cloud Made Simple www.OpenNebula.org <http://www.opennebula.org/> | cmar...@opennebula.org | @OpenNebula <http://twitter.com/opennebula> On Fri, Jan 23, 2015 at 2:06 PM, Madko <madk...@gmail.com> wrote: > Sorry I don't think it fit our use case. > > We'd like to have 4 VMs > > 1 VM with role "LVS", no problem here, using a lvs VM template > 3 VM with role "WEB", using a web VM template. I need to set explicitly > their hostnames, no digit allowed (let's say obfuscated-vm-name-a, > obfuscated-vm-name-b and obfuscated-vm-name-ab) > > how do I set each hostname in the service template? > > Le Fri Jan 23 2015 at 12:11:07, Carlos Martín Sánchez < > cmar...@opennebula.org> a écrit : > > Hi there, >> >> On Thu, Jan 22, 2015 at 2:18 PM, Madko <madk...@gmail.com> wrote: >> >> How do you set hostname to VMs inside roles when you can't use numeric >>> hostname (ie hostname%i)? >> >> >> You can use the VM ID inside the context, the following works for me: >> "CONTEXT = [ HOSTNAME = TEST_$VMID ]" >> >> Or the VM name. This VM name can be changed the vm_name_template option >> in oneflow-server.conf [1]. >> "CONTEXT = [ HOSTNAME = $NAME ]" >> >> Does it fit your use case? >> >> Regards >> >> [1] >> http://docs.opennebula.org/4.10/advanced_administration/application_flow_and_auto-scaling/appflow_configure.html >> >> -- >> Carlos Martín, MSc >> Project Engineer >> OpenNebula - Flexible Enterprise Cloud Made Simple >> www.OpenNebula.org | cmar...@opennebula.org | @OpenNebula >> <http://twitter.com/opennebula> <cmar...@opennebula.org> >> >> On Thu, Jan 22, 2015 at 2:18 PM, Madko <madk...@gmail.com> wrote: >> >>> That's what we were doing untill now, service template with 10 or more >>> VM and therefor 10 or more roles (1:1 ratio) are not really convenient. But >>> thanks for your suggestion. Maybe I'm missing something. Is it possible to >>> change vm_template_contents to some sort of array? How do you set hostname >>> to VMs inside roles when you can't use numeric hostname (ie hostname%i)? >>> >>> best regards >>> >>> Le Thu Jan 22 2015 at 11:25:29, Carlos Martín Sánchez < >>> cmar...@opennebula.org> a écrit : >>> >>> Hi, >>>> >>>> On Wed, Jan 21, 2015 at 3:29 PM, Madko <madk...@gmail.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> is there a way to overload the vm_template_contents of only one >>>>> specific VM in a role? I'd like to fix the hostnames. >>>>> I only manage to overload the context of all the VMs in one role. >>>>> >>>>> best regards, >>>>> >>>> >>>> Maybe you can create a new role with the same template, and cardinality >>>> 1. >>>> Would that work for you? >>>> >>>> Regards >>>> -- >>>> Carlos Martín, MSc >>>> Project Engineer >>>> OpenNebula - Flexible Enterprise Cloud Made Simple >>>> www.OpenNebula.org <http://www.opennebula.org/> | >>>> cmar...@opennebula.org | @OpenNebula <http://twitter.com/opennebula> >>>> <cmar...@opennebula.org> >>>> >>>> >>>> >>
_______________________________________________ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org