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 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 |
+--------------------------------------+-------------+--------+------------+-------------+--------------------+
7.
[raies@localhost devstack]$ nova list --ip "172.24.4*"
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
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.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.
CLI guide of nova list tells that instances can be listed out with IP regex filter -
[raies@localhost devstack]$ nova help list
[--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]
usage: nova list [--reservation-id <reservation-id>] [--ip <ip-regexp>]
List active servers.
Optional arguments:
Only return servers that match reservation-id.
address.
address.
Search with regular expression match by server
name.
assigned (Admin only).
only) .
only) .
the show command to see which fields are
available.
--reservation-id <reservation-id>
--ip <ip-regexp> Search with regular expression match by IP
--ip6 <ip6-regexp> Search with regular expression match by IPv6
--name <name-regexp> Search with regular expression match by name
--instance-name <name-regexp>
--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
--all-tenants [<0|1>] Display information from all tenants (Admin
--tenant [<tenant>] Display information from single tenant (Admin
--deleted Only display deleted servers (Admin only).
--fields <fields> Comma-separated list of fields to display. Use
--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 ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ 5813-4f3f- 80a9-fb5cfeb0a4 94 | test-server | ACTIVE | - | Running | public=172.24.4.18 | ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 02cbf054-
+------
2.
[raies@localhost devstack]$ nova list --name test ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ 5813-4f3f- 80a9-fb5cfeb0a4 94 | test-server | ACTIVE | - | Running | public=172.24.4.18 | ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 02cbf054-
+------
3. ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ 5813-4f3f- 80a9-fb5cfeb0a4 94 | test-server | ACTIVE | - | Running | public=172.24.4.18 | ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+
[raies@localhost devstack]$ nova list --name "test"
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 02cbf054-
+------
4. ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ 5813-4f3f- 80a9-fb5cfeb0a4 94 | test-server | ACTIVE | - | Running | public=172.24.4.18 | ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+
[raies@localhost devstack]$ nova list --name "test*"
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 02cbf054-
+------
5.
[raies@localhost devstack]$ nova list --name test* -----+- ------- +------ ------+ ------- ------+ ------- ---+ -----+- ------- +------ ------+ ------- ------+ ------- ---+ -----+- ------- +------ ------+ ------- ------+ ------- ---+
+----+-
| ID | Name | Status | Task State | Power State | Networks |
+----+-
+----+-
6.
[raies@localhost devstack]$ nova list --ip 172.24.4.18 ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ 5813-4f3f- 80a9-fb5cfeb0a4 94 | test-server | ACTIVE | - | Running | public=172.24.4.18 | ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 02cbf054-
+------
7.
[raies@localhost devstack]$ nova list --ip "172.24.4*" -----+- ------- +------ ------+ ------- ------+ ------- ---+ -----+- ------- +------ ------+ ------- ------+ ------- ---+ -----+- ------- +------ ------+ ------- ------+ ------- ---+
+----+-
| ID | Name | Status | Task State | Power State | Networks |
+----+-
+----+-
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.18" ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+ 5813-4f3f- 80a9-fb5cfeb0a4 94 | test-server | ACTIVE | - | Running | public=172.24.4.18 | ------- ------- ------- ------- ----+-- ------- ----+-- ------+ ------- -----+- ------- -----+- ------- ------- -----+
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| 02cbf054-
+------
This we can see, Instances list with server regex could not found.