[neutron] set/find dhcp-server address
Dear colleagues, is there way to explicitly assign DHCP address when creating subnet? The issue is that it isn't always first address from allocation pool, e.g. $ openstack port list +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | ID | Name | MAC Address | Fixed IP Addresses | Status | +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | 0897bcc4-6cad-479c-8743-ca7cc5a57271 | | 72:d0:1c:d1:6b:51 | ip_address='172.16.53.3', subnet_id='20329549-124c-484d-8278-edca9829e262' | ACTIVE | | | | | ip_address='172.16.54.2', subnet_id='07249cd3-11a9-4da7-a4db-bd838aa8c4e7' | | both subnet have similar configuration of allocation pool (172.16.xx.2-254/24) and there are two different addresses for DHCP in every subnet. This makes a trouble during project generation with pre-assigned addresses for servers if the pre-assigned address is same as [surprisigly, non-first] address of DHCP namespace. And, may be, there is a way to determine this address in more simple way than looking into 'openstack port list' output, searching for port (a) without name and (b) with multiple addresses from all belonging subnets :) At the moment, 'openstack subnet show' say nothing about assigned DHCP-address. Thank you! -- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
Hi, it seems I wasn't first who asked for this - https://wiki.openstack.org/wiki/Neutron/enable-to-set-dhcp-port-attributes and it seems there was no progress on this? Is it possible to at least include DHCP address in output of 'subnet show' API call? The shortest way I've found is: * openstack port list --project ... --device-owner network:dhcp and then for **every port** in resulting list * openstack port show in order to extract 'Fixed IP Addresses' attribute for analysis Too much calls, isn't it? On 5/25/19 9:22 PM, Volodymyr Litovka wrote:
Dear colleagues,
is there way to explicitly assign DHCP address when creating subnet? The issue is that it isn't always first address from allocation pool, e.g. $ openstack port list +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | ID | Name | MAC Address | Fixed IP Addresses | Status | +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | 0897bcc4-6cad-479c-8743-ca7cc5a57271 | | 72:d0:1c:d1:6b:51 | ip_address='172.16.53.3', subnet_id='20329549-124c-484d-8278-edca9829e262' | ACTIVE | | | | | ip_address='172.16.54.2', subnet_id='07249cd3-11a9-4da7-a4db-bd838aa8c4e7' | | both subnet have similar configuration of allocation pool (172.16.xx.2-254/24) and there are two different addresses for DHCP in every subnet.
This makes a trouble during project generation with pre-assigned addresses for servers if the pre-assigned address is same as [surprisigly, non-first] address of DHCP namespace.
And, may be, there is a way to determine this address in more simple way than looking into 'openstack port list' output, searching for port (a) without name and (b) with multiple addresses from all belonging subnets :) At the moment, 'openstack subnet show' say nothing about assigned DHCP-address.
Thank you!
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
Hi, If You do something like: openstack port list --network d79eea02-31dc-45c7-bd48-d98af46fd2d5 --device-owner network:dhcp Then You will get only dhcp ports from specific network. And Fixed IP are by default displayed on this list. Is this enough “workaround” for You?
On 25 May 2019, at 22:19, Volodymyr Litovka <doka.ua@gmx.com> wrote:
Hi,
it seems I wasn't first who asked for this - https://wiki.openstack.org/wiki/Neutron/enable-to-set-dhcp-port-attributes and it seems there was no progress on this?
Is it possible to at least include DHCP address in output of 'subnet show' API call?
The shortest way I've found is: * openstack port list --project ... --device-owner network:dhcp and then for **every port** in resulting list * openstack port show in order to extract 'Fixed IP Addresses' attribute for analysis
Too much calls, isn't it?
On 5/25/19 9:22 PM, Volodymyr Litovka wrote:
Dear colleagues,
is there way to explicitly assign DHCP address when creating subnet? The issue is that it isn't always first address from allocation pool, e.g. $ openstack port list +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | ID | Name | MAC Address | Fixed IP Addresses | Status | +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | 0897bcc4-6cad-479c-8743-ca7cc5a57271 | | 72:d0:1c:d1:6b:51 | ip_address='172.16.53.3', subnet_id='20329549-124c-484d-8278-edca9829e262' | ACTIVE | | | | | ip_address='172.16.54.2', subnet_id='07249cd3-11a9-4da7-a4db-bd838aa8c4e7' | |
both subnet have similar configuration of allocation pool (172.16.xx.2-254/24) and there are two different addresses for DHCP in every subnet.
This makes a trouble during project generation with pre-assigned addresses for servers if the pre-assigned address is same as [surprisigly, non-first] address of DHCP namespace.
And, may be, there is a way to determine this address in more simple way than looking into 'openstack port list' output, searching for port (a) without name and (b) with multiple addresses from all belonging subnets :) At the moment, 'openstack subnet show' say nothing about assigned DHCP-address.
Thank you!
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
— Slawek Kaplonski Senior software engineer Red Hat
Hi Slawomir, yes, thanks, it works: neutron.list_ports(retrieve_all=False, network_id='2697930d-65f2-4a7a-b360-91d75cc8750d', device_owner='network:dhcp') Thank you. On 5/26/19 10:07 AM, Slawomir Kaplonski wrote:
Hi,
If You do something like:
openstack port list --network d79eea02-31dc-45c7-bd48-d98af46fd2d5 --device-owner network:dhcp
Then You will get only dhcp ports from specific network. And Fixed IP are by default displayed on this list. Is this enough “workaround” for You?
On 25 May 2019, at 22:19, Volodymyr Litovka <doka.ua@gmx.com> wrote:
Hi,
it seems I wasn't first who asked for this - https://wiki.openstack.org/wiki/Neutron/enable-to-set-dhcp-port-attributes and it seems there was no progress on this?
Is it possible to at least include DHCP address in output of 'subnet show' API call?
The shortest way I've found is: * openstack port list --project ... --device-owner network:dhcp and then for **every port** in resulting list * openstack port show in order to extract 'Fixed IP Addresses' attribute for analysis
Too much calls, isn't it?
On 5/25/19 9:22 PM, Volodymyr Litovka wrote:
Dear colleagues,
is there way to explicitly assign DHCP address when creating subnet? The issue is that it isn't always first address from allocation pool, e.g. $ openstack port list +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | ID | Name | MAC Address | Fixed IP Addresses | Status | +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | 0897bcc4-6cad-479c-8743-ca7cc5a57271 | | 72:d0:1c:d1:6b:51 | ip_address='172.16.53.3', subnet_id='20329549-124c-484d-8278-edca9829e262' | ACTIVE | | | | | ip_address='172.16.54.2', subnet_id='07249cd3-11a9-4da7-a4db-bd838aa8c4e7' | |
both subnet have similar configuration of allocation pool (172.16.xx.2-254/24) and there are two different addresses for DHCP in every subnet.
This makes a trouble during project generation with pre-assigned addresses for servers if the pre-assigned address is same as [surprisigly, non-first] address of DHCP namespace.
And, may be, there is a way to determine this address in more simple way than looking into 'openstack port list' output, searching for port (a) without name and (b) with multiple addresses from all belonging subnets :) At the moment, 'openstack subnet show' say nothing about assigned DHCP-address.
Thank you!
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
— Slawek Kaplonski Senior software engineer Red Hat
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
Hi Volodymyr, There is an undocumented process to reserve IP addresses for use by DHCP servers [1]. It works by creating port with the desired IP and a device owner of “reserved_dhcp_port." openstack port create dhcp-port1 --network <network UUID> --fixed-ip subnet=<subnet UUID>,ip-address=192.0.2.2 --device reserved_dhcp_port You can either create the port prior to enabling DHCP on the subnet, or delete an existing DHCP port after creating the reserved port. In either case Neutron should utilize the reserved port on subsequent DHCP agent creation. Does this satisfy your use-case? [1] https://github.com/openstack/neutron/blob/31fd237/neutron/agent/linux/dhcp.p... — Blake Covarrubias
On May 27, 2019, at 6:44 AM, Volodymyr Litovka <doka.ua@gmx.com> wrote:
Hi Slawomir,
yes, thanks, it works: neutron.list_ports(retrieve_all=False, network_id='2697930d-65f2-4a7a-b360-91d75cc8750d', device_owner='network:dhcp') Thank you.
On 5/26/19 10:07 AM, Slawomir Kaplonski wrote:
Hi,
If You do something like:
openstack port list --network d79eea02-31dc-45c7-bd48-d98af46fd2d5 --device-owner network:dhcp
Then You will get only dhcp ports from specific network. And Fixed IP are by default displayed on this list. Is this enough “workaround” for You?
On 25 May 2019, at 22:19, Volodymyr Litovka <doka.ua@gmx.com> <mailto:doka.ua@gmx.com> wrote:
Hi,
it seems I wasn't first who asked for this - https://wiki.openstack.org/wiki/Neutron/enable-to-set-dhcp-port-attributes <https://wiki.openstack.org/wiki/Neutron/enable-to-set-dhcp-port-attributes> and it seems there was no progress on this?
Is it possible to at least include DHCP address in output of 'subnet show' API call?
The shortest way I've found is: * openstack port list --project ... --device-owner network:dhcp and then for **every port** in resulting list * openstack port show in order to extract 'Fixed IP Addresses' attribute for analysis
Too much calls, isn't it?
On 5/25/19 9:22 PM, Volodymyr Litovka wrote:
Dear colleagues,
is there way to explicitly assign DHCP address when creating subnet? The issue is that it isn't always first address from allocation pool, e.g. $ openstack port list +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | ID | Name | MAC Address | Fixed IP Addresses | Status | +--------------------------------------+-------+-------------------+------------------------------------------------------------------------------+--------+ | 0897bcc4-6cad-479c-8743-ca7cc5a57271 | | 72:d0:1c:d1:6b:51 | ip_address='172.16.53.3', subnet_id='20329549-124c-484d-8278-edca9829e262' | ACTIVE | | | | | ip_address='172.16.54.2', subnet_id='07249cd3-11a9-4da7-a4db-bd838aa8c4e7' | |
both subnet have similar configuration of allocation pool (172.16.xx.2-254/24) and there are two different addresses for DHCP in every subnet.
This makes a trouble during project generation with pre-assigned addresses for servers if the pre-assigned address is same as [surprisigly, non-first] address of DHCP namespace.
And, may be, there is a way to determine this address in more simple way than looking into 'openstack port list' output, searching for port (a) without name and (b) with multiple addresses from all belonging subnets :) At the moment, 'openstack subnet show' say nothing about assigned DHCP-address.
Thank you!
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
— Slawek Kaplonski Senior software engineer Red Hat
-- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison
participants (3)
-
Blake Covarrubias
-
Slawomir Kaplonski
-
Volodymyr Litovka