3

Azure ARM template allows to specify dataDisks for VMs like:

"dataDisks": [
  {
    "lun": 0,
    "name": "[concat(variables('dataDiskName'), variables('nodesSuffixes')[copyIndex()])]",
    "diskSizeGB": "[parameters('dataDiskSizeGB')]",
    "createOption": "empty",
    "managedDisk": {
        "storageAccountType": "Standard_LRS"
    }
  }
]

On VM this disk sometimes becomes sda, sometimes sdc, etc.

How to predict the name of the disk in the VM? Or how to configure it to have a predictable name in /dev/disk/by-*

2

Found a rule in /etc/udev/rules.d/ that creates symlinks like /dev/disk/azure/scsi1/lun0 which is OK for using with LVM. LUN can be specified in ARM template.

| improve this answer | |
0

Normally, when we create a new Azure VM, the VM's OS disk name is /dev/sda, the temporary disk name is /dev/sdb.

Then we add a new data disk to this VM, by default, the new data disk name will be /dev/sdc.

We can't specify the name of data disk or rename it.

root@jasonvmm:~# fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x31520363

Device     Boot Start      End  Sectors Size Id Type
/dev/sda1  *     2048 62914526 62912479  30G 83 Linux


Disk /dev/sdb: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xf50fb2f3

Device     Boot Start       End   Sectors Size Id Type
/dev/sdb1        2048 104855551 104853504  50G  7 HPFS/NTFS/exFAT




Disk /dev/sdc: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdd: 60 GiB, 64424509440 bytes, 125829120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@jasonvmm:~# 
| improve this answer | |
  • The disk usually becomes /dev/sdc but I've seen it as /dev/sda – HUB Dec 20 '17 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.