Mailing List Archive

Persistent block device naming by UUID
Hi,

xen1:~# uname -a
Linux xen1.int.autonlab.org 4.9.65-1-hardened #2-Alpine SMP Mon Nov 27
15:36:10 GMT 2017 x86_64 Linux

xen1:~# apk info xen
xen-4.11.1-r1 description:
Xen hypervisor

xen-4.11.1-r1 webpage:
https://www.xenproject.org/

xen-4.11.1-r1 installed size:
47734784

xen1:/etc/xen/my-guests/auto# more ubuntu-16.04-observium-ng.cfg
type = "hvm"
name = "observium-ng"
vcpus=8
memory = 32768
vif = [ 'mac=12:16:3e:0d:98:96, bridge=br0', 'mac=12:16:3e:0d:98:97, bridge=br1' ]
disk = [ 'phy:/dev/sdc,xvda,rw' ]
boot = "dc"
on_reboot="restart"
on_crash="restart"


I am reading documentation back and forth in search of a better
persistent naming method. Namely

disk = [ 'phy:/dev/sdc,xvda,rw' ]

is not persistent between the boots. I like putting my DomUs on a
dedicated block devices (M.2 SSDs) and when one of them dies the disk
labels are switching on the reboot. Ideally I would like to have
something like

disk = [ 'phy:UUID="839ca898-db1d-4c89-ad3f-faf6909bf448",xvda,rw' ]

instead. That seems to be unsupported

https://xenbits.xen.org/docs/4.11-testing/

I do understand that uuid in Xen lingo is used for something else

https://www.practicalxenserver.org/tutorials/miscellaneous-tutorials/working-with-uuids/

Am I missing here something?

Best,
Predrag



_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Persistent block device naming by UUID [ In reply to ]
Hi,

On 2/22/19 5:20 AM, Predrag Punosevac wrote:
> [...]
>
> I am reading documentation back and forth in search of a better
> persistent naming method. Namely
>
> disk = [ 'phy:/dev/sdc,xvda,rw' ]
>
> is not persistent between the boots. I like putting my DomUs on a
> dedicated block devices (M.2 SSDs) and when one of them dies the disk
> labels are switching on the reboot. Ideally I would like to have
> something like
>
> disk = [ 'phy:UUID="839ca898-db1d-4c89-ad3f-faf6909bf448",xvda,rw' ]

What about...

disk = [
'/dev/disk/by-uuid/839ca898-db1d-4c89-ad3f-faf6909bf448,raw,xvda,rw'
]

By the way, the phy: format is long deprecated. See man 5
xl-disk-configuration about that.

> instead. That seems to be unsupported

Well, you have the symlinks in /dev/ ;-]

> https://xenbits.xen.org/docs/4.11-testing/
>
> I do understand that uuid in Xen lingo is used for something else
>
> https://www.practicalxenserver.org/tutorials/miscellaneous-tutorials/working-with-uuids/
>
> Am I missing here something?

Hans

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Persistent block device naming by UUID [ In reply to ]
Hans van Kranenburg <hans@knorrie.org> wrote:

> Hi,
>
> On 2/22/19 5:20 AM, Predrag Punosevac wrote:
> > [...]
> >
> > I am reading documentation back and forth in search of a better
> > persistent naming method. Namely
> >
> > disk = [ 'phy:/dev/sdc,xvda,rw' ]
> >
> > is not persistent between the boots. I like putting my DomUs on a
> > dedicated block devices (M.2 SSDs) and when one of them dies the disk
> > labels are switching on the reboot. Ideally I would like to have
> > something like
> >
> > disk = [ 'phy:UUID="839ca898-db1d-4c89-ad3f-faf6909bf448",xvda,rw' ]
>
> What about...
>
> disk = [
> '/dev/disk/by-uuid/839ca898-db1d-4c89-ad3f-faf6909bf448,raw,xvda,rw'
> ]

Probably works on Debian. Red Hat also have /dev/disk/by-uuid

/dev/disk/by-uuid
[root@lake by-uuid]# ls
19cbce97-75fb-4350-bbf4-fc18206129f8
b67d3f41-ea4a-4581-b1c8-cfc02c573ef5
b2e35c42-6bca-44b9-b2dd-15ff62750de1
dd4e82e7-1042-4276-be28-59cc5b1a30ac

but on Alpine linux that directory doesn't exist

xen1:~# ls /dev/disk
ls: /dev/disk: No such file or directory

even though I can mount disks from fstab using UUID as follows

UUID=7e0dcf46-d8e1-405d-835d-8a9d76d2d394 /xen-images xfs
defaults 0 0


I think this is now a question for Alpine Linux mailing list

>
> By the way, the phy: format is long deprecated. See man 5
> xl-disk-configuration about that.
>

Point well taken! I fixed my configuration files. The original syntax
was taken from Alpine Linux Wiki which is not updated very frequently.


Thank you so much for you kind answer.

Best,
Predrag


> > instead. That seems to be unsupported
>
> Well, you have the symlinks in /dev/ ;-]
>
> > https://xenbits.xen.org/docs/4.11-testing/
> >
> > I do understand that uuid in Xen lingo is used for something else
> >
> > https://www.practicalxenserver.org/tutorials/miscellaneous-tutorials/working-with-uuids/
> >
> > Am I missing here something?
>
> Hans

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Persistent block device naming by UUID [ In reply to ]
Hello,

On Sat, Feb 23, 2019 at 08:41:42PM -0500, Predrag Punosevac wrote:
> Hans van Kranenburg <hans@knorrie.org> wrote:
> > What about...
> >
> > disk = [
> > '/dev/disk/by-uuid/839ca898-db1d-4c89-ad3f-faf6909bf448,raw,xvda,rw'
> > ]
>
> Probably works on Debian. Red Hat also have /dev/disk/by-uuid
>
> /dev/disk/by-uuid
> [root@lake by-uuid]# ls
> 19cbce97-75fb-4350-bbf4-fc18206129f8
> b67d3f41-ea4a-4581-b1c8-cfc02c573ef5
> b2e35c42-6bca-44b9-b2dd-15ff62750de1
> dd4e82e7-1042-4276-be28-59cc5b1a30ac
>
> but on Alpine linux that directory doesn't exist

My understanding is that the /dev/disk/by-uuid bits are created by udev,
and that Alpine by default uses eudev which does not do this. I think it
can be replaced with udev.

I have never personally done this though.

Cheers,
Andy

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users
Re: Persistent block device naming by UUID [ In reply to ]
Andy Smith andy@xxxxxxxxxxxxxx wrote:

> Hello,
>
> On Sat, Feb 23, 2019 at 08:41:42PM -0500, Predrag Punosevac wrote:
> > Hans van Kranenburg <hans@xxxxxxxxxxx> wrote:
> > > What about...
> > >
> > > disk = [
> > >
> '/dev/disk/by-uuid/839ca898-db1d-4c89-ad3f-faf6909bf448,raw,xvda,rw'
> > > ]
> >
> > Probably works on Debian. Red Hat also have /dev/disk/by-uuid
> >
> > /dev/disk/by-uuid
> > [root@lake by-uuid]# ls
> > 19cbce97-75fb-4350-bbf4-fc18206129f8
> > b67d3f41-ea4a-4581-b1c8-cfc02c573ef5
> > b2e35c42-6bca-44b9-b2dd-15ff62750de1
> > dd4e82e7-1042-4276-be28-59cc5b1a30ac
> >
> > but on Alpine linux that directory doesn't exist
>
> My understanding is that the /dev/disk/by-uuid bits are created by udev,
> and that Alpine by default uses eudev which does not do this. I think it
> can be replaced with udev.
>

Hi Andy,

Got catch! However a quick look at the documenation reveals the logic
behind the use of eudev. Namely Alpine Linux uses OpenRC
dependency-based init system which was primary reason for Gentoo
developers to work eudev from udev

https://wiki.gentoo.org/wiki/Eudev

Well I have not resolved my "problem" but at least I learnt something
tonight.

Cheers,
Predrag

> I have never personally done this though.
>
> Cheers,
> Andy

_______________________________________________
Xen-users mailing list
Xen-users@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-users