[one-users] network problem with VMWare ESXi

Tino Vazquez tinova at fdi.ucm.es
Thu Sep 17 07:01:27 PDT 2009


Hi Shi Jin,

Thanks again for the feedback. You are rigth, The code should work even without
the NIC line in the VM template. This was actually a bug, I appreciate
you spotted it. I've already commit the changes in the svn trunk.

The way the network support works in OpenNebula regarding VMware is as follows:

* No NIC line present in OpenNebula VM template: Network section of
the VM is left untouched, that is, the network configuration done
through the VIC is not touched so you can count on whatever
configuration you've build the VM with.

* NIC present in OpenNebula VM template: All the previously defind
network configuration done with the VIC is erased. Instead, for each
NIC line a virtual network interface is added to the VM, and the MAC
address is set. OpenNebula uses a MAC to IP correspondence so you can
set the IP in the VM based on whatever MAC the hypervisor attaches to
the virtual network interface (see [1] for details & more info on how
the virtual networks in OpenNebula assign MAC addresses to NICs).

It is important to configure the ESX(i) hypervisors with a virtual switch:

--->8----
Also, a Virtual Machine port group defined within a Virtual Switch
attached to a physical device needs to be configured using the VIC
(Configuration tab, Networking link in the left panel, Add Networking
in the top right). Its name has to match the BRIDGE name of the
OpenNebula Virtual Network defined to provide configuration to the
VMs. More information about Virtual Networks in OpenNebula here
--8<-----

This may be poorly explained in the configuration. What you need to do
is create a Virtual Switch called, for instance, "one-net" in the
ESX(i). You can create more than one in each host. To determine to
which virtual switch (attached to a physical network interface in the
host running the hypervisor) VMs' virtual network interfaces will be
attached, OpenNebula uses the BRIDGE field of the OpenNebula Virtual
Network template. So, if you have a Virtual Switch called "one-net",
and you want your VM to have a NIC with MAC adress
"XX:XX:XX:XX:XX:XX", you can

   1) Create a Virtua Network in OpenNebula name "myNW" with
BRIDGE="one-net", and network address XX.XX.XX.XX
   2) Add to the VM template a NIC line like

NIC=[NETWORK="myNW", MAC="XX:XX:XX:XX:XX:XX"]

And that should do the trick.

Hope it helps,

-T

[1] http://opennebula.org/doku.php?id=documentation:rel1.4:vgg

--
Constantino Vázquez, Grid Technology Engineer/Researcher:
http://www.dsa-research.org/tinova
DSA Research Group: http://dsa-research.org
Globus GridWay Metascheduler: http://www.GridWay.org
OpenNebula Virtual Infrastructure Engine: http://www.OpenNebula.org



On Thu, Sep 17, 2009 at 12:33 AM, Shi Jin <jinzishuai at gmail.com> wrote:
> Hi there,
>
> I have finally been able to deploy VMs from Open Nebula to ESX 3.5.
> One problem I had is on network setup. I am not sure what to put in
> the template about NIC.
> Do you have any suggestions?
>
> I decided to go without network, just to see if the VM can be
> deployed. So there is nothing about NIC in the template file at all.
> Then I got the following error using open nebula by doing some manual debugging:
> oneadmin at esx-one vmware $ ./one_vmm_vmware --username root --password <pass>
> INIT
> INIT SUCCESS
> DEPLOY 6 node2.intranet.vrstorm.com /srv/cloud/one/var/6/deployment.0 -
> java.lang.NullPointerException
>    at DeployVM.configureNetwork(DeployVM.java:256)
>    at DeployVM.shapeVM(DeployVM.java:220)
>    at OneVmmVmware.loop(OneVmmVmware.java:161)
>    at OneVmmVmware.main(OneVmmVmware.java:55)
> DEPLOY FAILURE 6 Failed deploying VM in host node2.intranet.vrstorm.com.
>
> I found the problem in DeployVM.java
> String[][] nics                  = pXML.getNet();
> Basically when there is nothing about NIC, the nics object is null and
> the following statement would fail
> if(nics.length==1 && nics[0].equals("")) return;
>
> Therefore, I add a line ahead of it
> if(nics==null) return;
>
> With this fix, I was able to deploy my VMs.
>
> How do you think of this bug fix? The code should work even without
> the NIC line at all, right?
> But I am more interested in learning how to set up the NIC in the
> template for ESXi.
> Thank you very much.
> --
> Shi Jin, Ph.D.
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>


More information about the Users mailing list