Disk serials and UUID's

Hi,

I am running Rockstor under KVM hypervisor. So far no problem.

I have passed thru complete disks to the Rockstor VM. Driver is virtio, so the disks appear as /dev/vd*

Rockstor gives me the following error message in UI fpr each disk:

Warning! Disk serial number or UUID is not legitimate or unique.

Disk names may change unfavourably upon reboot leading to inadvertent drive reallocation and potential data loss. This error is caused by the source of these disks such as your Hypervisor or SAN. Please ensure that disks are provided with unique serial numbers before proceeding further

For the serial number, this message is true. But with virtio driver I am not able to pass thru an serial number to the VM. This works only with sata driver, which is slower.

But the disks of couse have UUID’s.
blkid from the command line gives me:

/dev/vdb: LABEL="pool0" UUID="da848614-203a-4270-a586-c971d540e4a7" UUID_SUB="bbf6415d-dee7-4ead-a145-26cb7c1b9326" TYPE="btrfs"
/dev/vdc: LABEL="pool0" UUID="da848614-203a-4270-a586-c971d540e4a7" UUID_SUB="dbb748ee-60e0-44b3-bf69-c6683b898255" TYPE="btrfs"
/dev/vdd: LABEL="pool0" UUID="da848614-203a-4270-a586-c971d540e4a7" UUID_SUB="4919cd6d-f398-44f5-86dd-90acc7d3d82c" TYPE="btrfs"
/dev/vde: LABEL="pool0" UUID="da848614-203a-4270-a586-c971d540e4a7" UUID_SUB="1dc1c2df-d08b-4a95-85e0-73c726ef6e42" TYPE="btrfs"
/dev/vdf: LABEL="pool2" UUID="31064a90-6abc-42b9-88b4-cd8d569bcb6e" UUID_SUB="93be1b3d-ee70-45ad-837c-c14bdcb01e08" TYPE="btrfs"

So where is the problem with the UUID’s? Shouldn’t this be enough to identify each disk?

Regards
Maik

I see that disks /dev/vd{b,c,d,e} all have same UUIDs but unique UUID_SUBs. Is it possible to configure such that the UUIDs are unique?

I think @phillxnet is familiar with KVM setups, may be he sees something I don’t here.

The UUID is from the pool. Disk’s /dev/vd{b,c,d,e} are members of pool0.

Disk /dev/vdf is a single disk an so has a different UUID. But I get the error message also for this disk.

I thought the UUID’s are created by Rocktor when creating the file system!?

When a Pool is created, yes the filesystem(BTRFS) gets a UUID. But blkid and hence lsblk provide UUIDs that Rockstor relies on to uniquely identify the disks. These are not Rockstor generated.

What’s the output of the following commands?

  1. btrfs fi show
  2. lsblk -P -o 'NAME,MODEL,SERIAL,SIZE,TRAN,VENDOR,HCTL,TYPE,FSTYPE,LABEL,UUID'

1 gives me:

Label: 'rockstor_rockstor'  uuid: 2c00761a-13b2-4bb3-8832-d6c467eb71e4
        Total devices 1 FS bytes used 2.52GiB
        devid    1 size 17.51GiB used 5.04GiB path /dev/vda3

Label: 'pool0'  uuid: da848614-203a-4270-a586-c971d540e4a7
        Total devices 4 FS bytes used 2.88TiB
        devid    1 size 2.73TiB used 1.62TiB path /dev/vdb
        devid    2 size 2.73TiB used 1.62TiB path /dev/vdc
        devid    3 size 2.73TiB used 1.62TiB path /dev/vdd
        devid    4 size 2.73TiB used 1.62TiB path /dev/vde

Label: 'pool2'  uuid: 31064a90-6abc-42b9-88b4-cd8d569bcb6e
        Total devices 1 FS bytes used 1.62TiB
        devid    1 size 2.73TiB used 1.69TiB path /dev/vdf

btrfs-progs v4.2.1

2 gives me:

NAME="vda" MODEL="" SERIAL="" SIZE="20G" TRAN="" VENDOR="0x1af4" HCTL="" TYPE="disk" FSTYPE="" LABEL="" UUID=""
NAME="vda1" MODEL="" SERIAL="" SIZE="500M" TRAN="" VENDOR="" HCTL="" TYPE="part" FSTYPE="ext4" LABEL="" UUID="e9cd5ee0-2dbf-469d-88c0-ea8e70a64e66"
NAME="vda2" MODEL="" SERIAL="" SIZE="2G" TRAN="" VENDOR="" HCTL="" TYPE="part" FSTYPE="swap" LABEL="" UUID="e1561746-d260-4de5-9c54-7abc3bada721"
NAME="vda3" MODEL="" SERIAL="" SIZE="17.5G" TRAN="" VENDOR="" HCTL="" TYPE="part" FSTYPE="btrfs" LABEL="rockstor_rockstor" UUID="2c00761a-13b2-4bb3-8832-d6c467eb71e4"
NAME="vdb" MODEL="" SERIAL="" SIZE="2.7T" TRAN="" VENDOR="0x1af4" HCTL="" TYPE="disk" FSTYPE="btrfs" LABEL="pool0" UUID="da848614-203a-4270-a586-c971d540e4a7"
NAME="vdc" MODEL="" SERIAL="" SIZE="2.7T" TRAN="" VENDOR="0x1af4" HCTL="" TYPE="disk" FSTYPE="btrfs" LABEL="pool0" UUID="da848614-203a-4270-a586-c971d540e4a7"
NAME="vdd" MODEL="" SERIAL="" SIZE="2.7T" TRAN="" VENDOR="0x1af4" HCTL="" TYPE="disk" FSTYPE="btrfs" LABEL="pool0" UUID="da848614-203a-4270-a586-c971d540e4a7"
NAME="vde" MODEL="" SERIAL="" SIZE="2.7T" TRAN="" VENDOR="0x1af4" HCTL="" TYPE="disk" FSTYPE="btrfs" LABEL="pool0" UUID="da848614-203a-4270-a586-c971d540e4a7"
NAME="vdf" MODEL="" SERIAL="" SIZE="2.7T" TRAN="" VENDOR="0x1af4" HCTL="" TYPE="disk" FSTYPE="btrfs" LABEL="pool2" UUID="31064a90-6abc-42b9-88b4-cd8d569bcb6e"

But blkid and hence lsblk provide UUIDs that Rockstor relies on to uniquely identify the disks. These are not Rockstor generated.

Where should they come from then?
A new disk does not have any UUID. It get’s the UUID with the creaton of the filesystem.

But I will try this out. I can put in my SAS HBA with the hard drives connected and pass it through to the VM. We will see what UUIDs we get and if we get the same error message.

I see what’s happening. The drives don’t have a serial number which Rockstor requires because without them, the only other unique identifier is disk name, but they are not guaranteed to stay the same across reboots. Is it possible to set these serial numbers at the hypervisor layer? Similar solution exists for VMWare users.

I am not a KVM user at the moment, but I think there are several out there in the community. Can someone help here?

The other solution is to set serial numbers via udev rules on the vm. This could work if the device names are guaranteed by the hypervisor to remain same. See this post on how to do that.

1 Like

OK, i have managed to give serials to the disks.

In older versions of KVM/libvirt this did not work for disk drivers other than sata. One could give the serial in the VM definition, but when this was a virtio disk, the VM did not see this serial. In the aktual version this works for virtio disks too and so rockstor can see the serial.

But I do not realy understand why this is needed. The btrfs filesystem does have an UUID. And there is a sub-UUID per disk. this should be enough to identifiy each disk. Shouldn’t it?

@Schrauber I think the idea is that since Rockstor is appliance in nature it tries to manage the drives at their base level so that it can work around dynamic naming etc such as is common on more modern systems. So if it uses the serial number of the drive which is there right from manufacture then drive identity can be kept straight. Drives don’t come new with a UUID and so the serial number is used. Of course this can be a problem with ‘fake’ drives such as vdi types and the like but real drives have serial numbers that don’t and can’t be changed. It is one of the reasons the smartmontools people added the noserial option so that users could submit info reports etc without divulging the serial number. In fact they recommend it when submitting reports I think.