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
kubectlcommand to locate thevirt-launcherpod. This is the pod that contains the VM disks.kubectl get pods --all-namespaces --selector kubevirt.io=virt-launcherExample outputNAMESPACE NAME READY STATUS RESTARTS AGE
my-vms virt-launcher-vmname-9qz6n 3/3 Running 0 2h31m -
Open a shell session in the
virt-launcherpod. Replace<namespace>with the namespace where the pod is located and<vm-name>with the name of thevirt-launcherpod.kubectl exec --stdin --tty --namespace <namespace> <vm-name> -- /bin/bash -
Issue the following command to list the VM block devices.
virsh domblklist 1Example 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
kubectlcommand to locate thevirt-launcherpod. This is the pod that contains the VM disks.kubectl get pods --all-namespaces --selector kubevirt.io=virt-launcherExample outputNAMESPACE NAME READY STATUS RESTARTS AGE
my-vms virt-launcher-vmname-9qz6n 3/3 Running 0 2h31m -
Open a shell session in the
virt-launcherpod. Replace<namespace>with the namespace where the pod is located and<vm-name>with the name of thevirt-launcherpod.kubectl exec --stdin --tty --namespace <namespace> <vm-name> -- /bin/bash -
Issue the following command to list the VM block devices.
virsh dumpxml 1Example 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
busparameter the identifying factor. - For SCSI devices, every disk is attached to the same SCSI controller. This makes the
unitparameter the identifying factor.
- For Virtio devices, every disk is attached to its own PCIe controller. This makes the
-
Enter
exitto 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},PhysicalLocationExample 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-diskIn the following example, drives
EandFare targeted.Example commandGet-Partition -DriveLetter E, F | Get-DiskExample 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-2in Palette. With this match, you can now determine the target for the disk as displayed in theTargetcolumn from thevirsh domblklist 1output 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-PhysicalDiskoutput listsDeviceId 2onBus 9, matching thebusvalue from thevirsh dumpxml 1output. -
The
Get-Partition -DriveLetter E | get-diskoutput displaysNumber 2. This confirms that drive E maps toDeviceId 2and, subsequently,disk-blk-3in 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-PhysicalDiskoutput listsDeviceId 3onLUN 0, matching theunitvalue from thevirsh dumpxml 1output. -
The
Get-Partition -DriveLetter F | get-diskoutput displaysNumber 3. This confirms that drive F maps toDeviceId 3and, subsequently,disk-scsi-4in Palette.
The following table demonstrates how the information is linked together for these examples.
Palette Disk Name Source from virsh dumpxml 1Identifier (Bus/LUN) Get-PhysicalDisk→DeviceIdGet-Partition→NumberDrive disk-blk-3/dev/disk-blk-3bus='0x09',Bus 922Edisk-scsi-4/dev/disk-scsi-4unit='0',LUN 033F -