[one-users] How to configure virtual networks in OpenNebula 4.0

Jon three18ti at gmail.com
Sat Apr 27 16:08:13 PDT 2013


Ok,  I think I figured it out.  Seems that ttylinux doesn't support
contextualization because Ubuntu spun up just fine with the network
contextualized.

I definitely needed a new template, because my original Ubuntu template
does not include the network auto contextualization settings.



On Sat, Apr 27, 2013 at 4:39 PM, Jon <three18ti at gmail.com> wrote:

> Ok, I created a new template and it injected the network context settings.
>
>
>  ETH0_DNS $NETWORK[DNS,NETWORK_ID="0"] ETH0_GATEWAY$NETWORK[GATEWAY,NETWORK_ID="0"]ETH0_IP$NIC[IP,NETWORK_ID="0"]ETH0_MASK$NETWORK[NETWORK_MASK,NETWORK_ID="0"]ETH0_NETWORK$NETWORK[NETWORK_ADDRESS,NETWORK_ID="0"]SSH_PUBLIC_KEY$USER[SSH_PUBLIC_KEY]
>
> Apparently, I was using a template I created before upgrading to the 4.0RC.
>
> However, I am still unable to properly set the NETWORK_MASK and GATEWAY.
> In my virtual network template I have
>
> NETWORK_MASK="255.255.255.240"
>
> do I need to set the "NETWORK_MASK" variable differently?
>
> Thanks,
> Jon A
>
>
> On Sat, Apr 27, 2013 at 3:10 PM, Jon <three18ti at gmail.com> wrote:
>
>> Hello All,
>>
>> Can you please provide some guidance as to what I'm doing wrong.
>>
>> I've added both,  "ETH0_GATEWAY / ETH0_NETMASK" and "NETWORK_ADDRESS /
>> NETWORK_MASK" custom attributes to my virtual network configuration as
>> outlined in the docs I was pointed to:
>> http://opennebula.org/documentation:rel4.0:cong
>>
>> However, the VM still comes up with a gateway of .1 and netmask of
>> 255.255.255.0
>>
>> Also, these attributes are not reflected in the running VMs templage:
>>
>> CPU="0.5"
>> GRAPHICS=[
>>   LISTEN="0.0.0.0",
>>   PORT="5953",
>>   TYPE="VNC" ]
>> MEMORY="1024"
>> NAME="one-53"
>> TEMPLATE_ID="4"
>> VCPU="2"
>> VMID="53"
>>
>>
>> So I'm thinking there's something wrong with my network configuration
>> because the correct network information is not being passed from the
>> virtual network config to the VM config.
>>
>> Can someone point me in the correct direction please?
>>
>> Thanks,
>> Jon A
>>
>>
>> On Mon, Apr 22, 2013 at 12:53 PM, Ruben S. Montero <
>> rsmontero at opennebula.org> wrote:
>>
>>> Hi Jon
>>>
>>> You may also be interested in using a virtual router. OpenNebula
>>> includes a VR appliance that can be easily feed with the virtual networks
>>> information through context. This will set up a DHCP server (among other
>>> things) to configure the NICs that way....
>>>
>>> http://opennebula.org/documentation:rel4.0:router
>>>
>>> Cheers
>>>
>>>  Ruben
>>>
>>>
>>>
>>> On Mon, Apr 22, 2013 at 6:14 PM, Javier Fontan <jfontan at opennebula.org>wrote:
>>>
>>>> The contextualization cdrom is created on VM deployment so I fear you
>>>> will have to configure the network interface manually.
>>>>
>>>> On Mon, Apr 22, 2013 at 4:00 PM, Jon <three18ti at gmail.com> wrote:
>>>> > Hello Javier,
>>>> >
>>>> > I see, so the network configuration is handled by VM
>>>> contextualization not
>>>> > the virtual network config. Got it.  Thanks for the links to the docs.
>>>> >
>>>> > How does that affect hot plug networking? E.g. is the new nic manually
>>>> > configured by the VM user, or can a running VM be contextualized?
>>>> >
>>>> > Thanks Again, everyone has been so helpful. I really appreciate it.
>>>> > Jon A
>>>> >
>>>> > On Apr 22, 2013 5:21 AM, "Javier Fontan" <jfontan at opennebula.org>
>>>> wrote:
>>>> >>
>>>> >> I forgot to mention that you can also use the CLI to add the network
>>>> >> contextualization. When creating the template using parameters add
>>>> >> "--net_context", for example:
>>>> >>
>>>> >> $ onetemplate create --name "some name" --cpu 1 --memory 512 --disk
>>>> >> centos --nic public --net_context --ssh ssh_keys/test.pub
>>>> >>
>>>> >> http://opennebula.org/doc/4.0/cli/onetemplate.1.html
>>>> >>
>>>> >> On Mon, Apr 22, 2013 at 1:14 PM, Javier Fontan <
>>>> jfontan at opennebula.org>
>>>> >> wrote:
>>>> >> > It seems that you have the context packages installed in the VM but
>>>> >> > you are not adding contextualization variables to the VM. When
>>>> there
>>>> >> > are no contextualization parameters the context packages will
>>>> fallback
>>>> >> > to default values. For example, the netmask will be /24.
>>>> >> >
>>>> >> > You can get more information on how to do that manually in the
>>>> context
>>>> >> > doc [1]. From Sunstone you can also check the network
>>>> >> > contextualization checkbox when creating the template, that option
>>>> >> > will add the variables needed to the template.
>>>> >> >
>>>> >> > [1] http://opennebula.org/documentation:rel4.0:context_overview
>>>> >> >
>>>> >> > On Sun, Apr 21, 2013 at 8:41 PM, Jon <three18ti at gmail.com> wrote:
>>>> >> >> Hello All,
>>>> >> >>
>>>> >> >> First the great news, it seems that the OpenVSwitch bug has been
>>>> >> >> resolved:
>>>> >> >>
>>>> >> >>>> Sun Apr 21 11:49:37 2013 [VMM][I]: post: Executed "sudo
>>>> >> >>>> /usr/bin/ovs-ofctl add-flow ovsbr0
>>>> >> >>>>
>>>> in_port=24,dl_src=02:00:44:47:83:46,priority=40000,actions=normal".
>>>> >> >>>> Sun Apr 21 11:49:37 2013 [VMM][I]: post: Executed "sudo
>>>> >> >>>> /usr/bin/ovs-ofctl add-flow ovsbr0
>>>> >> >>>> in_port=24,priority=39000,actions=drop".
>>>> >> >>
>>>> >> >> This is awesome, as virtual machines deploy correctly now; I'm
>>>> one step
>>>> >> >> closer to getting a running OpenNebula deployment.
>>>> >> >>
>>>> >> >> However, it seems that OpenNebula is not configuring the network
>>>> quite
>>>> >> >> right, I've assigned a /28 to my OpenNebula server, 8.8.8.65/28,
>>>> and
>>>> >> >> when I
>>>> >> >> assign an IP to a VM, the VM configures the network as a /24
>>>> >> >>
>>>> >> >> eth0      Link encap:Ethernet  HWaddr 02:00:44:47:83:46
>>>> >> >>           inet addr:8.8.8.8.70  Bcast:8.8.8.8.255
>>>>  Mask:255.255.255.0
>>>> >> >>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>>> >> >>           RX packets:6358 errors:0 dropped:0 overruns:0 frame:0
>>>> >> >>           TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
>>>> >> >>           collisions:0 txqueuelen:1000
>>>> >> >>           RX bytes:385057 (376.0 KiB)  TX bytes:6403 (6.2 KiB)
>>>> >> >>           Interrupt:11 Base address:0xc000
>>>> >> >>
>>>> >> >> So my question is, how do I configure the network so it uses the
>>>> >> >> correct
>>>> >> >> subnet?
>>>> >> >>
>>>> >> >> I've configured everything so far directly via SunStone.
>>>> >> >>
>>>> >> >> Here's my VM template:
>>>> >> >>
>>>> >> >>>> oneadmin at loki:~$ onetemplate show template-4
>>>> >> >>>> TEMPLATE 4 INFORMATION
>>>> >> >>>> ID             : 4
>>>> >> >>>> NAME           : template-4
>>>> >> >>>> USER           : oneadmin
>>>> >> >>>> GROUP          : oneadmin
>>>> >> >>>> REGISTER TIME  : 03/28 02:04:14
>>>> >> >>>>
>>>> >> >>>> PERMISSIONS
>>>> >> >>>> OWNER          : um-
>>>> >> >>>> GROUP          : ---
>>>> >> >>>> OTHER          : ---
>>>> >> >>>>
>>>> >> >>>> TEMPLATE CONTENTS
>>>> >> >>>> CPU="0.5"
>>>> >> >>>> DISK=[
>>>> >> >>>>   IMAGE_ID="4" ]
>>>> >> >>>> GRAPHICS=[
>>>> >> >>>>   LISTEN="0.0.0.0",
>>>> >> >>>>   TYPE="VNC" ]
>>>> >> >>>> MEMORY="1024"
>>>> >> >>>> NIC=[
>>>> >> >>>>   NETWORK_ID="0" ]
>>>> >> >>>> REQUIREMENTS="ID=\"0\""
>>>> >> >>>> UNDEFINED="2.00"
>>>> >> >>>> VCPU="2"
>>>> >> >>
>>>> >> >> _______________________________________________
>>>> >> >> Users mailing list
>>>> >> >> Users at lists.opennebula.org
>>>> >> >> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>>> >> >>
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > --
>>>> >> > Javier Fontán Muiños
>>>> >> > Project Engineer
>>>> >> > OpenNebula - The Open Source Toolkit for Data Center Virtualization
>>>> >> > www.OpenNebula.org | jfontan at opennebula.org | @OpenNebula
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> Javier Fontán Muiños
>>>> >> Project Engineer
>>>> >> OpenNebula - The Open Source Toolkit for Data Center Virtualization
>>>> >> www.OpenNebula.org | jfontan at opennebula.org | @OpenNebula
>>>>
>>>>
>>>>
>>>> --
>>>> Javier Fontán Muiños
>>>> Project Engineer
>>>> OpenNebula - The Open Source Toolkit for Data Center Virtualization
>>>> www.OpenNebula.org | jfontan at opennebula.org | @OpenNebula
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opennebula.org
>>>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>>>
>>>
>>>
>>>
>>> --
>>> Ruben S. Montero, PhD
>>> Project co-Lead and Chief Architect
>>> OpenNebula - The Open Source Solution for Data Center Virtualization
>>> www.OpenNebula.org | rsmontero at opennebula.org | @OpenNebula
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20130427/3fc8fe0a/attachment-0002.htm>


More information about the Users mailing list