Can openstack instance have multiple interface network cards? - openstack

I want to create an instance in openstack with multiple Network interface card
I always has only one interface for SSH or other things
I need more interface to use dpdk.
So my question is that can OpenStack instance have multiple interface, and how to make instance with multiple interface using linux cli?

Definitely yes.
There is two methods to achieve this at least:
1, create instance with multiple interfaces by specify option argument --nic multiple times, check the snip help message:
# openstack server create -h
usage: openstack server create (--image <image> | --volume <volume>)
--flavor <flavor>
[--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid>]
<server-name>
Create a new server
positional arguments:
<server-name> New server name
optional arguments:
--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid>
Create a NIC on the server. Specify option multiple
times to create multiple NICs. Either net-id or port-
id must be provided, but not both. net-id: attach NIC
to network with this UUID, port-id: attach NIC to port
with this UUID.
2, add another interface to an instance with server add port or other command like this: "latest/cli/command-objects/server.html", such as:
openstack server add port
openstack server add network
One more thing, it also could create instance with multiple interfaces by nova-API request, the network parameter is array type, and it could define your requirement, check from "create-server-detail".

Related

Starting OpenStack instances programmatically

I am using OpenStack4J to interact with OpenStack. My goal at this point is simply to launch an instance. I can do this manually using my tenant: rosemend. And when I do this, I have a network called rosemond (Id: a9b097b3-af47-4222-b98e-f1b631f9ec45) that I select and make the instance part of.
However, using OpenStack4J, I am not able to make any progress. OpenStack4j requires a network port that I don't seem to be able to figure out how to set.
The call to set this network port would look like:
serverCreateBuilder.addNetworkPort("0a44eedc-8298-4544-87d7-094c7b34708e")
First I tried the Id of the rosemond network itself (a9b097b3-af47-4222-b98e-f1b631f9ec45). The error message in this case is:
Port id a9b097b3-af47-4222-b98e-f1b631f9ec45 could not be found.
Next, within OpenStack, when I click on the rosemond network, I see a list of 5 items called ports. I then tried using each of them resulting each in error message:
Port 0a44eedc-8298-4544-87d7-094c7b34708e is still in use.
And when I do not pass a network port at all, I get the error:
It is not allowed to create an interface on external network c6fb539b-2013-405c-903a-4700a00d954b
My question is what is the value I should use here?
I will recommend you to go with JClouds instead. In my opinion is easier to use and the documentation is better.
See my answer in Openstack cloud (identity service, nova service and swift service) vs Java application. There is some sample code in GitHub that you can check.
1) To create a vm with an existing port, port id is required.
2) The port you use to boot the vm instance must be in DOWN status (Detached). If the port is attached to an instance (active), Openstack will report conflict. For Openstack4j, it throws a ClientResponseException exception with a message: port xxxis still in use.
See https://developer.openstack.org/api-ref/compute/?expanded=create-server-detail

How can I force JMeter slaves to use a specific network interface?

My computer has 2 network interfaces which are connected in 2 different networks and when I start the JMeter slave the wrong network interface is automatically chosen.
You can force network interface to use for both client and server sides of things by setting the following property:
java.rmi.server.hostname=169.168.167.166
It can also be passed as a command-line argument to JMeter startup script being prefixed by -D as
jmeter -Djava.rmi.server.hostname=169.168.167.166
References:
Remote(Distributed) Testing Guide
Apache JMeter Properties Customization Guide

Can the Docker driver on OpenStack coexist with libvirt.LibvirtDriver?

The following documentation link indicates that the docker driver needs to be configured on all compute nodes
from
compute_driver= libvirt.LibvirtDriber
to
compute_driver=docker.DockerDriver
Does this means there will not be an option to select the instantiation of a normal VM ? Will the horizon UI allow to select which type of virtualization ( docker vs kvm ) to be selected ?
In openstack you cannot have hybrid compute drivers unless they are separated by AZs. So it's either one or the other.
Of course the hackish work around would be to spin up an openstack compute instance inside of the docker / lxc environment and join it to a new az as a libvirt node....
a bit of inception there though, and it makes your scheduler basically worthless.
With the basic OpenStack you can't, but you can write and add a filter which makes it possible... Just write a class with a host_passes method and add your new filter to nova scheduler filters.
I did it and it works.

Erlang: starting a remote node programmatically

I am aware that nodes can be started from the shell. What I am looking for is a way to start a remote node from within a module. I have searched, but have been able to find nothing.
Any help is appreciated.
There's a pool(3) facility:
pool can be used to run a set of
Erlang nodes as a pool of
computational processors. It is
organized as a master and a set of
slave nodes..
pool:start/1,2 starts a new pool.
The file .hosts.erlang is read to
find host names where the pool nodes
can be started. The slave nodes are
started with slave:start/2,3,
passing along Name and, if provided,
Args. Name is used as the first
part of the node names, Args is used
to specify command line arguments.
With pool you get load distribution facility for free.
Master node may be started this way:
erl -sname poolmaster -rsh ssh
Key -rsh here specifies an alternative to rsh for starting a slave node on a remote host. We used SSH here. Make sure your box have working SSH keys, and you can authenticate to the remote hosts using these keys.
If there are no hosts in the file .hosts.erlang, then no slave nodes are started, and you can use slave:start/2,3 to start slave nodes manually passing arguments if needed.
You could, for example start a remote node:
Arg = "-mnesia_dir " ++ M,
slave:start(H, Name, Arg).
Ensure epmd(1) is up and running on the remote boxes in order to start Erlang nodes.
Hope that helps.
A bit more low level that pool is the slave(3) module. Pool builds upon the functionality in slave.
Use slave:start to start a new slave.
You should probably also specify -rsh ssh on the command-line.
So use pool if you need the kind of functionality it offers, if you need something different you can build it yourself out of slave.

Is there any way of an app in Linux have access to 2 network cards?

My app needs to access two network cards. One to receive data (eth0) and another to send data (3G modem).
Normally, the kernel force the app to work with only one card at a time.
Is there any thing that I can do to make it run?
Thank you.
The kernel does no such thing.
The kernel will route your traffic to the most appropriate end destination based upon the routing information and networks each card is assigned. However, if you are using TCP, your bidirectional communication will use only one route as there is only one address associated with that connection.
If you are trying to implement an multi-homing send/receive system, this is not supported in normal TCP - you will need to use a different protocol, likely implemented in the kernel.
The kernel is not forcing you to use a single interface. It just chooses a default interface if you don't specify otherwise. You can specify a specific interface by specifying it's IP address in the bind() command. To get a list of the available interfaces and their names, use the ioctl(SIOCGIFCONF) function.
Here's an example: http://techpulp.com/2008/10/get-list-of-interfaces-using-siocgifconf-ioctl/
You can make two different UDP sockets bind to separate NICs with the bind(2) and send on one and listen on the other.

Resources