How Much Detail Can You Get About a Virtual Machine (VM) from your Storage?

Thanks to Jerome over at http://nutanix.blogspot.com/2013/08/how-much-of-detail-can-you-get-about-vm.html for the below post!

Most storage vendors say that they are VM aware, but it is difficult for the centralized storage vendors to identify VMs, even getting host level statistics is pain, because you need map a LUN to WWNN/iSCSI initiator and then WWNN/iSCSI initiator to a host.

With Nutanix, it is a breeze, because it is a converged platform and Nutanix is VM aware. In addition to statistics, Nutanix localizes data based on where the VM is accessing data from. This is quick overview, in no way it is complete in what other stats we can get.

From Nutanix CLI (NCLI):

ncli vm list — list of VMs running, it gives CPU ,memory, vdisks  configured.
ncli vdisk ls vm-name=”name of the VM”
ncli vm  ls-stats name=”name of the VM”

Example:
Snippet of ncli vm ls
ID                        : 50160a6e-d5c2-041d-7a2d-541530f8c86b
Name                      : nfs-ubu-stress-Colossus09-1-4
VM IP Addresses           :
Hypervisor Host ID        : 3
Hypervisor Host Name      : 10.3.177.183
Memory (MB)               : 4096
Virtual CPUs              : 2
VDisk Count               : 1
VDisks                    : NFS:19812

ncli vm ls-stats name=nfs-ubu-stress-Colossus09-1-20
Name: nfs-ubu-stress-Colossus09-1-20
VM IP Addresses           : 10.3.58.235
Hypervisor Host ID        : 746301033
Memory (MB)               : 4096
Virtual CPUs              : 2
Disk Bandwidth (Kbps)     : 25230
Network Bandwidth (Kbps)  : 0
Latency (micro secs)      : 2215
CPU Usage Percent         : 100%
Memory Usage              : 1.02 GB (1,090,516,000 bytes)

GUI:



From REST API:

nutanix@NTNX-450-A-CVM:10.1.59.66:~$ cat test_resp.py
#!/usr/bin/python
import json as json
import requests

def main():
base_url = “https://colossus09-c1.corp.nutanix.com:9440/PrismGateway/services/rest/v1/”
s = requests.Session()
s.auth = (‘admin’, ‘admin’)
s.headers.update({‘Content-Type’: ‘application/json; charset=utf-8’})

print s.get(base_url + ‘vms/50169534-35e1-a1de-c23e-1d1135151293‘, verify=False).json()
#just VMs will get the all VMs and then you actively get specific vm
if __name__ == “__main__”:
main()

run test_resp.py

Output for one VM:

 {
      "vmId": " {
      "vmId": "50169534-35e1-a1de-c23e-1d1135151293",
      "powerState": "on",
      "vmName": "nfs-ubu-stress-Colossus09-1-4",
      "guestOperatingSystem": "Ubuntu Linux (64-bit)",
      "ipAddresses": [],
      "hostName": "10.3.177.183",
      "hostId": 3,
      "memoryCapacityInMB": 4096,
      "memoryReservedCapacityInMB": 0,
      "numVCpus": 2,
      "cpuReservedInHz": 0,
      "numNetworkAdapters": 1,
      "nutanixVirtualDisks": [
        "/ctr1/nfs-ubu-stress-Colossus09-1-4/nfs-ubu-stress-Colossus09-1-4.vmdk"
      ],
      "vdiskNames": [
        "NFS:18594"
      ],
      "vdiskFilePaths": [
        "/ctr1/nfs-ubu-stress-Colossus09-1-4/nfs-ubu-stress-Colossus09-1-4-flat.vmdk"
      ],
      "diskCapacityInBytes": 53687091200,
      "timeStampInUsec": 1375472003986000,
      "protectionDomianName": null,
      "consistencyGroupName": null,
      "stats": {
        "hypervisor_memory_usage_ppm": "330000",
        "avg_io_latency_usecs": "218757",
        "write_io_ppm": "1000000",
        "seq_io_ppm": "411998",
        "read_io_ppm": "0",
        "hypervisor_num_transmitted_bytes": "-1",
        "hypervisor_num_received_bytes": "-1",
        "total_transformed_usage_bytes": "0",
        "hypervisor_avg_read_io_latency_usecs": "0",
        "hypervisor_num_write_io": "15760",
        "num_iops": "113",
        "random_io_ppm": "588001",
        "total_untransformed_usage_bytes": "-1",
        "avg_read_io_latency_usecs": "-1",
        "io_bandwidth_kBps": "18807",
        "hypervisor_avg_io_latency_usecs": "6000",
        "hypervisor_num_iops": "788",
        "hypervisor_cpu_usage_ppm": "460000",
        "hypervisor_io_bandwidth_kBps": "31636"
      }
    },",
      "powerState": "on",
      "vmName": "nfs-ubu-stress-Colossus09-1-4",
      "guestOperatingSystem": "Ubuntu Linux (64-bit)",
      "ipAddresses": [],
      "hostName": "10.3.177.183",
      "hostId": 3,
      "memoryCapacityInMB": 4096,
      "memoryReservedCapacityInMB": 0,
      "numVCpus": 2,
      "cpuReservedInHz": 0,
      "numNetworkAdapters": 1,
      "nutanixVirtualDisks": [
        "/ctr1/nfs-ubu-stress-Colossus09-1-4/nfs-ubu-stress-Colossus09-1-4.vmdk"
      ],
      "vdiskNames": [
        "NFS:18594"
      ],
      "vdiskFilePaths": [
        "/ctr1/nfs-ubu-stress-Colossus09-1-4/nfs-ubu-stress-Colossus09-1-4-flat.vmdk"
      ],
      "diskCapacityInBytes": 53687091200,
      "timeStampInUsec": 1375472003986000,
      "protectionDomianName": null,
      "consistencyGroupName": null,
      "stats": {
        "hypervisor_memory_usage_ppm": "330000",
        "avg_io_latency_usecs": "218757",
        "write_io_ppm": "1000000",
        "seq_io_ppm": "411998",
        "read_io_ppm": "0",
        "hypervisor_num_transmitted_bytes": "-1",
        "hypervisor_num_received_bytes": "-1",
        "total_transformed_usage_bytes": "0",
        "hypervisor_avg_read_io_latency_usecs": "0",
        "hypervisor_num_write_io": "15760",
        "num_iops": "113",
        "random_io_ppm": "588001",
        "total_untransformed_usage_bytes": "-1",
        "avg_read_io_latency_usecs": "-1",
        "io_bandwidth_kBps": "18807",
        "hypervisor_avg_io_latency_usecs": "6000",
        "hypervisor_num_iops": "788",
        "hypervisor_cpu_usage_ppm": "460000",
        "hypervisor_io_bandwidth_kBps": "31636"
      }
    },

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top