[nova] [neutron] multiple fixed_ip
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#p... [2] https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#cr... -- Arnaud Morin
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@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#p... [2] https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#cr...
-- Arnaud Morin
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@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@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#p... [2] https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#cr...
-- Arnaud Morin
— Slawek Kaplonski Senior software engineer Red Hat
Hello Slawek and all, You are right, I forgot to mention that I want to set a specific IP, so yes I am using the parameters you describe (v4-fixed-ip). However when trying to use both the v4-fixed-ip and v6-fixed-ip, it does not work. It seems that those params are mutually exclusives [1] on client side. Does anyone know if the server would accept more than one fixed-ips? My attemps were not sucessful regarding this matter. Another question is the accessIPv4 (and v6) params, does anyone know what they are used for? Because they seems completely ignored by neutron when used on nova client side [2]. [1] https://github.com/openstack/python-novaclient/blob/b9a7e03074cbaacc3f270b2b... [2] https://github.com/openstack/python-novaclient/blob/b9a7e03074cbaacc3f270b2b... -- Arnaud Morin On 03.03.20 - 21:34, Slawek Kaplonski wrote:
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@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@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#p... [2] https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#cr...
-- Arnaud Morin
— Slawek Kaplonski Senior software engineer Red Hat
Hello, Thanks for you answer, that's exactly what we are doing right now, I just wanted to know if there is a more straight solution :p Thanks! -- Arnaud Morin On 03.03.20 - 14:23, Radosław Piliszek 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@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#p... [2] https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#cr...
-- Arnaud Morin
participants (3)
-
Arnaud Morin
-
Radosław Piliszek
-
Slawek Kaplonski