帮助文档
$ nova help | grep hyper
hypervisor-list List hypervisors.
hypervisor-servers List servers belonging to specific hypervisors.
hypervisor-show Display the details of the specified hypervisor.
hypervisor-stats Get hypervisor statistics over all compute nodes.
hypervisor-update-ratio
hypervisor-uptime Display the uptime of the specified hypervisor.
查询物理服务器
[root@hh-yun-puppet-129021 ~(keystone_admin)]# nova hypervisor-list | more
+-----+-----------------------------------+
| ID | Hypervisor hostname |
+-----+-----------------------------------+
| 1 | hh-yun-compute-130118.vclound.com |
| 3 | hh-yun-compute-130117.vclound.com |
| 5 | hh-yun-compute-130119.vclound.com |
| 7 | hh-yun-compute-130121.vclound.com |
| 9 | hh-yun-compute-130122.vclound.com |
---------------------
显示某个物理主机详细信息方法
[root@hh-yun-puppet-129021 ~(keystone_admin)]# nova hypervisor-show hh-yun-compute-130228.vclound.com
+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cpu_info_arch | x86_64 |
| cpu_info_features | ["ssse3", "pge", "avx", "clflush", "sep", "syscall", "vme", "dtes64", "tsc", "sse", "xsave", "vmx", "erms", "xtpr", "cmov", "smep", "pcid", "est", "pat", "monitor", "smx", "lm", "msr", "nx", "fxsr", "tm", "sse4.1", "pae", "sse4.2", "pclmuldq", "acpi", "tsc-deadline", "popcnt", "mmx", "osxsave", "cx8", "mce", "mtrr", "rdtscp", "ht", "dca", "lahf_lm", "pdcm", "mca", "pdpe1gb", "apic", "fsgsbase", "f16c", "pse", "ds", "invtsc", "pni", "tm2", "aes", "sse2", "ss", "pbe", "de", "fpu", "cx16", "pse36", "ds_cpl", "rdrand", "x2apic"] |
| cpu_info_model | SandyBridge |
| cpu_info_topology_cores | 6 |
| cpu_info_topology_sockets | 1 |
| cpu_info_topology_threads | 2 |
| cpu_info_vendor | Intel |
| current_workload | 0 |
| disk_available_least | 302 |
| free_disk_gb | 358 |
| free_ram_mb | 12538 |
| host_ip | 10.199.130.228 |
| hypervisor_hostname | hh-yun-compute-130228.vclound.com |
| hypervisor_type | QEMU |
| hypervisor_version | 1005003 |
| id | 661 |
| local_gb | 1098 |
| local_gb_used | 740 |
| memory_mb | 193274 |
| memory_mb_used | 180736 |
| running_vms | 24 |
| service_host | hh-yun-compute-130228.vclound.com |
| service_id | 689 |
| vcpus | 24 |
| vcpus_used | 109 |
+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
---------------------
显示某个主机当前使用的资源方法
~$ nova hypervisor-stats
+----------------------+----------+
| Property | Value |
+----------------------+----------+
| count | 73 |
| current_workload | 6 |
| disk_available_least | 73616 |
| free_disk_gb | 75703 |
| free_ram_mb | 13273356 |
| local_gb | 77273 |
| local_gb_used | 1570 |
| memory_mb | 18931536 |
| memory_mb_used | 5658180 |
| running_vms | 463 |
| vcpus | 3130 |
| vcpus_used | 1758 |
+----------------------+----------+
查询某个主机下当前使用了多少个云主机方法
$ nova hypervisor-servers pubbeta1-nova90.yq.163.org
+--------------------------------------+-------------------+---------------+----------------------------+
| ID | Name | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+---------------+----------------------------+
| a9e68542-90b6-488b-a46c-b2518c827603 | instance-00a102e4 | 101 | pubbeta1-nova90.yq.163.org |
| 72aefa0b-f199-4ddb-b721-9e94f233ced8 | instance-00a11c37 | 101 | pubbeta1-nova90.yq.163.org |
| e19819c7-f385-49b0-9b29-7ad3345f0c22 | instance-00a11c41 | 101 | pubbeta1-nova90.yq.163.org |
+--------------------------------------+-------------------+---------------+----------------------------+
(my_new_env) likailiang@pubbeta1-nova10:~$ nova list
+--------------------------------------+---------------------------------+--------+------------+-------------+----------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+---------------------------------+--------+------------+-------------+----------------------------------+
| e19819c7-f385-49b0-9b29-7ad3345f0c22 | virtio_scsi_hasdiscard_ceph_sas | ACTIVE | - | Running | cloud-net-check-vpc=192.168.96.2 |
| 72aefa0b-f199-4ddb-b721-9e94f233ced8 | virtio_scsi_nodiscard_ceph_sas | ACTIVE | - | Running | cloud-net-check-vpc=192.168.96.2 |
| a9e68542-90b6-488b-a46c-b2518c827603 | vitro-blk-test | ACTIVE | - | Running | cloud-net-check-vpc=192.168.96.2 |
+--------------------------------------+---------------------------------+--------+------------+-------------+----------------------------------+
利用 nova 命令查询正常工作中的计算节点 参考命令 nova service-list
+------------------+----------------------------------+----------------+---------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+----------------------------------+----------------+---------+-------+----------------------------+-----------------+
| nova-conductor | gz-controller-209131.vclound.com | internal | enabled | up | 2016-03-14T03:47:04.000000 | - |
| nova-scheduler | gz-controller-209131.vclound.com | internal | enabled | up | 2016-03-14T03:47:03.000000 | - |
| nova-cert | gz-controller-209131.vclound.com | internal | enabled | up | 2016-03-14T03:47:03.000000 | - |
| nova-cert | gz-controller-209132.vclound.com | internal | enabled | up | 2016-03-14T03:46:58.000000 | - |
Brinay
描述服务类型, 常见服务有
nova-conductor nova 程序主控制器, 接受 api 请求
nova-scheduler nova 调度器, 进行主机开启, 关闭, 重启调度
nova-cert 证书管理中心, 验证用户权限
nova-console vnc 控制器
nova-consoleauth vnc 认证中心(对用户 token 进行认证)
nova-compute 计算节点
Host
主机名
Zone
把不同物理机划分成不同分区
Internal 常见为 openstack 核心程序
develop-zone 供开发同事使用的计算节点集群
qa-zone 供测试同事使用的计算节点集群
Status
Up 服务可用
Down 服务不可用
(注, 在集群中, 只能够有一个 nova-console-auth 处于 up 状态)
Updated
服务启动时间
Disable
Reason
手动关闭服务时, 可以添加注释, 注释可在该列中进行显示
Zone 说明
由于集群中机器比较多, 申请用户也比较多, 为了更好地进行服务器规划, 我们计划把不同机柜中的服务器划分到不同 zone 中, 并限制不同部门的同事使用不同的 zone.
规划:
开发同事只在 develop-zone 中进行云主机申请
测试同事只在 qa-zone 中进行云主机申请
Sandbox项目只在 sandbox中进行云主机申请
指定申请机器使用使用不同的 zone 方法
nova boot --flavor b2c_web_1core --image Centos6.6_x86_64_1.12 --nic net-id=fe662a3d-dc73-48d2-ba0f-920cd15da5c2 terry.vclound.com--availability-zonedevelop-zone