[openstack-dev] [QA] How to attach multiple NICs to an instance VM?

2014-10-15 Thread Danny Choi (dannchoi)
Hi,

“nova help boot” shows the following:


  --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. net-

id: attach NIC to network with this UUID

(either port-id or net-id must be provided),

v4-fixed-ip: IPv4 fixed address for NIC

(optional), v6-fixed-ip: IPv6 fixed address

for NIC (optional), port-id: attach NIC to

port with this UUID (either port-id or net-id

must be provided).


NOTE:  Specify option multiple times to create multiple NICs. 


I have two private networks and one public network (for floating IPs) 
configured.


localadmin@qa4:~/devstack$ nova net-list

+--+---+--+

| ID   | Label | CIDR |

+--+---+--+

| 6905cf7d-74d7-455b-b9d0-8cea972ec522 | private   | None |

| 8c25e33b-47be-47eb-a945-e0ac2ad6756a | Private_net20 | None |

| faa138e6-4774-41ad-8b5f-9795788eca43 | public| None |

+--+---+--+

When I launch an instance, I specify the “—nic” option twice.


localadmin@qa4:~/devstack$ nova boot --image cirros-0.3.2-x86_64-uec --flavor 1 
--nic net-id=6905cf7d-74d7-455b-b9d0-8cea972ec522 --nic 
net-id=8c25e33b-47be-47eb-a945-e0ac2ad6756a vm10


And then I associate a floating IP to the instance.


localadmin@qa4:~/devstack$ nova list

+--+--+++-+--+

| ID   | Name | Status | Task State | Power 
State | Networks |

+--+--+++-+--+

| e6a13d2e-756b-4b96-bf0c-438c2c875675 | vm10 | ACTIVE | -  | Running   
  | Private_net20=20.0.0.10; private=10.0.0.7, 172.29.173.13 |


localadmin@qa4:~/devstack$ nova show vm10

+--++

| Property | Value  
|

+--++

| OS-DCF:diskConfig| MANUAL 
|

| OS-EXT-AZ:availability_zone  | nova   
|

| OS-EXT-STS:power_state   | 1  
|

| OS-EXT-STS:task_state| -  
|

| OS-EXT-STS:vm_state  | active 
|

| OS-SRV-USG:launched_at   | 2014-10-15T20:22:50.00 
|

| OS-SRV-USG:terminated_at | -  
|

| Private_net20 network| 20.0.0.10  
|

| accessIPv4   |
|

| accessIPv6   |
|

| config_drive |
|

| created  | 2014-10-15T20:21:54Z   
|

| flavor   | m1.tiny (1)
|

| hostId   | 
4660a679d319992f764bcb245b71048212fe8cd67b769400d82382b7   |

| id   | e6a13d2e-756b-4b96-bf0c-438c2c875675   
|

| image| cirros-0.3.2-x86_64-uec 
(feaec710-c1cc-4071-aefa-c3dc2b915ab1) |

| key_name | -  
|

| metadata | {} 
|

| name | vm10   
|

| os-extended-volumes:volumes_attached | [] 
|

| private network  | 10.0.0.7, 172.29.173.13
|

| 

Re: [openstack-dev] [QA] How to attach multiple NICs to an instance VM?

2014-10-15 Thread Salvatore Orlando
I think you did everything right.

Are you sure cirros images by default are configured to boostrap interfaces
different from eth0?
Perhaps all you need to do is just ifup the interface... have you already
tried that?

Salvatore

On 15 October 2014 23:07, Danny Choi (dannchoi) dannc...@cisco.com wrote:

  Hi,

  “nova help boot” shows the following:

--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.
 net-

 id: attach NIC to network with this UUID

 (either port-id or net-id must be
 provided),

 v4-fixed-ip: IPv4 fixed address for NIC

 (optional), v6-fixed-ip: IPv6 fixed address

 for NIC (optional), port-id: attach NIC to

 port with this UUID (either port-id or
 net-id

 must be provided).


  NOTE:  Specify option multiple times to create multiple NICs. 


  I have two private networks and one public network (for floating IPs)
 configured.


  localadmin@qa4:~/devstack$ nova net-list

 +--+---+--+

 | ID   | Label | CIDR |

 +--+---+--+

 | 6905cf7d-74d7-455b-b9d0-8cea972ec522 | private   | None |

 | 8c25e33b-47be-47eb-a945-e0ac2ad6756a | Private_net20 | None |

 | faa138e6-4774-41ad-8b5f-9795788eca43 | public| None |

 +--+---+--+

  When I launch an instance, I specify the “—nic” option twice.

  localadmin@qa4:~/devstack$ nova boot --image cirros-0.3.2-x86_64-uec
 --flavor 1 --nic net-id=6905cf7d-74d7-455b-b9d0-8cea972ec522 --nic
 net-id=8c25e33b-47be-47eb-a945-e0ac2ad6756a vm10


  And then I associate a floating IP to the instance.


  localadmin@qa4:~/devstack$ nova list


 +--+--+++-+--+

 | ID   | Name | Status | Task State |
 Power State | Networks |


 +--+--+++-+--+

 | e6a13d2e-756b-4b96-bf0c-438c2c875675 | vm10 | ACTIVE | -  |
 Running | Private_net20=20.0.0.10; private=10.0.0.7, 172.29.173.13 |

  localadmin@qa4:~/devstack$ nova show vm10


 +--++

 | Property | Value
   |


 +--++

 | OS-DCF:diskConfig| MANUAL
   |

 | OS-EXT-AZ:availability_zone  | nova
   |

 | OS-EXT-STS:power_state   | 1
   |

 | OS-EXT-STS:task_state| -
   |

 | OS-EXT-STS:vm_state  | active
   |

 | OS-SRV-USG:launched_at   | 2014-10-15T20:22:50.00
   |

 | OS-SRV-USG:terminated_at | -
   |

 | Private_net20 network| 20.0.0.10
   |

 | accessIPv4   |
   |

 | accessIPv6   |
   |

 | config_drive |
   |

 | created  | 2014-10-15T20:21:54Z
   |

 | flavor   | m1.tiny (1)
   |

 | hostId   |
 4660a679d319992f764bcb245b71048212fe8cd67b769400d82382b7   |

 | id   |
 e6a13d2e-756b-4b96-bf0c-438c2c875675   |

 | image| cirros-0.3.2-x86_64-uec
 (feaec710-c1cc-4071-aefa-c3dc2b915ab1) |

 | key_name | -
   |

 | metadata | {}
   |

 | name | vm10
   |

 | os-extended-volumes:volumes_attached | []
   |

 | private network  | 10.0.0.7, 172.29.173.13
   |

 | progress | 0
   |

 | security_groups

Re: [openstack-dev] [QA] How to attach multiple NICs to an instance VM?

2014-10-15 Thread Danny Choi (dannchoi)
Hi Salvatore,

eth1 is not configured in /etc/network/interfaces.

After I manually added eth1 and bounced it, it came up with the 2nd private 
address.

$ sudo vi /etc/network/interfaces


# Configure Loopback

auto lo

iface lo inet loopback


auto eth0

iface eth0 inet dhcp



auto eth1

iface eth1 inet dhcp

~

~

~

$ sudo ifdown eht1  sudo ifup eth1

ifdown: interface eht1 not configured

udhcpc (v1.20.1) started

Sending discover...

Sending select for 20.0.0.10...

Lease of 20.0.0.10 obtained, lease time 86400

deleting routers

adding dns 8.8.4.4

adding dns 8.8.8.8

$ ifconfig -a

eth0  Link encap:Ethernet  HWaddr FA:16:3E:7A:49:1E

  inet addr:10.0.0.7  Bcast:10.0.0.255  Mask:255.255.255.0

  inet6 addr: fe80::f816:3eff:fe7a:491e/64 Scope:Link

  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

  RX packets:707 errors:0 dropped:0 overruns:0 frame:0

  TX packets:446 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 txqueuelen:1000

  RX bytes:66680 (65.1 KiB)  TX bytes:57968 (56.6 KiB)


eth1  Link encap:Ethernet  HWaddr FA:16:3E:73:C7:F0

  inet addr:20.0.0.10  Bcast:20.0.0.255  Mask:255.255.255.0

  inet6 addr: fe80::f816:3eff:fe73:c7f0/64 Scope:Link

  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

  RX packets:39 errors:0 dropped:0 overruns:0 frame:0

  TX packets:8 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 txqueuelen:1000

  RX bytes:3354 (3.2 KiB)  TX bytes:1098 (1.0 KiB)


loLink encap:Local Loopback

  inet addr:127.0.0.1  Mask:255.0.0.0

  inet6 addr: ::1/128 Scope:Host

  UP LOOPBACK RUNNING  MTU:16436  Metric:1

  RX packets:4 errors:0 dropped:0 overruns:0 frame:0

  TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 txqueuelen:0

  RX bytes:336 (336.0 B)  TX bytes:336 (336.0 B)


$ ping 10.0.0.7

PING 10.0.0.7 (10.0.0.7): 56 data bytes

64 bytes from 10.0.0.7: seq=0 ttl=64 time=0.138 ms

64 bytes from 10.0.0.7: seq=1 ttl=64 time=0.041 ms

64 bytes from 10.0.0.7: seq=2 ttl=64 time=0.066 ms

^C

--- 10.0.0.7 ping statistics ---

3 packets transmitted, 3 packets received, 0% packet loss

round-trip min/avg/max = 0.041/0.081/0.138 ms

$ ping 20.0.0.10

PING 20.0.0.10 (20.0.0.10): 56 data bytes

64 bytes from 20.0.0.10: seq=0 ttl=64 time=0.078 ms

64 bytes from 20.0.0.10: seq=1 ttl=64 time=0.041 ms

^C

--- 20.0.0.10 ping statistics ---

2 packets transmitted, 2 packets received, 0% packet loss

round-trip min/avg/max = 0.041/0.059/0.078 ms

$

Thanks,
Danny

===

Date: Thu, 16 Oct 2014 00:10:20 +0200
From: Salvatore Orlando sorla...@nicira.commailto:sorla...@nicira.com
To: OpenStack Development Mailing List (not for usage questions)
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [QA] How to attach multiple NICs to an
instance VM?
Message-ID:
CAGR=i3jeuz6-peghjze-hnh2yvn8ykmbn4ies4dtqc3b2xl...@mail.gmail.commailto:CAGR=i3jeuz6-peghjze-hnh2yvn8ykmbn4ies4dtqc3b2xl...@mail.gmail.com
Content-Type: text/plain; charset=utf-8

I think you did everything right.

Are you sure cirros images by default are configured to boostrap interfaces
different from eth0?
Perhaps all you need to do is just ifup the interface... have you already
tried that?

Salvatore

On 15 October 2014 23:07, Danny Choi (dannchoi) 
dannc...@cisco.commailto:dannc...@cisco.com wrote:

  Hi,

  ?nova help boot? shows the following:

--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.
net-

 id: attach NIC to network with this UUID

 (either port-id or net-id must be
provided),

 v4-fixed-ip: IPv4 fixed address for NIC

 (optional), v6-fixed-ip: IPv6 fixed address

 for NIC (optional), port-id: attach NIC to

 port with this UUID (either port-id or
net-id

 must be provided).


  NOTE:  Specify option multiple times to create multiple NICs. 


  I have two private networks and one public network (for floating IPs)
configured.


  localadmin@qa4:~/devstack$ nova net-list

+--+---+--+

| ID   | Label | CIDR |

+--+---+--+

| 6905cf7d-74d7-455b-b9d0-8cea972ec522 | private   | None |

| 8c25e33b-47be-47eb-a945-e0ac2ad6756a | Private_net20 | None |

| faa138e6-4774-41ad-8b5f-9795788eca43 | public| None

Re: [openstack-dev] [QA] How to attach multiple NICs to an instance VM?

2014-10-15 Thread Adam Lawson
May I ask a question about approach? Why don't you use aliases i.e. eth0:0,
eth0:1 instead of creating multiple NIC's?


*Adam Lawson*

AQORN, Inc.
427 North Tatnall Street
Ste. 58461
Wilmington, Delaware 19801-2230
Toll-free: (844) 4-AQORN-NOW ext. 101
International: +1 302-387-4660
Direct: +1 916-246-2072


On Wed, Oct 15, 2014 at 4:09 PM, Danny Choi (dannchoi) dannc...@cisco.com
wrote:

  Hi Salvatore,

  eth1 is not configured in /etc/network/interfaces.

  After I manually added eth1 and bounced it, it came up with the 2nd
 private address.

 $ sudo vi /etc/network/interfaces


  # Configure Loopback

 auto lo

 iface lo inet loopback


  auto eth0

 iface eth0 inet dhcp



 auto eth1

 iface eth1 inet dhcp

 ~

 ~

 ~

 $ sudo ifdown eht1  sudo ifup eth1

 ifdown: interface eht1 not configured

 udhcpc (v1.20.1) started

 Sending discover...

 Sending select for 20.0.0.10...

 Lease of 20.0.0.10 obtained, lease time 86400

 deleting routers

 adding dns 8.8.4.4

 adding dns 8.8.8.8

 $ ifconfig -a

 eth0  Link encap:Ethernet  HWaddr FA:16:3E:7A:49:1E

   inet addr:10.0.0.7  Bcast:10.0.0.255  Mask:255.255.255.0

   inet6 addr: fe80::f816:3eff:fe7a:491e/64 Scope:Link

   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

   RX packets:707 errors:0 dropped:0 overruns:0 frame:0

   TX packets:446 errors:0 dropped:0 overruns:0 carrier:0

   collisions:0 txqueuelen:1000

   RX bytes:66680 (65.1 KiB)  TX bytes:57968 (56.6 KiB)


  eth1  Link encap:Ethernet  HWaddr FA:16:3E:73:C7:F0

   inet addr:20.0.0.10  Bcast:20.0.0.255  Mask:255.255.255.0

   inet6 addr: fe80::f816:3eff:fe73:c7f0/64 Scope:Link

   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

   RX packets:39 errors:0 dropped:0 overruns:0 frame:0

   TX packets:8 errors:0 dropped:0 overruns:0 carrier:0

   collisions:0 txqueuelen:1000

   RX bytes:3354 (3.2 KiB)  TX bytes:1098 (1.0 KiB)


  loLink encap:Local Loopback

   inet addr:127.0.0.1  Mask:255.0.0.0

   inet6 addr: ::1/128 Scope:Host

   UP LOOPBACK RUNNING  MTU:16436  Metric:1

   RX packets:4 errors:0 dropped:0 overruns:0 frame:0

   TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

   collisions:0 txqueuelen:0

   RX bytes:336 (336.0 B)  TX bytes:336 (336.0 B)


  $ ping 10.0.0.7

 PING 10.0.0.7 (10.0.0.7): 56 data bytes

 64 bytes from 10.0.0.7: seq=0 ttl=64 time=0.138 ms

 64 bytes from 10.0.0.7: seq=1 ttl=64 time=0.041 ms

 64 bytes from 10.0.0.7: seq=2 ttl=64 time=0.066 ms

 ^C

 --- 10.0.0.7 ping statistics ---

 3 packets transmitted, 3 packets received, 0% packet loss

 round-trip min/avg/max = 0.041/0.081/0.138 ms

 $ ping 20.0.0.10

 PING 20.0.0.10 (20.0.0.10): 56 data bytes

 64 bytes from 20.0.0.10: seq=0 ttl=64 time=0.078 ms

 64 bytes from 20.0.0.10: seq=1 ttl=64 time=0.041 ms

 ^C

 --- 20.0.0.10 ping statistics ---

 2 packets transmitted, 2 packets received, 0% packet loss

 round-trip min/avg/max = 0.041/0.059/0.078 ms

 $

  Thanks,
 Danny

  ===

  Date: Thu, 16 Oct 2014 00:10:20 +0200
 From: Salvatore Orlando sorla...@nicira.com
 To: OpenStack Development Mailing List (not for usage questions)
 openstack-dev@lists.openstack.org
 Subject: Re: [openstack-dev] [QA] How to attach multiple NICs to an
 instance VM?
 Message-ID:
 CAGR=i3jeuz6-peghjze-hnh2yvn8ykmbn4ies4dtqc3b2xl...@mail.gmail.com
 Content-Type: text/plain; charset=utf-8

  I think you did everything right.

  Are you sure cirros images by default are configured to boostrap
 interfaces
 different from eth0?
 Perhaps all you need to do is just ifup the interface... have you already
 tried that?

  Salvatore

  On 15 October 2014 23:07, Danny Choi (dannchoi) dannc...@cisco.com
 wrote:

Hi,

?nova help boot? shows the following:

  --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.
 net-

   id: attach NIC to network with this UUID

   (either port-id or net-id must be
 provided),

   v4-fixed-ip: IPv4 fixed address for NIC

   (optional), v6-fixed-ip: IPv6 fixed
 address

   for NIC (optional), port-id: attach NIC
 to

   port with this UUID (either port-id or
 net-id

   must be provided).


NOTE:  Specify option multiple times to create multiple NICs.
 


I have two private networks and one public network (for floating IPs)
 configured.


localadmin@qa4:~/devstack$ nova net-list

  +--+---+--+

  | ID