Unable to list nova instances using "IP" regex filter

Bug #1360081 reported by Mh Raies
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
New
Undecided
Unassigned
python-novaclient
Invalid
Undecided
Unassigned

Bug Description

CLI guide of nova list tells that instances can be listed out with IP regex filter -

[raies@localhost devstack]$ nova help list
usage: nova list [--reservation-id <reservation-id>] [--ip <ip-regexp>]
                 [--ip6 <ip6-regexp>] [--name <name-regexp>]
                 [--instance-name <name-regexp>] [--status <status>]
                 [--flavor <flavor>] [--image <image>] [--host <hostname>]
                 [--all-tenants [<0|1>]] [--tenant [<tenant>]] [--deleted]
                 [--fields <fields>] [--minimal]

List active servers.

Optional arguments:
  --reservation-id <reservation-id>
                                Only return servers that match reservation-id.
  --ip <ip-regexp> Search with regular expression match by IP
                                address.
  --ip6 <ip6-regexp> Search with regular expression match by IPv6
                                address.
  --name <name-regexp> Search with regular expression match by name
  --instance-name <name-regexp>
                                Search with regular expression match by server
                                name.
  --status <status> Search by server status
  --flavor <flavor> Search by flavor name or ID
  --image <image> Search by image name or ID
  --host <hostname> Search servers by hostname to which they are
                                assigned (Admin only).
  --all-tenants [<0|1>] Display information from all tenants (Admin
                                only).
  --tenant [<tenant>] Display information from single tenant (Admin
                                only).
  --deleted Only display deleted servers (Admin only).
  --fields <fields> Comma-separated list of fields to display. Use
                                the show command to see which fields are
                                available.
  --minimal Get only uuid and name.

I am able to filter instances using their name regex but I am unable to filter with IP regex.
When I use complete IP only then IP instance of that IP can be listed but regex of IP does not work.

Steps performed by me are as -

1.

[raies@localhost devstack]$ nova list
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| 02cbf054-5813-4f3f-80a9-fb5cfeb0a494 | test-server | ACTIVE | - | Running | public=172.24.4.18 |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+

2.

[raies@localhost devstack]$ nova list --name test
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| 02cbf054-5813-4f3f-80a9-fb5cfeb0a494 | test-server | ACTIVE | - | Running | public=172.24.4.18 |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+

3.
[raies@localhost devstack]$ nova list --name "test"
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| 02cbf054-5813-4f3f-80a9-fb5cfeb0a494 | test-server | ACTIVE | - | Running | public=172.24.4.18 |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+

4.
[raies@localhost devstack]$ nova list --name "test*"
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| 02cbf054-5813-4f3f-80a9-fb5cfeb0a494 | test-server | ACTIVE | - | Running | public=172.24.4.18 |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+

5.

[raies@localhost devstack]$ nova list --name test*
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

6.

[raies@localhost devstack]$ nova list --ip '\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b'
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

7.

[raies@localhost devstack]$ nova list --ip 172.24.4.18
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| 02cbf054-5813-4f3f-80a9-fb5cfeb0a494 | test-server | ACTIVE | - | Running | public=172.24.4.18 |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+

8.

[raies@localhost devstack]$ nova list --ip "172.24.4*"
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

9.

[raies@localhost devstack]$ nova list --ip 172.24.4.
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

10.
[raies@localhost devstack]$ nova list --ip 172.24.4
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

11.
[raies@localhost devstack]$ nova list --ip "172.24.4"
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

12.

[raies@localhost devstack]$ nova list --ip "172.24.4.*"
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

13.

[raies@localhost devstack]$ nova list --ip "172.24.4.18"
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
| 02cbf054-5813-4f3f-80a9-fb5cfeb0a494 | test-server | ACTIVE | - | Running | public=172.24.4.18 |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+

This we can see, Instances list with server regex could not found.

Mh Raies (raiesmh08)
description: updated
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Actually neutron does not have regex-based queries feature for ip as Nova-network does. Its related to neutron. They have in their plan for the same.

Changed in python-novaclient:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.