I wanted to get additional feedback on an issue I'm evaluating with the
new networking and compute drivers for OpenNebula.

Here's my use case:
# Instantiate my device drivers for OpenNebula's networking driver and
compute driver:
>>> networkingDriver = networking_driver(...)
>>> computeDriver = compute_driver(...)

# Using the networking driver, I retrieve a list of all virtual networks
of type "Network".
>>> networks = networkingDriver.list_networks()
>>> print networks
[<Network: uuid=19660bbb66a279f917ee5b92c4962985cca0dc02,
name=E3DyXFiK8EHMDegesggP, address=192.168.0.0, size=255,
provider=OpenNebula ...>, <Network:
uuid=54847612954790d8e81c4ce0a64cf20432aecaca,
name=ULbvTFaHfqgjH1SO0pD9, address=192.168.0.0, size=255,
provider=OpenNebula ...>]

# Next, I want to create a node that attaches to the first network in
the list.
>>> size = computeDriver.list_sizes()[0]
>>> image = computeDriver.list_images()[0]
>>> node = computeDriver.create_node(name='Test', size=size,
image=image, networks=[networks[0]])
>>> print node
<Node: uuid=dabc7a05589e52d7d6e2e10c906422f4db200464, name=Test,
state=3, public_ips=[<NodeNetwork:
uuid=19660bbb66a279f917ee5b92c4962985cca0dc02,
name=E3DyXFiK8EHMDegesggP, address=192.168.0.0, size=1,
provider=OpenNebula ...>], provider=OpenNebula ...>

The second portion of the code shows existing networks within my cloud
infrastructure. Those networks were created using the
networkingDriver.create_network() function during earlier tests.

Each network has a unique name, subnet (The address property.), and
netmask (The size property.).

The OpenNebula compute driver has been extended to take a list of
networks and generate appropriate XML required to attach compute nodes
to networks. This allows me to use either the
networkingDriver.list_networks() or computeDriver.ex_list_networks()
function to retrieve a list of networks and then attach the compute node
to those networks.

The problem I'm encountering relates to a feature of OpenNebula which
allows users to specify the IP address of the compute node within the IP
range of the virtual network. The create_node() function achieves this
by reading the network.address property of the network, and assumes that
this value is the requested IP address for the node. This extraction of
IP address is done over all networks in the networks list.

This behavior will work for the first node attached to the network, but
fails after that. Furthermore, compute nodes should attempt to
automatically use the subnet address when attaching to the network.

What I wanted to know was, how to allow users to retrieve a list of
available networks and attach compute nodes to those network in the same
manner as attaching an image to a node.

One approach to prevent assignment of an IP address automatically is to
either null out the address property, or manually assign an IP address:
>>> network = networks[0]
>>> network.address = None
>>> node = computeDriver.create_node(name='Dumb', size=size,
image=image, networks=[network])
OR
>>> network = networks[0]
>>> network.address = <ANY VALID, UN-USED IP ADDRESS>
>>> node = computeDriver.create_node(name='Dumb', size=size,
image=image, networks=[network])

However, this approach requires manual intervention by the user. It
should only require user intervention when the user's specifically
desires an manually assigned IP address.

Therefore, I was thinking that computeDriver.ex_list_networks() could
return networks with their address and size properties set to None,
while leaving the networkingDriver.list_networks() with it's current
behavior.

Thoughts?

-- 
Hutson Betts
Computer Science and Engineering
Texas A&M University

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to