How to force device for iscsi target luns

Nov 12, 2010
54
0
6
HI,

Can anyone help out how to manually force a target iscsi LUN to a specific device eg

Target1 on openfiler1 => /dev/sdh on proxmox server 1
target2 on openfiler1 => /dev/sdk on proxmox server 1
target1 on openfiler2 => /dev/sdm on proxmox server 1
target2 on openfiler2 => /dev/sdh on proxmox server2

etc

As it is by default it is whatever target gets connected first will take /dev/sdb, /sdd etc. so if there is an issue connecting to say the first storage server then the second storage server gets /dev/sdb, /sdd etc and if there are manual mounts pointing at those then they will fail even if the issue on the first storage server is resolved because on reboot it remembers what it was mounted as last - so storage server 2 will still get /dev/sdb, /sdd etc
 
I have worked around it for now so when mounting in fstab - I mount with UUID= instead of /dev/sd?1 - is this the recommended method?

Cheers
MM
 
Last edited:
I have worked around it for now so when mounting in fstab - I mount with UUID= instead of /dev/sd?1 - if this the recommended method?

Cheers
MM
Hi,
yes use UUID, or use LVM (like /dev/iscsi1vg/storage1 ).
The scsi-names can change, even if you add an (internal/external) disk. Perhaps you can define udev-rules, but UUID/LVM are the easy (and save) way.

Udo
 
Ok cool - at least I know we are doing it the correct way.

UDEV rules looked a bit complicated.

One thing i have noticed though is that UUID for a partition changes from one server to another - so it might have a UUID on 1 server of 12345-0000-12345 but the same LUN/partition shows up on another server as 54321-0000-54321

Not a show stopper because you can always confirm you are working with the correct disk by the disk identifier which is the same on all servers, and once you have that UUID whatever it is for each server it won't change unless you delete and recreate the partition
 
Ok cool - at least I know we are doing it the correct way.

UDEV rules looked a bit complicated.

One thing i have noticed though is that UUID for a partition changes from one server to another - so it might have a UUID on 1 server of 12345-0000-12345 but the same LUN/partition shows up on another server as 54321-0000-54321
...
Hi,
there must be something wrong! The uuid must be the same - otherwise it's makes no sense.
Here the output of a FC-LUN from two servers:
Code:
proxmox1:~# blkid /dev/sdg
/dev/sdg: UUID="dKBmJ2-IAv0-tJj9-7vYn-ZFk2-6dtv-xFSYj8" TYPE="lvm2pv"

proxmox2:~# blkid /dev/sdg
/dev/sdg: UUID="dKBmJ2-IAv0-tJj9-7vYn-ZFk2-6dtv-xFSYj8" TYPE="lvm2pv"

Udo
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!