[nova][neutron] boot server with more than one subnet selection question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[nova][neutron] boot server with more than one subnet selection question

Chen CH Ji
I have a network created like below:
 
1 network with 3 subnets (1 ipv6 and 2 ipv4) ,when boot, whether I can select subnet to boot from or the subnet will be force selected by the order the subnet created? Any document or code can be  referred? Thanks
 
| fd0e2078-044d-4c5c-b114-3858631e6328 | private   | a8184e4f-5165-4ea8-8ed8-b776d619af6e fd9b:c245:1aaa::/64 |
|                                      |           | b3ee7cad-c672-4172-a183-8e9f069bea31 10.0.0.0/26         |
|                                      |           | 9439abfd-afa2-4264-8422-977d725a7166 10.0.2.0/24         |
 


__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Reply | Threaded
Open this post in threaded view
|

Re: [nova][neutron] boot server with more than one subnet selection question

Slawomir Kaplonski
Hi,

You can choose which subnet (and even IP address) should be used, see „fixed_ips” field in [1].
If You will not provide anything Neutron will choose for You one IPv4 address and one IPv6 address and in both cases it will be chosen randomly from available IPs from all subnets.

[1] https://developer.openstack.org/api-ref/network/v2/?expanded=create-port-detail#create-port

> Wiadomość napisana przez Chen CH Ji <[hidden email]> w dniu 12.11.2018, o godz. 13:44:
>
> I have a network created like below:
>  
> 1 network with 3 subnets (1 ipv6 and 2 ipv4) ,when boot, whether I can select subnet to boot from or the subnet will be force selected by the order the subnet created? Any document or code can be  referred? Thanks
>  
> | fd0e2078-044d-4c5c-b114-3858631e6328 | private   | a8184e4f-5165-4ea8-8ed8-b776d619af6e fd9b:c245:1aaa::/64 |
> |                                      |           | b3ee7cad-c672-4172-a183-8e9f069bea31 10.0.0.0/26         |
> |                                      |           | 9439abfd-afa2-4264-8422-977d725a7166 10.0.2.0/24         |
>  
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: [hidden email]?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Slawek Kaplonski
Senior software engineer
Red Hat


__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Reply | Threaded
Open this post in threaded view
|

Re: [nova][neutron] boot server with more than one subnet selection question

Chen CH Ji
Got it, this is what I am looking for .. thank you
 
----- Original message -----
From: Slawomir Kaplonski <[hidden email]>
To: "OpenStack Development Mailing List (not for usage questions)" <[hidden email]>
Cc:
Subject: Re: [openstack-dev] [nova][neutron] boot server with more than one subnet selection question
Date: Tue, Nov 13, 2018 1:06 AM
 
Hi,

You can choose which subnet (and even IP address) should be used, see „fixed_ips” field in [1].
If You will not provide anything Neutron will choose for You one IPv4 address and one IPv6 address and in both cases it will be chosen randomly from available IPs from all subnets.

[1] https://developer.openstack.org/api-ref/network/v2/?expanded=create-port-detail#create-port

> Wiadomość napisana przez Chen CH Ji <[hidden email]> w dniu 12.11.2018, o godz. 13:44:
>
> I have a network created like below:
>  
> 1 network with 3 subnets (1 ipv6 and 2 ipv4) ,when boot, whether I can select subnet to boot from or the subnet will be force selected by the order the subnet created? Any document or code can be  referred? Thanks
>  
> | fd0e2078-044d-4c5c-b114-3858631e6328 | private   | a8184e4f-5165-4ea8-8ed8-b776d619af6e fd9b:c245:1aaa::/64 |
> |                                      |           | b3ee7cad-c672-4172-a183-8e9f069bea31 10.0.0.0/26         |
> |                                      |           | 9439abfd-afa2-4264-8422-977d725a7166 10.0.2.0/24         |
>  
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: [hidden email]?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Slawek Kaplonski
Senior software engineer
Red Hat


__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

 
 


__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Reply | Threaded
Open this post in threaded view
|

Re: [nova][neutron] boot server with more than one subnet selection question

Matt Riedemann-3
On 11/13/2018 4:45 AM, Chen CH Ji wrote:
> Got it, this is what I am looking for .. thank you

Regarding that you can do with server create, I believe it's:

1. don't specify anything for networking, you get a port on the network
available to you; if there are multiple networks, it's a failure and the
user has to specify one.

2. specify a network, nova creates a port on that network

3. specify a port, nova uses that port and doesn't create anything in
neutron

4. specify a network and fixed IP, nova creates a port on that network
using that fixed IP.

It sounds like you want #3 or #4.

--

Thanks,

Matt

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Reply | Threaded
Open this post in threaded view
|

Re: [nova][neutron] boot server with more than one subnet selection question

Sean Mooney
On Tue, 2018-11-13 at 12:27 +0100, Matt Riedemann wrote:

> On 11/13/2018 4:45 AM, Chen CH Ji wrote:
> > Got it, this is what I am looking for .. thank you
>
> Regarding that you can do with server create, I believe it's:
>
> 1. don't specify anything for networking, you get a port on the network
> available to you; if there are multiple networks, it's a failure and the
> user has to specify one.
>
> 2. specify a network, nova creates a port on that network
in this case i belive neutron alocate an 1 ipv4 adress and 1 ipv6 addres assumeing the network has
a subnet for each type.
>
> 3. specify a port, nova uses that port and doesn't create anything in
> neutron
in this case nova just reads the ips the neutron has already allocated to the port and list those for  the instace
>
> 4. specify a network and fixed IP, nova creates a port on that network
> using that fixed IP.
and in this case  nova will create the port in neutron using the fixed ip you supplied which will cause neutron to
attach the prot to the correct subnet
>
> It sounds like you want #3 or #4.
>

i think what is actully wanted is "openstack server create --nic net-id=<your network>,v4-fixed-ip=<ip-addr>"

we do not have a subnet-id option for --nic so if you want to select the subnet as part of the boot you have to supply
the ip. similary if you want neutron to select the ip you have to precreate teh port and use the --port option when
creating the vm. so as matt saidn #3 or #4 are the best solutions for your request.



__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev