nova list 的一些实用使用方法
2013-12-24 21:55
239 查看
[root@cc ~]# 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>]]
[--fields <fields>]
List active servers.
Optional arguments:
--reservation-id <reservation-id>
Only return instances that match reservation-id.
--ip <ip-regexp> Search with regular expression match by IP address
(Admin only).
--ip6 <ip6-regexp> Search with regular expression match by IPv6 address
(Admin only).
--name <name-regexp> Search with regular expression match by name
--instance-name <name-regexp>
Search with regular expression match by instance name
(Admin only).
--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 instances 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).
--fields <fields> Comma-separated list of fields to display. Use the
show command to see which fields are available.
一般的用法:
比较实用的用法:
显示指定节点上的虚拟机
显示指定ip的虚拟机
显示使用指定镜像的虚拟机
显示使用指定规格的虚拟机
显示指定状态的虚拟机
显示虚拟机并且显示指定字段
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>]]
[--fields <fields>]
List active servers.
Optional arguments:
--reservation-id <reservation-id>
Only return instances that match reservation-id.
--ip <ip-regexp> Search with regular expression match by IP address
(Admin only).
--ip6 <ip6-regexp> Search with regular expression match by IPv6 address
(Admin only).
--name <name-regexp> Search with regular expression match by name
--instance-name <name-regexp>
Search with regular expression match by instance name
(Admin only).
--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 instances 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).
--fields <fields> Comma-separated list of fields to display. Use the
show command to see which fields are available.
一般的用法:
[root@cc ~]# nova list +--------------------------------------+----------+-----------+------------+-------------+---------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+-----------+------------+-------------+---------------+ | 14e9c941-1e3c-4848-9d07-7f4624831d03 | INSTANCE | ACTIVE | None | Running | test=10.0.0.5 | | 9d0daae5-38dc-49c2-9f89-0a3d341889db | INSTANCE | ACTIVE | None | Running | test=10.0.0.2 | | b8b71597-d2af-42ed-abe7-b994f63570bb | INSTANCE | SUSPENDED | None | Shutdown | test=10.0.0.4 | +--------------------------------------+----------+-----------+------------+-------------+---------------+
比较实用的用法:
显示指定节点上的虚拟机
[root@cc ~]# nova list --host node_1 +--------------------------------------+----------+--------+------------+-------------+---------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+--------+------------+-------------+---------------+ | 9d0daae5-38dc-49c2-9f89-0a3d341889db | INSTANCE | ACTIVE | None | Running | test=10.0.0.2 | +--------------------------------------+----------+--------+------------+-------------+---------------+
显示指定ip的虚拟机
[root@cc ~]# nova list --ip 10.0.0.2 +--------------------------------------+----------+--------+------------+-------------+---------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+--------+------------+-------------+---------------+ | 9d0daae5-38dc-49c2-9f89-0a3d341889db | INSTANCE | ACTIVE | None | Running | test=10.0.0.2 | +--------------------------------------+----------+--------+------------+-------------+---------------+
显示使用指定镜像的虚拟机
[root@cc ~]# nova list --image c3f763fd-63c8-4dd8-97c9-4f5f4a39d6ab +--------------------------------------+----------+-----------+------------+-------------+---------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+-----------+------------+-------------+---------------+ | 14e9c941-1e3c-4848-9d07-7f4624831d03 | INSTANCE | ACTIVE | None | Running | test=10.0.0.5 | | b8b71597-d2af-42ed-abe7-b994f63570bb | INSTANCE | SUSPENDED | None | Shutdown | test=10.0.0.4 | +--------------------------------------+----------+-----------+------------+-------------+---------------+
显示使用指定规格的虚拟机
[root@cc ~]# nova list --flavor 2 +--------------------------------------+----------+-----------+------------+-------------+---------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+-----------+------------+-------------+---------------+ | 14e9c941-1e3c-4848-9d07-7f4624831d03 | INSTANCE | ACTIVE | None | Running | test=10.0.0.5 | | 9d0daae5-38dc-49c2-9f89-0a3d341889db | INSTANCE | ACTIVE | None | Running | test=10.0.0.2 | +--------------------------------------+----------+-----------+------------+-------------+---------------+
显示指定状态的虚拟机
[root@cc ~]# nova list --status active +--------------------------------------+----------+--------+------------+-------------+---------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+--------+------------+-------------+---------------+ | 14e9c941-1e3c-4848-9d07-7f4624831d03 | INSTANCE | ACTIVE | None | Running | test=10.0.0.5 | | 9d0daae5-38dc-49c2-9f89-0a3d341889db | INSTANCE | ACTIVE | None | Running | test=10.0.0.2 | +--------------------------------------+----------+--------+------------+-------------+---------------+
显示虚拟机并且显示指定字段
[root@cc ~]# nova list --fields <字段>我平时常用的一般有instance_name、host、image、flavor、vm_state等,非常实用,比如想去计算节点virsh命令里操作虚拟机,使用nova list --fields instance_name能够很快的得到虚拟机id与instance_name之间的对应关系。
[root@cc ~]# nova list --fields instance_name +--------------------------------------+-------------------+ | ID | Instance Name | +--------------------------------------+-------------------+ | b8b71597-d2af-42ed-abe7-b994f63570bb | instance-00000009 | | 9d0daae5-38dc-49c2-9f89-0a3d341889db | instance-0000000a | | 14e9c941-1e3c-4848-9d07-7f4624831d03 | instance-0000000b | +--------------------------------------+-------------------+
相关文章推荐
- 一些实用的语义角色标注(SRL)工具使用方法
- scrapy一些非常实用资料整理,与其他mongdb、django、redis、solr、tor结合使用以及用Python脚本调用等等方法
- 一些实用的语义角色标注(SRL)工具使用方法
- android.os.Build的一些使用方法
- 进程类使用的一些方法及原理
- LumaQQ.NET使用的一些方法原则
- 使用OmniORB出现的一些问题及已实现的解决方法
- jquery必须知道的一些常用特效方法及使用示例(整理)
- jquery easyui combox一些实用的小方法
- String类中的一些函数使用方法
- Microsoft FTP7.5 For IIS7.x使用中的一些问题及解决方法
- 关于git的一些使用方法和基本命令
- JavaScript中一些常用API使用方法简析
- CSDN博客Markdown编辑器+一些使用方法
- JS/JQuery的一些方法的使用
- 有关boost安装和使用的一些问题的解决方法
- TableViewController 使用,TableView 一些常用的方法
- java详解 --- 字符串的一些实用方法
- PHP中使用curl及代理IP模拟post提交【两种实用方法】
- 使用elasticsearch遇到的一些问题以及解决方法(不断更新)