On Tue, Jan 06, 2015 at 03:23:12PM -0500, Dave Neary wrote:
I am trying to automate the deployment of RDO on top of RDO, using
OpenDaylight for networking - not for real work, just for validating the
installation procedure.
I would like to have the instances I create in the OpenStack cloud to
have 2 NICs each so that I can simulate a management & data network
configuration, but I don't know how to create a virtual NIC in an
instance (or even if this is possible, or maybe doesn't make any sense).
If you have multiple networks avaiable:
$ nova net-list
+--------------------------------------+----------+------+
| ID | Label | CIDR |
+--------------------------------------+----------+------+
| ba4d7bd0-95de-4527-8ae8-c7f640fd2561 | net1 | None |
| 02d13742-c783-4927-82df-bb7c30394f12 | ext-host | None |
| 028d70dd-67b8-4901-8bdd-0c62b06cce2d | ext-nat | None |
| 18fc1b31-9b2c-4b6e-8dea-7e04bfd1eb43 | net0 | None |
+--------------------------------------+----------+------+
Then when you boot an instance you can specify a NIC for each network:
$ nova boot \
--nic net-id=18fc1b31-9b2c-4b6e-8dea-7e04bfd1eb43 \
--nic net-id=ba4d7bd0-95de-4527-8ae8-c7f640fd2561 \
--flavor m1.small --image someimage my-nova-server
This would result in:
$ ssh (ip address of my-nova-server)
$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen
1000
link/ether fa:16:3e:4b:86:0f brd ff:ff:ff:ff:ff:ff
inet 10.0.0.101/24 brd 10.0.0.255 scope global dynamic eth0
valid_lft 86396sec preferred_lft 86396sec
inet6 fe80::f816:3eff:fe4b:860f/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen
1000
link/ether fa:16:3e:9a:f8:07 brd ff:ff:ff:ff:ff:ff
inet 10.1.0.2/24 brd 10.1.0.255 scope global dynamic eth1
valid_lft 86396sec preferred_lft 86396sec
inet6 fe80::f816:3eff:fe9a:f807/64 scope link
valid_lft forever preferred_lft forever
You will want to make sure that either (a) you create all but one of
your subnets with --no-gateway or (b) you boot images that won't try
to use dhcp on all available interfaces, because otherwise you don't
know which interface will get used for the default route and things
like floating ip association may not functional properly.
--
Lars Kellogg-Stedman <lars(a)redhat.com> | larsks @ {freenode,twitter,github}
Cloud Engineering / OpenStack |
http://blog.oddbit.com/