devstack 开发中的 nova 诊断

nova diagnostics in devstack development

在 ssh 中,当我 运行 这个命令时

nova diagnostics 2ad0dda0-072d-46c4-8689-3c487a452248

我在devstack中获得了所有资源

+---------------------------+----------------------+
| Property                  | Value                |
+---------------------------+----------------------+
| cpu0_time                 | 3766640000000        |
| hdd_errors                | 18446744073709551615 |
| hdd_read                  | 111736               |
| hdd_read_req              | 73                   |
| hdd_write                 | 0                    |
| hdd_write_req             | 0                    |
| memory                    | 2097152              |
| memory-actual             | 2097152              |
| memory-available          | 1922544              |
| memory-major_fault        | 2710                 |
| memory-minor_fault        | 10061504             |
| memory-rss                | 509392               |
| memory-swap_in            | 0                    |
| memory-swap_out           | 0                    |
| memory-unused             | 1079468              |
| tap5a148e0f-b8_rx         | 959777               |
| tap5a148e0f-b8_rx_drop    | 0                    |
| tap5a148e0f-b8_rx_errors  | 0                    |
| tap5a148e0f-b8_rx_packets | 8758                 |
| tap5a148e0f-b8_tx         | 48872                |
| tap5a148e0f-b8_tx_drop    | 0                    |
| tap5a148e0f-b8_tx_errors  | 0                    |
| tap5a148e0f-b8_tx_packets | 615                  |
| vda_errors                | 18446744073709551615 |
| vda_read                  | 597230592            |
| vda_read_req              | 31443                |
| vda_write                 | 164690944            |
| vda_write_req             | 18422                |
+---------------------------+----------------------+

如何在 devstack 用户界面中获取它。

请帮忙..

提前致谢

它在 openstack icehouse/juno 版本中不可用,但它可以在 juno 中编辑以在 devstack 中检索。

我没有使用 openstack Kilo。在 juno 中,如果您的管理程序是 libvirt、Vsphere 或 XenAPI,那么您可以在 devstack UI 中检索此统计信息。为此你必须这样做:

对于 Libvirt 在这个位置ceilometer/compute/virt/libvirt/inspector.py,添加这个:

from oslo.utils import units
from ceilometer.compute.pollsters import util


  def inspect_memory_usage(self, instance, duration=None):  
        instance_name = util.instance_name(instance)    
        domain = self._lookup_by_name(instance_name)    
        state = domain.info()[0]    
        if state == libvirt.VIR_DOMAIN_SHUTOFF: 
            LOG.warn(_('Failed to inspect memory usage of %(instance_name)s, '  
                       'domain is in state of SHUTOFF'),    
                     {'instance_name': instance_name})  
            return  
        try:    
            memory_stats = domain.memoryStats() 
            if (memory_stats and    
                    memory_stats.get('available') and   
                    memory_stats.get('unused')):    
                memory_used = (memory_stats.get('available') -  
                               memory_stats.get('unused'))  
                # Stat provided from libvirt is in KB, converting it to MB.     
                memory_used = memory_used / units.Ki    
                return virt_inspector.MemoryUsageStats(usage=memory_used)   
            else:   
                LOG.warn(_('Failed to inspect memory usage of ' 
                           '%(instance_name)s, can not get info from libvirt'), 
                         {'instance_name': instance_name})  
        # memoryStats might launch an exception if the method   
        # is not supported by the underlying hypervisor being   
        # used by libvirt   
        except libvirt.libvirtError as e:   
            LOG.warn(_('Failed to inspect memory usage of %(instance_name)s, '  
                       'can not get info from libvirt: %(error)s'), 
                                 {'instance_name': instance_name, 'error': e}) 

有关更多详细信息,您可以查看以下内容link:

https://review.openstack.org/#/c/90498/