Thanks a lot Nir! Good to know that oVirt cannot guarantee the disk names
so that I don't need to spend more time trying to enable such a feature.
I can always reproduce the problem via my application, basically, the
procedure is as following:
1. create a VM
2. add disks to the VM (e.g.: disk names: disk1, disk3)
3. check the disk mappings via `virsh domblklist `
4. add another disk (let's say, disk2, give a name alphabetically before
some existing disks)
5. shutdown the VM via hypervisor and start it again (reboot won't work)
6. `virsh domblklist` again, then you might see the problem I mentioned
before
There are no virtio devices inside /dev/disk/by-id/xxx of my guest VM. And
I just noticed that the disks mapping information given by hypervisor (from
VM configuration or virsh command) is different from the reality inside the
VM. The disk name inside the VM was actually not changed.
So now my issue is that given a disk name (/dev/vdb) of a VM, how can I get
its wwid? Before I got it from the hypervisor, but now the hypervisor's
information is not reliable, and since the disk is unformatted, I cannot
use UUID.
Joy
On Wed, Dec 2, 2020 at 1:28 PM Nir Soffer <nsoffer(a)redhat.com> wrote:
On Wed, Dec 2, 2020 at 10:27 AM Joy Li <joooy.li(a)gmail.com>
wrote:
>
> Hi All,
>
> I'm facing the problem that after adding disks to guest VM, the device
target path changed (My ovirt version is 4.3). For example:
>
> Before adding a disk:
>
> virsh # domblklist <vmname>
> Target Source
> ---------------------------------------------------------
> hdc -
> vda /dev/mapper/3600a09803830386546244a546d494f53
> vdb /dev/mapper/3600a09803830386546244a546d494f54
> vdc /dev/mapper/3600a09803830386546244a546d494f55
> vdd /dev/mapper/3600a09803830386546244a546d494f56
> vde /dev/mapper/3600a09803830386546244a546d494f57
> vdf /dev/mapper/3600a09803830386546244a546d494f58
>
> After adding a disk, and then shutdown and start the VM:
>
> virsh # domblklist <vmname>
> Target Source
> ---------------------------------------------------------
> hdc -
> vda /dev/mapper/3600a09803830386546244a546d494f53
> vdb /dev/mapper/3600a09803830386546244a546d494f54
> vdc /dev/mapper/3600a09803830386546244a546d494f6c
> vdd /dev/mapper/3600a09803830386546244a546d494f55
> vde /dev/mapper/3600a09803830386546244a546d494f56
> vdf /dev/mapper/3600a09803830386546244a546d494f57
> vdg /dev/mapper/3600a09803830386546244a546d494f58
>
> The devices' multipath doesn't map to the same target path as before, so
in my VM the /dev/vdc doesn't point to the old
/dev/mapper/3600a09803830386546244a546d494f55 anymore.
>
> Anybody knows how can I make the device path mapping fixed without being
changed after adding or removing disks.
Device nodes are not stable, and oVirt cannot guarantee that you will
get the same
node in the guest in all runs.
You should use /dev/disk/by-id/xxx links to located devices, and blkid to
create
fstab mounts that do not depend on node names.
Regardless, oVirt try to keep devices stable as possible. Do you know
how to reproduce
this issue reliably?
Nir