In some scenarios, we might have a need to find the disks associated with a virtual machine hosted on a Nutanix AHV Cluster.
Nutanix offers a distributed storage fabric, which forms a large storage pool across “N” number of nodes. we then create containers for different types of workloads or we can easily use a single container as well.
Virtual Machines are created via Prism Management and all vDisks associated with the VMs are hosted on the distributed storage pool.
On a Nutanix AOS Cluster, Acropolis service runs across the cluster to manage virtual machine operations and configurations. As both Data & MetaData is distributed across the cluster, we can use the “Acropolis” service on almost any CVM to retrieve virtual machine information running on any node.
In order to interact with the Acropolis service, Nutanix offers “acli”. a powerful set of commands for virtual machine operations across your Nutanix cluster.
acli offers tab-completion once inside the acli shell or we can execute the acli commands from a normal cvm prompt as well.
Find disk or disks attached to a existing virtual machine:
I need to find the Disk (100GB) attached to a VM called “WServer2019” on a Nutanix AOS - AHV cluster.
To query Virtual Machine configuration via acropolis cli <acli
>, we will use the “vm
” namespace, which offers us vm.get
or vm.disk_get
to find disk information of a virtual machine.
By retrieving Virtual Machine Information : acli vm.get
SSH to a CVM on the same cluster. “nutanix@cvm-ip”
From the CVM command shell:
nutanix@NTNX-CVM:192.168.100.1:~$ acli vm.get <vm-name>
Above acli vm.get
command will give us all the relevant information related to a virtual machine or in simpler terms, it will output virtual machine config, (CPU | RAM | Disks | Controllers | Location)
As we are interested in finding the disks and their location on one of the containers on our cluster, we could do the following:
acli vm.get WServer2019 include_vmdisk_paths=1
Above command will output the Entire VM Configuration for WServer2019, out of which we will be interested in the ‘disk_list’ section.
Note, we have used the “include_vmdisk_paths=1” in order for the output to include the actual path where the vdisk resides. Following section “disk_list” will give us the desired information:
disk_list {
addr {
bus: "scsi"
index: 0
}
container_id: 3878917992
container_uuid: "fcba5c88-71be-43cf-81c7-d6140c13ad26"
device_uuid: "6f861a2f-334a-414a-a930-6515707e712f"
naa_id: "naa.6506b8d9bad6b961b1f8219274aaacc9"
vmdisk_nfs_path: "/ctr01/.acropolis/vmdisk/958a3c70-7d99-4706-bee5-35cb70339ce0"
vmdisk_size: 107374182400
vmdisk_uuid: "958a3c70-7d99-4706-bee5-35cb70339ce0"
}
Looking at the output above, we can see the “vmdisk_nfs_path” is pointing to a container called “ctr01” and the hidden directory called “.acropolis” which holds all vmdisks inside the vmdisks folder.
By retrieving VIRTUAL DISK Information for a given VM : acli vm.disk_get
We can also drop inside the “acli” prompt and get the desired information (as above) via the “vm.disk_get” command:
nutanix@NTNX-CVM:192.168.1.1:~$ acli
acli vm.disk_get <vm-name>
in the following snippet we are inside the acli
shell / prompt:
<acropolis> vm.disk_get WServer2019 include_vmdisk_paths=true
ide.1 {
addr {
bus: "ide"
index: 1
}
cdrom: True
device_uuid: "361b37ef-0681-45c8-9540-34cda27e3c1e"
empty: True
naa_id: "naa.6506b8db86621d2f872ca4f1126227c4"
}
scsi.0 {
addr {
bus: "scsi"
index: 0
}
container_id: 3878917992
container_uuid: "fcba5c88-71be-43cf-81c7-d6140c13ad26"
device_uuid: "6f861a2f-334a-414a-a930-6515707e712f"
naa_id: "naa.6506b8d9bad6b961b1f8219274aaacc9"
vmdisk_nfs_path: "/ctr01/.acropolis/vmdisk/958a3c70-7d99-4706-bee5-35cb70339ce0"
vmdisk_size: 107374182400
vmdisk_uuid: "958a3c70-7d99-4706-bee5-35cb70339ce0"
}
<acropolis>
the “vmdisk_uuid” and the location is of our interest here, which we can later use to either clone the disk as an image or download this disk by connecting to our cluster via WinSCP - more on that later.
Things to remember:
- acli can be executed directly from a CVM
- acli commands can also be executed by entering the acli shell / prompt
- acli can be executed from any cvm on a AOS cluster
- acli vm.get (to List Virtual Machine info)
- acli vm.disk_get <VM-NAME> (to retrieve disk information of a vm)
Stay tuned for the next part - where we will find and access disk of an existing virtual machine via WinSCP in order to download it to our workstation.