Locate VM Disks
When managing Virtual Machines (VMs) using Virtual Machine Orchestrator (VMO), you may need to extend the disks on the VMs. When a VM has multiple disks of the same size, locating the disks on each VM can be difficult. Use this guide to help you locate disks on Linux and Windows VMs.
Prerequisites
-
A deployed VM in an active cluster that has the Virtual Machine Orchestrator (VMO) pack.
-
Access to the VMO cluster.
Locate Disks
- Linux
- Windows
-
Open a shell session on the VM. Refer to our Virtctl guide for help with accessing Linux VMs locally.
-
Use the following
kubectl
command to locate thevirt-launcher
pod. This is the pod that contains the VM disks.kubectl get pods --all-namespaces --selector kubevirt.io=virt-launcher
Example outputNAMESPACE NAME READY STATUS RESTARTS AGE
my-vms virt-launcher-vmname-9qz6n 3/3 Running 0 2h31m -
Open a shell session in the
virt-launcher
pod. Replace<namespace>
with the namespace where the pod is located and<vm-name>
with the name of thevirt-launcher
pod.kubectl exec --stdin --tty --namespace <namespace> <vm-name> -- /bin/bash
-
Issue the following command to list the VM block devices.
virsh domblklist 1
Example outputTarget Source
------------------------------------------------
vda /dev/datavolume-os
vdb /dev/disk-blk-2
vdc /dev/disk-blk-3
sda /dev/disk-scsi-4
sdb /dev/disk-scsi-5Use this output to help Match Disks on the Palette VMO cluster's Virtual Machines > Disks tab.
-
Connect to the VM and open the Windows Command Prompt (
cmd
) terminal. -
Use the following
kubectl
command to locate thevirt-launcher
pod. This is the pod that contains the VM disks.kubectl get pods --all-namespaces --selector kubevirt.io=virt-launcher
Example outputNAMESPACE NAME READY STATUS RESTARTS AGE
my-vms virt-launcher-vmname-9qz6n 3/3 Running 0 2h31m -
Open a shell session in the
virt-launcher
pod. Replace<namespace>
with the namespace where the pod is located and<vm-name>
with the name of thevirt-launcher
pod.kubectl exec --stdin --tty --namespace <namespace> <vm-name> -- /bin/bash
-
Issue the following command to list the VM block devices.
virsh dumpxml 1
Example output<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='block' device='disk' model='virtio-non-transitional'>
<driver name='qemu' type='raw' cache='writethrough' error_policy='stop' discard='unmap'/>
<source dev='/dev/datavolume-os' index='5'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<boot order='1'>
<alias name='ua-datavolume-os'/>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</disk>
<disk type='block' device='disk' model='virtio-non-transitional'>
<driver name='qemu' type='raw' cache='writethrough' error_policy='stop' discard='unmap'/>
<source dev='/dev/disk-blk-2' index='4'/>
<backingStore/>
<target dev='vdb' bus='virtio'/>
<alias name='ua-disk-blk-2'/>
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
</disk>
<disk type='block' device='disk' model='virtio-non-transitional'>
<driver name='qemu' type='raw' cache='writethrough' error_policy='stop' discard='unmap'/>
<source dev='/dev/disk-blk-3' index='3'/>
<backingStore/>
<target dev='vdc' bus='virtio'/>
<alias name='ua-disk-blk-3'/>
<address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='writethrough' error_policy='stop' discard='unmap'/>
<source dev='/dev/disk-scsi-4' index='2'/>
<backingStore/>
<target dev='sda' bus='scsi'/>
<alias name='ua-disk-scsi-4'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='writethrough' error_policy='stop' discard='unmap'/>
<source dev='/dev/disk-scsi-5' index='1'/>
<backingStore/>
<target dev='sdb' bus='scsi'/>
<alias name='ua-disk-scsi-5'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
</devices>- For Virtio devices, every disk is attached to its own PCIe controller. This makes the
bus
parameter the identifying factor. - For SCSI devices, every disk is attached to the same SCSI controller. This makes the
unit
parameter the identifying factor.
- For Virtio devices, every disk is attached to its own PCIe controller. This makes the
-
Enter
exit
to close the session on the pod. -
On the Windows VM, open a PowerShell terminal and issue the following command.
Get-PhysicalDisk | ft DeviceId,FriendlyName,{$_.Size /1GB},PhysicalLocation
Example outputDeviceId FriendlyName $_.Size /1GB PhysicalLocation
-------- ------------ ------------ -------------------------------
2 Red Hat VirtIO 10 PCI Slot 0 : Bus 9 : Device 0 : Function 0 : Adapter 3 : Port 0 : Target 0 : LUN 0
1 Red Hat VirtIO 10 PCI Slot 0 : Bus 8 : Device 0 : Function 0 : Adapter 2 : Port 0 : Target 0 : LUN 0
3 QEMU QEMU HARDDISK 10 PCI Slot 0 : Bus 5 : Device 0 : Function 0 : Adapter 4 : Port 0 : Target 0 : LUN 0
4 QEMU QEMU HARDDISK 10 PCI Slot 0 : Bus 5 : Device 0 : Function 0 : Adapter 4 : Port 0 : Target 0 : LUN 1
0 Red Hat VirtIO 80 PCI Slot 0 : Bus 7 : Device 0 : Function 0 : Adapter 1 : Port 0 : Target 0 : LUN 0 -
Issue the following PowerShell command to get the correct device ID for a specific drive letter. Replace
<drive-letters>
with the drives you want to target.Get-Partition -DriveLetter <drive-letters> | get-disk
In the following example, drives
E
andF
are targeted.Example commandGet-Partition -DriveLetter E, F | Get-Disk
Example outputNumber FriendlyName SerialNumber HealthStatus OperationalStatus TotalSize PartitionStyle
------ ------------ ------------ ------------ ---------------- ---------- --------------
2 Red Hat VirtIO Healthy Online 10 GB GPT
3 QEMU QEMU HARDDISK Healthy Online 10 GB GPT
Use these outputs to help Match Disks on the Palette VMO cluster's Virtual Machines > Disks tab.
Match Disks
- Linux
- Windows
-
Log in to Palette.
-
From the left main menu, select Clusters and click on your cluster.
-
Navigate to the Virtual Machines > Disks tab.
-
Use the final output from the Locate Disks section to help match the disk names in Palette.
For example, if the source for a disk in the terminal output is
/dev/disk-blk-2
, this would matchdisk-blk-2
in Palette. With this match, you can now determine the target for the disk as displayed in theTarget
column from thevirsh domblklist 1
output table.Example outputTarget Source
------------------------------------------------
vda /dev/datavolume-os
vdb /dev/disk-blk-2
vdc /dev/disk-blk-3
sda /dev/disk-scsi-4
sdb /dev/disk-scsi-5
-
Log in to Palette.
-
From the left main menu, select Clusters and click on your cluster.
-
Navigate to the Virtual Machines > Disks tab.
-
Use the final outputs from the Locate Disks section to help match the disk names listed in Palette to their drive letters. Here are some examples for SCSI and Virtio drives based on the example outputs provided in the Locate Disks section.
Virtio Example
-
Palette shows a disk named
disk-blk-3
. -
In
virsh dumpxml 1
, the same device appears as/dev/disk-blk-3
.<disk …>
<source dev='/dev/disk-blk-3'/>
<target dev='vdc' bus='virtio'/> <!-- Virtio drive, so bus number is the identifiable factor. -->
<address … bus='0x09' …/> <!-- Bus number is 0x09 in hexadecimal, which is 9 in decimal. -->
</disk> -
The
Get-PhysicalDisk
output listsDeviceId 2
onBus 9
, matching thebus
value from thevirsh dumpxml 1
output. -
The
Get-Partition -DriveLetter E | get-disk
output displaysNumber 2
. This confirms that drive E maps toDeviceId 2
and, subsequently,disk-blk-3
in Palette.
SCSI Example
-
Palette shows a disk named
disk-scsi-4
. -
In
virsh dumpxml 1
, the same device appears as/dev/disk-scsi-4
.<disk …>
<source dev='/dev/disk-scsi-4'/>
<target dev='sda' bus='scsi'/> <!-- SCSI drive, so unit number is the identifiable factor. -->
<address … unit='0'/>
</disk> -
The
Get-PhysicalDisk
output listsDeviceId 3
onLUN 0
, matching theunit
value from thevirsh dumpxml 1
output. -
The
Get-Partition -DriveLetter F | get-disk
output displaysNumber 3
. This confirms that drive F maps toDeviceId 3
and, subsequently,disk-scsi-4
in Palette.
The following table demonstrates how the information is linked together for these examples.
Palette Disk Name Source from virsh dumpxml 1
Identifier (Bus/LUN) Get-PhysicalDisk
→DeviceId
Get-Partition
→Number
Drive disk-blk-3
/dev/disk-blk-3
bus='0x09'
,Bus 9
2
2
E
disk-scsi-4
/dev/disk-scsi-4
unit='0'
,LUN 0
3
3
F
-