本帖最后由 doscho 于 2016-8-4 14:20 编辑
1.在openstack的虚拟机管理器中看到,本地存储(总共): 17GB, 本地存储(已使用): 4GB, 推出可用存储=17-4=13GB
2.创建一个虚机类型为10GB的虚机,报没有可用的主机。
3.通过跟踪代码发现:/usr/lib/python2.7/site-packages/nova/scheduler/filters/disk_filter.py:62 中,
free_disk_mb: 7168
total_usable_disk_mb: 17408
disk_allocation_ratio: 1.0
used_disk_mb: 10240
usable_disk_mb: 7168.0 通过进一步跟踪代码,数来源于 /usr/lib/python2.7/site-packages/nova/scheduler/host_manager.py 中 get_all_host_state 函数获取
nova.object.ComputeNodeList 获取计算节点列表, computenode信息从代码上看部分来自数据库:
ComputeNode( cpu_allocation_ratio=16.0,
cpu_info='{"vendor": "AMD", "model": "Opteron_G5", "arch": "x86_64",
"features": ["pge", "fma4", "clflush", "sep", "syscall", "vme", "tsc", "xsave", "avx", "cmov", "perfctr_core",
"misalignsse", "pat", "xop", "lm", "msr", "3dnowprefetch", "nx", "fxsr", "sse4.1", "pae", "sse4.2",
"pclmuldq", "cmp_legacy", "fma", "sse4a", "mmx", "osxsave", "cx8", "mce", "fxsr_opt", "cr8legacy",
"ht", "pse", "lahf_lm", "abm", "osvw", "tbm", "mca", "pdpe1gb", "apic", "sse", "f16c", "invtsc", "pni",
"aes", "svm", "mmxext", "sse2", "hypervisor", "bmi1", "ssse3", "de", "fpu", "cx16", "extapic", "pse36",
"mtrr", "popcnt", "rdtscp", "x2apic"],
"topology": {"cores": 2, "cells": 1, "threads": 1, "sockets": 4}}',
created_at=2016-06-07T02:33:57Z,
current_workload=0,
deleted=False,
deleted_at=None,
disk_available_least=7,
free_disk_gb=13,
free_ram_mb=3352,
host='vStack',
host_ip=192.168.10.219,
hypervisor_hostname='vStack',
hypervisor_type='QEMU',
hypervisor_version=1005003,
id=1,
local_gb=17,
local_gb_used=4,
memory_mb=7960,
memory_mb_used=4608,
metrics='[]',
numa_topology=None,
pci_device_pools=None,
ram_allocation_ratio=1.5,
running_vms=4,
service_id=None,
stats={io_workload='0',num_instances='4',num_os_type_None='4',
num_proj_c485963bb51a47fd96e878e21611cfa2='4',num_task_None='4',num_vm_active='2',num_vm_stopped='2'},
supported_hv_specs=[HVSpec,HVSpec,HVSpec,HVSpec],
updated_at=2016-08-04T03:45:43Z,
vcpus=8,
vcpus_used=5)
4. 通过df查看出本机的磁盘信息,如下:
[root@vStack log]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 16K 3.9G 1% /dev/shm
tmpfs 3.9G 139M 3.8G 4% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/vstack_vstack-root 18G 6.3G 9.9G 39% /
/dev/sdc 20G 33M 20G 1% /srv/node/sdc
/dev/sda1 477M 114M 334M 26% /boot
tmpfs 797M 0 797M 0% /run/user/0
5. 查看数据库 nova.compute_nodes 表中: local_gb: 17
local_gb_used: 4
disk_available_least: 7
free_disk_gb: 13
问题:
1. 虚拟管理器看到的磁盘信息来源?与df中看到的不一致?
2. 根据虚拟机管理器看到的磁盘信息推出可用磁盘数,在创建虚拟时,可用的磁盘不一致。如何获取的?
|
|