← Back to team overview

openstack team mailing list archive

Re: Can I create a VM with 2 NICs while there is only one network?

 

I am afraid there is no way of having two NICs on the same network at the
moment.

If you are trying to deploy a VM which provides some form of network
service, like packet filtering, you might think about implementing it as a
quantum service plugin.
The 'agent' for this plugin would plug two tap interfaces connected to the
same network, and do the processing as you suggest.

Clearly, this is not very easy, as it would require you to implement a
plugin, possibly an API for it, as well as an agent which uses Quantum
library functions for plugging/unplugging interfaces.
The agent will also have the responsibility for starting/stopping the
service you're providing.

Salvatore


On 28 May 2013 07:34, Liu Wenmao <marvelliu@xxxxxxxxx> wrote:

> Thanks Salvatore
>
> I can create two ports with admin-state down, which are in the same
> network, but nova says that the two NICs of the VM can not be in the same
> network.
>
> Actually I want to redirect all the packets of the network to VM eth0,
> after some processes the VM sends the packets out to eth1, so the two NICs
> should be in the same network. Is it possible?
>
>
> root@node1:/usr/src/python-quantumclient# quantum port-create
> --admin-state-down net1
> Created a new port:
>
> +----------------------+-----------------------------------------------------------------------------------+
> | Field                | Value
>                                 |
>
> +----------------------+-----------------------------------------------------------------------------------+
> | admin_state_up       | False
>                                 |
> | binding:capabilities | {"port_filter": false}
>                                  |
> | binding:vif_type     | ovs
>                                 |
> | device_id            |
>                                 |
> | device_owner         |
>                                 |
> | fixed_ips            | {"subnet_id":
> "c11eaa0d-3aff-41a8-909a-1dfdfdf20f48", "ip_address": "100.0.0.12"} |
> | id                   | ca48bce7-7e42-4263-8832-cffb6e99ac0a
>                                  |
> | mac_address          | fa:16:3e:0e:08:e1
>                                 |
> | name                 |
>                                 |
> | network_id           | 17d31ea4-4473-4da0-9493-9a04fa5aff33
>                                  |
> | status               | DOWN
>                                  |
> | tenant_id            | 53707d290204404dbff625378969c25c
>                                  |
>
> +----------------------+-----------------------------------------------------------------------------------+
> root@node1:/usr/src/python-quantumclient# quantum port-create
> --admin-state-down net1
> Created a new port:
>
> +----------------------+-----------------------------------------------------------------------------------+
> | Field                | Value
>                                 |
>
> +----------------------+-----------------------------------------------------------------------------------+
> | admin_state_up       | False
>                                 |
> | binding:capabilities | {"port_filter": false}
>                                  |
> | binding:vif_type     | ovs
>                                 |
> | device_id            |
>                                 |
> | device_owner         |
>                                 |
> | fixed_ips            | {"subnet_id":
> "c11eaa0d-3aff-41a8-909a-1dfdfdf20f48", "ip_address": "100.0.0.13"} |
> | id                   | 8a320aae-4a16-4a78-acba-1ec505cfe914
>                                  |
> | mac_address          | fa:16:3e:db:c5:15
>                                 |
> | name                 |
>                                 |
> | network_id           | 17d31ea4-4473-4da0-9493-9a04fa5aff33
>                                  |
> | status               | DOWN
>                                  |
> | tenant_id            | 53707d290204404dbff625378969c25c
>                                  |
>
> +----------------------+-----------------------------------------------------------------------------------+
>
> root@node1:/usr/src/python-quantumclient# nova boot --image cirros
> --flavor m1.tiny --nic port-id=ca48bce7-7e42-4263-8832-cffb6e99ac0a --nic
> port-id=8a320aae-4a16-4a78-acba-1ec505cfe914  testips
> ERROR: The server has either erred or is incapable of performing the
> requested operation. (HTTP 500) (Request-ID:
> req-ac85648c-4e9b-4624-bf88-a6ceeb8e79aa)
>
> nova-api.log:
> 3028 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack   File
> "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
> 3029 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack
> self.gen.next()
> 3030 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack   File
> "/usr/local/lib/python2.7/dist-packages/nova-2013.1-py2.7.egg/nova/compute/api.py",
> line 522, in _validate_and_provision_instance
> 3031 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack
> self._check_requested_networks(context, requested_networks)
> 3032 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack   File
> "/usr/local/lib/python2.7/dist-packages/nova-2013.1-py2.7.egg/nova/compute/api.py",
> line 358, in _check_requested_networks
> 3033 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack
> self.network_api.validate_networks(context, requested_networks)
> 3034 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack   File
> "/usr/local/lib/python2.7/dist-packages/nova-2013.1-py2.7.egg/nova/network/quantumv2/api.py",
> line 454, in validate_networks
> 3035 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack     raise
> exception.NetworkDuplicated(network_id=net_id)
> 3036 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack
> NetworkDuplicated: Network 17d31ea4-4473-4da0-9493-9a04fa5aff33 is
> duplicated.
> 3037 2013-05-28 11:50:06.007 3232 TRACE nova.api.openstack
>
>
> On Sat, May 25, 2013 at 5:33 AM, Salvatore Orlando <sorlando@xxxxxxxxxx>wrote:
>
>> Nova does not have an option for creating 'unbound NICs', which would be
>> tantamount to unplugged network cards, if this is what you want to achieve.
>>
>> Using Quantum you can create a few ports on some network, set these ports
>> administratively down, and boot the VM with this ports (--nic port-id).
>> Even if Quantum does not allow you to move these ports to another network
>> perhaps it might still satisfy your requirements.
>>
>> Salvatore
>>
>>
>>
>> On 24 May 2013 04:23, Istimsak Abdulbasir <saqman2060@xxxxxxxxx> wrote:
>>
>>> Are you saying the the VM sees two virtual NICs or two physical NICs?
>>>
>>> Istimsak Abdulbasir
>>>
>>> "change is good"
>>>
>>>
>>> On Thu, May 23, 2013 at 11:18 PM, Liu Wenmao <marvelliu@xxxxxxxxx>wrote:
>>>
>>>> Hello:
>>>>
>>>> I have a network with a subnet, I want create a VM with one NIC
>>>> connected with this subnet, with one or two extra NIC left, because I want
>>>> to do some more things such as intrusion protection
>>>>
>>>> I wonder is it possible to create a VM with more NICs than its
>>>> connected network?
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~openstack
>>>> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~openstack
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~openstack
>>> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~openstack
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>

Follow ups

References