From 125d3ceec4e1c4e63fdb245e2ed7c6b1f3615b34 Mon Sep 17 00:00:00 2001 From: Arushi Gaur Date: Wed, 20 May 2026 15:19:37 -0700 Subject: [PATCH] Fix LSSD path for azure VMs by using symlink by-index if present PiperOrigin-RevId: 918678594 --- perfkitbenchmarker/providers/azure/azure_disk.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/perfkitbenchmarker/providers/azure/azure_disk.py b/perfkitbenchmarker/providers/azure/azure_disk.py index 23c4d0c85..d23aae9a3 100644 --- a/perfkitbenchmarker/providers/azure/azure_disk.py +++ b/perfkitbenchmarker/providers/azure/azure_disk.py @@ -417,8 +417,12 @@ def _Detach(self): def GetDevicePath(self): """Returns the path to the device inside the VM.""" if self.disk_type == disk.LOCAL: + # by-index path is not supported on v5 and older verions. if LocalDriveIsNvme(self.machine_type): - return '/dev/nvme%sn1' % str(self.lun) + if self.vm.TryRemoteCommand('test -e /dev/disk/azure/local/by-index'): + return f'/dev/disk/azure/local/by-index/{self.lun}' + else: + return '/dev/nvme%sn1' % str(self.lun) # Temp disk naming isn't always /dev/sdb: # https://github.com/MicrosoftDocs/azure-docs/issues/54055 return '/dev/disk/cloud/azure_resource'