Nova VM Diagnostics

Overview
The 'nova diagnostics' command provides diagnostics information for the specific VM. The purpose of the command is to provide the administrator with the information that will enable them to troubleshoot issues with a VM. Each driver has its own diagnostics capabilities and information that can be exposed. Currently get_diagnostics returns a dictionary of data specific to the driver.

At the moment the data returned has the following formats:

Proposal
The proposal is to have the drivers return the following information in a dictionary. If the driver is unable to return the value or does not have access to it at the moment then it does not need to return the key, that is all of the values are optional. The table below has the key and a description of the value returned:

CPU details
The cpu details will be an array of dictionaries per each virtual CPU.

Network details
The network details will be an array of dictionaries per each virtual NIC.

Disk details
The disk details will be an array of dictionaries per each virtual disk.

Example
Below is an example of the dictionary data returned by the fake driver.

{'state': 'running', 'driver': 'fake', 'uptime': 7, 'num_cpus': 1, 'num_vnics': 1, 'num_disks': 1, 'cpu_details': [{'time': 1024}] 'network_details': [{'rx_octets': 0, 'rx_errors': 0, 'rx_drop': 0, 'rx_packets': 0, 'tx_octets': 0, 'tx_errors': 0, 'tx_drop': 0, 'tx_packets': 0}], 'disk_details': [{'reads':0, 'read_requests': 0, 'writes': 0, 'write_requests': 0, 'errors': 0}], 'memory_details': {'maximum': 512, 'used': 256}, 'driver_private_data': output}

Usage

 * V2 REST API - no changes. This will ensure that the code is backward compatible and users that have applications written against the V2 API will continue to work. In this case only the raw data will be returned.
 * V3 REST API- the data defined above will be returned

Implementation Details
An additional parameter will be added to the method get_diagnostics. This will be "common_api". By default this will be True. When the V2 API invokes the call it will be set as False.

The blueprint can be seen at: https://blueprints.launchpad.net/nova/+spec/v3-diagnostics