openstack常用检查命令杂烩
查看可用image:
[root@os01 ~(keystone_admin)]# openstack image list
+--------------------------------------+----------+--------+
| ID | Name | Status |
+--------------------------------------+----------+--------+
| a967e5af-ced7-49cd-8cb5-4f2810547142 | TineCore | active |
| d487c90c-850d-4986-9387-beee1214a279 | cirros | active |
+--------------------------------------+----------+--------+
查看image信息
[root@os01 ~(keystone_admin)]# openstack image show cirros
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | 2017-08-31T02:02:25Z |
| disk_format | qcow2 |
| file | /v2/images/d487c90c-850d-4986-9387-beee1214a279/file |
| id | d487c90c-850d-4986-9387-beee1214a279 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros |
| owner | 607c5869c6274f259a9297adf291d31c |
| protected | False |
| schema | /v2/schemas/image |
| size | 13287936 |
| status | active |
| tags | |
| updated_at | 2017-08-31T02:02:45Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+
[root@os01 ~(keystone_admin)]# ls /var/lib/glance/images/ -l
total 29364
-rw-r----- 1 glance glance 16777216 8月 30 22:50 a967e5af-ced7-49cd-8cb5-4f2810547142
-rw-r----- 1 glance glance 13287936 8月 30 22:02 d487c90c-850d-4986-9387-beee1214a279
检查可用网络:
[root@os01 ~(keystone_admin)]# neutron net-list
+--------------------------------------+-----------+-------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+-----------+-------------------------------------------------------+
| a8e40d82-f3ab-4af4-b061-076e6f680320 | extenal | 5f609c20-f5c8-4b1d-bf2b-b7f0b9e924b9 192.168.122.0/24 |
| 7846b386-0935-44db-9772-d71b083c9cf0 | internal2 | 199598ed-2af0-47cc-a294-576e5cda06ed 172.16.1.0/24 |
| 92ee6401-5ba1-44f8-885e-cb24f508ff62 | internal | a49fc01f-6c44-4dcb-859c-5aafacee757a 10.10.0.0/24 |
+--------------------------------------+-----------+-------------------------------------------------------+
列出子网信息:
[root@os01 ~(keystone_admin)]# neutron subnet-list
+--------------------------------------+---------------+------------------+--------------------------------------------------------+
| id | name | cidr | allocation_pools |
+--------------------------------------+---------------+------------------+--------------------------------------------------------+
| 199598ed-2af0-47cc-a294-576e5cda06ed | sub-internal2 | 172.16.1.0/24 | {"start": "172.16.1.2", "end": "172.16.1.254"} |
| a49fc01f-6c44-4dcb-859c-5aafacee757a | sub-internal | 10.10.0.0/24 | {"start": "10.10.0.2", "end": "10.10.0.254"} |
| 5f609c20-f5c8-4b1d-bf2b-b7f0b9e924b9 | sub-extenal | 192.168.122.0/24 | {"start": "192.168.122.230", "end": "192.168.122.240"} |
+--------------------------------------+---------------+------------------+--------------------------------------------------------+
[root@os01 ~(keystone_admin)]# neutron net-external-list
+--------------------------------------+---------+-------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+---------+-------------------------------------------------------+
| a8e40d82-f3ab-4af4-b061-076e6f680320 | extenal | 5f609c20-f5c8-4b1d-bf2b-b7f0b9e924b9 192.168.122.0/24 |
+--------------------------------------+---------+-------------------------------------------------------+
查看路由
[root@os01 ~(keystone_admin)]# neutron router-list
+--------------------------------------+---------+------------------------------------------------------+-------------+-------+
| id | name | external_gateway_info | distributed | ha |
+--------------------------------------+---------+------------------------------------------------------+-------------+-------+
| e460a02f-326a-4c11-a990-b45171824e2a | route01 | {"network_id": "a8e40d82-f3ab- | False | False |
| | | 4af4-b061-076e6f680320", "enable_snat": true, | | |
| | | "external_fixed_ips": [{"subnet_id": "5f609c20-f5c8 | | |
| | | -4b1d-bf2b-b7f0b9e924b9", "ip_address": | | |
| | | "192.168.122.231"}]} | | |
+--------------------------------------+---------+------------------------------------------------------+-------------+-------+
列出租户的端口列表:
[root@os01 ~(keystone_admin)]# neutron port-list
+--------------------------------------+------+-------------------+------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+------------------------------------------------------------+
| 0d068e00-6fd8-490e-aa11-b5bd7582af98 | | fa:16:3e:d3:20:99 | {"subnet_id": "5f609c20-f5c8-4b1d-bf2b-b7f0b9e924b9", |
| | | | "ip_address": "192.168.122.232"} |
| 12501e67-4038-4be1-a5ae-c0ea7bcd1402 | | fa:16:3e:f1:b4:fd | {"subnet_id": "a49fc01f-6c44-4dcb-859c-5aafacee757a", |
| | | | "ip_address": "10.10.0.4"} |
| 3005c273-004e-4cef-9de1-3540a3409659 | | fa:16:3e:81:9d:a0 | {"subnet_id": "5f609c20-f5c8-4b1d-bf2b-b7f0b9e924b9", |
| | | | "ip_address": "192.168.122.233"} |
| 38097103-7b58-4c9a-9f14-ed35c9008f04 | | fa:16:3e:7e:8e:7c | {"subnet_id": "199598ed-2af0-47cc-a294-576e5cda06ed", |
| | | | "ip_address": "172.16.1.1"} |
| 3b13ec47-fb7c-4da4-a3b6-4fc9a8c2d584 | | fa:16:3e:3f:8e:84 | {"subnet_id": "5f609c20-f5c8-4b1d-bf2b-b7f0b9e924b9", |
| | | | "ip_address": "192.168.122.231"} |
| 41fab232-0b4f-460c-92e5-5bd7e7c8cf33 | | fa:16:3e:11:60:59 | {"subnet_id": "5f609c20-f5c8-4b1d-bf2b-b7f0b9e924b9", |
| | | | "ip_address": "192.168.122.235"} |
| 6bd3072e-4932-419d-bcb8-b8a01643299b | | fa:16:3e:55:04:23 | {"subnet_id": "a49fc01f-6c44-4dcb-859c-5aafacee757a", |
| | | | "ip_address": "10.10.0.2"} |
| 7dc297e0-ac7c-4709-906d-2c6a593509e9 | | fa:16:3e:18:a3:b5 | {"subnet_id": "199598ed-2af0-47cc-a294-576e5cda06ed", |
| | | | "ip_address": "172.16.1.2"} |
| 986b3f7a-5973-456e-b7c7-8556540f8e22 | | fa:16:3e:25:eb:62 | {"subnet_id": "5f609c20-f5c8-4b1d-bf2b-b7f0b9e924b9", |
| | | | "ip_address": "192.168.122.234"} |
| c9fe1741-d679-4c74-a822-7424ad665399 | | fa:16:3e:23:83:0f | {"subnet_id": "199598ed-2af0-47cc-a294-576e5cda06ed", |
| | | | "ip_address": "172.16.1.3"} |
| e3a0c0e2-fc70-4b6c-a2eb-0a86e5bb8929 | | fa:16:3e:7a:b0:f3 | {"subnet_id": "a49fc01f-6c44-4dcb-859c-5aafacee757a", |
| | | | "ip_address": "10.10.0.1"} |
+--------------------------------------+------+-------------------+------------------------------------------------------------+
查看所有计算实例
[root@os01 ~(keystone_admin)]# nova list
+--------------------------------------+-----------+---------+------------+-------------+---------------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-----------+---------+------------+-------------+---------------------------------------+
| d0bd5b2c-e864-49f9-95a7-fbde6e87e752 | Cirros172 | SHUTOFF | - | Shutdown | internal2=172.16.1.3, 192.168.122.235 |
| 9a07e488-9868-431f-b4f4-d52a73f3cf4a | cirros | SHUTOFF | - | Shutdown | internal=10.10.0.4, 192.168.122.233 |
+--------------------------------------+-----------+---------+------------+-------------+---------------------------------------+
查看flating IP 列表
[root@os01 ~(keystone_admin)]# nova floating-ip-list
+--------------------------------------+-----------------+--------------------------------------+------------+---------+
| Id | IP | Server Id | Fixed IP | Pool |
+--------------------------------------+-----------------+--------------------------------------+------------+---------+
| 2a246965-0478-41e8-a6e5-e4d2f1375dc5 | 192.168.122.235 | d0bd5b2c-e864-49f9-95a7-fbde6e87e752 | 172.16.1.3 | extenal |
| 6a57b39f-d1c7-4727-802f-e326d5c651af | 192.168.122.232 | - | - | extenal |
| 7c666af6-9a54-4c51-b57a-6e00fb9b6f62 | 192.168.122.234 | - | - | extenal |
| e2f1d10d-01de-4f9f-9cbc-700c36814f15 | 192.168.122.233 | 9a07e488-9868-431f-b4f4-d52a73f3cf4a | 10.10.0.4 | extenal |
+--------------------------------------+-----------------+--------------------------------------+------------+---------+
搜索一个OpenStack计算实例所有端口:
[root@os01 ~(keystone_admin)]# neutron port-list --device_id=d0bd5b2c-e864-49f9-95a7-fbde6e87e752
+--------------------------------------+------+-------------------+------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+------------------------------------------------------------+
| c9fe1741-d679-4c74-a822-7424ad665399 | | fa:16:3e:23:83:0f | {"subnet_id": "199598ed-2af0-47cc-a294-576e5cda06ed", |
| | | | "ip_address": "172.16.1.3"} |
+--------------------------------------+------+-------------------+------------------------------------------------------------+
[root@os01 ~(keystone_admin)]#
查询 tenant
[root@os01 ~(keystone_admin)]# keystone tenant-list
+----------------------------------+----------+---------+
| id | name | enabled |
+----------------------------------+----------+---------+
| 16b78284951d4598b175d3f1744be1cb | admin | True |
| c3250851fb234c68acea85a8c989ac44 | demo | True |
| 607c5869c6274f259a9297adf291d31c | services | True |
+----------------------------------+----------+---------+
项目列表
[root@os01 ~(keystone_admin)]# openstack project list
+----------------------------------+----------+
| ID | Name |
+----------------------------------+----------+
| 16b78284951d4598b175d3f1744be1cb | admin |
| 607c5869c6274f259a9297adf291d31c | services |
| c3250851fb234c68acea85a8c989ac44 | demo |
+----------------------------------+----------+
用户列表
[root@os01 ~(keystone_admin)]# openstack user list
+----------------------------------+------------+
| ID | Name |
+----------------------------------+------------+
| 49e83f891ab041ac9dfef9d7a9003c90 | admin |
| 0d316893760a401a8c491b77d1a245af | neutron |
| 1f4011ebf0f541a1a98c8dd335bb4166 | gnocchi |
| e515bd17d8df48f58bee22bb88e20cbf | aodh |
| 5ef45da2e9d347058f16107ef8d87a74 | nova |
| 56b735a5a8954aaaadd35a843f9a0e47 | glance |
| ee16fc58054a4b98b1dab149d74d773e | ceilometer |
| 53e68b0a90d04eeda8cf2602ccfd5756 | cinder |
| 6a178afd5e44459592f38d0ed17f262d | swift |
| af8b710b7d4a4ed9bb354104246bd669 | demo |
+----------------------------------+------------+
角色列表
[root@os01 ~(keystone_admin)]# openstack role list
+----------------------------------+---------------+
| ID | Name |
+----------------------------------+---------------+
| 5eaaf322710d4036aa12094f2db78547 | admin |
| 63193498df6542b7b36bc4b52a4a2e9a | ResellerAdmin |
| 7c7935f48cf341a7b52bfd06e152990f | SwiftOperator |
| 9fe2ff9ee4384b1894a90878d3e92bab | _member_ |
+----------------------------------+---------------+
显示所有硬件配置模板
[root@os01 ~(keystone_admin)]# nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
显示主机节点及其nova服务:
[root@os01 ~(keystone_admin)]# nova host-list
+-----------+-------------+----------+
| host_name | service | zone |
+-----------+-------------+----------+
| os01 | cert | internal |
| os01 | consoleauth | internal |
| os01 | scheduler | internal |
| os01 | conductor | internal |
| os01 | compute | nova |
+-----------+-------------+----------+
[root@os01 ~(keystone_admin)]# nova-manage service list
Option "verbose" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
Option "notification_driver" from group "DEFAULT" is deprecated. Use option "driver" from group "oslo_messaging_notifications".
Option "notification_topics" from group "DEFAULT" is deprecated. Use option "topics" from group "oslo_messaging_notifications".
DEPRECATED: Use the nova service-* commands from python-novaclient instead or the os-services REST resource. The service subcommand will be removed in the 14.0 release.
Binary Host Zone Status State Updated_At
nova-osapi_compute 0.0.0.0 internal enabled XXX None
nova-metadata 0.0.0.0 internal enabled XXX None
nova-cert os01 internal enabled :-) 2017-09-15 03:23:25
nova-consoleauth os01 internal enabled :-) 2017-09-15 03:23:25
nova-scheduler os01 internal enabled :-) 2017-09-15 03:23:25
nova-conductor os01 internal enabled :-) 2017-09-15 03:23:25
nova-compute os01 nova enabled :-) 2017-09-15 03:23:27
[root@os01 ~(keystone_admin)]# nova service-list
+----+------------------+------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+------+----------+---------+-------+----------------------------+-----------------+
| 3 | nova-cert | os01 | internal | enabled | up | 2017-09-15T03:25:05.000000 | - |
| 4 | nova-consoleauth | os01 | internal | enabled | up | 2017-09-15T03:25:05.000000 | - |
| 5 | nova-scheduler | os01 | internal | enabled | up | 2017-09-15T03:25:05.000000 | - |
| 6 | nova-conductor | os01 | internal | enabled | up | 2017-09-15T03:25:05.000000 | - |
| 7 | nova-compute | os01 | nova | enabled | up | 2017-09-15T03:25:07.000000 | - |
+----+------------------+------+----------+---------+-------+----------------------------+-----------------+