[nova] [neutron] multiple fixed_ip
Slawek Kaplonski
skaplons at redhat.com
Tue Mar 3 20:34:27 UTC 2020
Hi,
If Your network has got IPv4 and IPv6 subnet, it should be done by default that created port will have one IPv4 and one IPv6 allocated. I just did it with nova client:
nova boot --flavor m1.micro --image cirros-0.4.0 --nic net-name=private test-vm
And my vm has IPs like:
+--------------------------------------+---------+--------+------------+-------------+---------------------------------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+---------+--------+------------+-------------+---------------------------------------------------------+
| 92385f1f-7899-40b7-94ec-bbceb6749722 | test-vm | ACTIVE | - | Running | private=fdc8:d3a9:de7b:0:f816:3eff:fe0d:16f5, 10.0.0.31 |
+--------------------------------------+---------+--------+------------+-------------+————————————————————————————+
Also from novaclient help message it seems that You should be able to specify such IPv4 and IPv6 addresses:
nova help boot | grep nic
[--nic <auto,none,net-id=net-uuid,net-name=network-name,port-id=port-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,tag=tag>]
But that I didn’t try actually.
> On 3 Mar 2020, at 14:23, Radosław Piliszek <radoslaw.piliszek at gmail.com> wrote:
>
> Hi Arnaud,
>
> Non-core here.
> Last time I checked you had to decide on one and then update with
> neutron (or first create the port with neutron and then give it to
> nova :-) ).
> Moreover, not sure if IPv6 goes through Nova directly or not (docs
> suggest still nah).
>
> -yoctozepto
>
> wt., 3 mar 2020 o 14:09 Arnaud Morin <arnaud.morin at gmail.com> napisał(a):
>>
>>
>> Hello all,
>>
>> I was doing some tests to create a server using nova API.
>> My objective is to create a server with one port but multiples IPs (one
>> IPv4 and one IPv6).
>>
>> If I understand well the neutron API, I can create a port using the
>> fixed_ips array parameter [1]
>>
>> Unfortunately, on nova side, it seems to only accept a string with only
>> one ip (fixed_ip) [2]
>>
>> Is it mandatory for me to create the port with neutron?
>> Or is there any trick that I missed on nova API side?
>>
>> Thanks!
>>
>>
>> [1] https://docs.openstack.org/api-ref/network/v2/?expanded=create-port-detail#ports
>> [2] https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#create-server
>>
>>
>>
>> --
>> Arnaud Morin
>>
>>
>
—
Slawek Kaplonski
Senior software engineer
Red Hat
More information about the openstack-discuss
mailing list