68

I just installed a new Ubuntu 20.04 server as a virtual machine on an esx-Server. When I look into systemlog I see lots of multipath entries.

multipathd[651]: sda: add missing path
multipathd[651]: sda: failed to get udev uid: Invalid argument
multipathd[651]: sda: failed to get sysfs uid: Invalid argument
multipathd[651]: sda: failed to get sgio uid: No such file or directory
multipathd[651]: sda: add missing path
multipathd[651]: sda: failed to get udev uid: Invalid argument
multipathd[651]: sda: failed to get sysfs uid: Invalid argument
multipathd[651]: sda: failed to get sgio uid: No such file or directory

I think multipath is just not configured and my question is if I can disable multipath. Since I checked this on several Ubuntu 20.04 servers multipath is enabled by default.

Does it make sense to activate multipath?

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Thomas Aichinger
  • 2,746
  • 5
  • 23
  • 48
  • 9
    after I added "blacklist { devnode "sda" }" to /etc/multipath.conf the entries in syslog disapeared. I am still wondering why multipath is enabled by default. – Thomas Aichinger May 23 '20 at 08:36
  • Works for me, thanks! I also encountered another problem after setting up Ubuntu 20.04 as VM (root partition only 4 GB large), so I guess a few setup routines are a bit buggy :( – BurninLeo May 24 '20 at 11:52
  • 1
    @BurninLeo As far as I know the 4GB root partition is meant to be that small. You can use lvm to grow it to whatever size you like. Its meant to keep most space available for you to create/extend partitions as needed. – Sven May 27 '20 at 09:45

7 Answers7

52

Through this, I have resolved my issue:

  1. Run vi /etc/multipath.conf and add this to the file:

    defaults {
        user_friendly_names yes
    }
    
    blacklist {
        device {
            vendor "VMware"
            product "Virtual disk"
        }
    }
    
  2. Restart the multipath-tools service:

    /etc/init.d/multipath-tools restart
    
Sulaiman
  • 621
  • 4
  • 2
  • 1
    blacklisting the type of drive feels more concise and makes for the sort of config that you can share around with chef or ansible. – ericx Jul 09 '21 at 14:10
  • 2
    Should that be `/etc/init.d/multipath-tools restart`, e.g. without `service` prefix? The former works for me, but not the latter. – EdwardTeach Dec 07 '21 at 14:51
41

There is a SUSE linux KB on the topic - https://www.suse.com/support/kb/doc/?id=000016951. The problem is that VMWare by default doesn't provide information needed by udev to generate /dev/disk/by-id entries. Apart from ESX, VMWare Workstation (my case) is also affected. The resolution is to put

disk.EnableUUID = "TRUE"

to the virtual machine definition, i.e. into the *.vmx file or via Edit Settings -> Options tab -> General -> Configuration Parameters in ESX UI.

After rebooting VM with this parameter set, the disk are visible in /dev/disk/by-id and multipathd doesn't complain anymore.

Disassembler
  • 511
  • 3
  • 3
  • This worked for me on VMware Fusion as well. (You need to right-click the VM file in the Finder and select Show Package Contents to see the .vmx file.) – Jo Liss Jul 17 '20 at 20:24
  • 9
    I had to power off the VM, and then go to *Edit Settings -> VM Options -> Advanced -> EDIT CONFIGURATION...* in vSphere Client version 6.5.0. – simlev Sep 23 '20 at 08:42
28

If you dont have access to your host ESX you can add the following lines to your /etc/multipath.conf file which also blacklists common other devices like CDRom drives etc.

defaults {
    user_friendly_names yes
}
blacklist {
    devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st|sda)[0-9]*"
}
Kibo
  • 731
  • 8
  • 11
  • 3
    Which is better between editing the VM configuration in ESXi and editing `/etc/multipath.conf` on the VM? Could you please elaborate on advantages and disadvantages of each solution? – simlev Sep 24 '20 at 09:37
  • 7
    @simlev EnableUUID can cause problems in the context of cloning the guest system – Hagen von Eitzen Feb 06 '21 at 17:10
  • Thank you very much for posting this. It saved me lots of headaches! One small addition: I had to reboot the VM for these changes to take effect. – James Hibbard Nov 05 '21 at 09:25
  • 1
    This change plus `systemctl restart multipathd` on Ubuntu 20 had no effect. The sdb log errors continue unabated. – Marc Dec 17 '21 at 09:47
  • 1
    as posted this only covers sda. I changed this to 'sd.' and that shut up sdb too – Russell Fulton Dec 22 '21 at 21:48
3

Adding the below into the guest vm parameters worked for me. The syslog is no longer complaining and the server appears to be staying up.

disk.EnableUUID = "TRUE"

This is added to the virtual machine definition, i.e. into the *.vmx file, or via Edit Settings -> Options tab -> General -> Configuration Parameters in ESX UI.

Ubuntu 20.04 running apache and Wordpress php-7.4-fpm

2

I'd use a:

defaults {
    user_friendly_names yes
}
blacklist {
    devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
    devnode "^sd[a-z]?[0-9]*"
}

for sda, sdb, etc.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
2

If you don't need multipath, turn it off:

systemctl disable multipathd
systemctl stop multipathd
BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Kim
  • 31
  • 2
  • I needed to disable multipathd on a Linode, and found that `apt-get dist-upgrade` was still trying to `systemctl start multipathd`, even with the service disabled. I did not want to remove the multipathd package, because `ubuntu-server` depends on it. However, MASKING the service with `systemctl mask multipathd` prevented it from even being STARTED by the package config scripts. – Alan Porter Mar 02 '23 at 18:47
0

Here is another way to set it.

Use govc

Setup GOVC_URL first like

export GOVC_URL='https://username:password@vcenter.company.com/sdk'

and set UUID like

govc vm.change -e="disk.EnableUUID=TRUE" -vm='MY_VM_NAME'

One more thing, you have to poweroff and poweron to take effect this change

govc vm.power -off -force VM1
govc vm.power -on -force VM1
Tejas Lotlikar
  • 2,875
  • 5
  • 16
  • 26
maxisam
  • 101
  • 3