All of lore.kernel.org
 help / color / mirror / Atom feed
* vscsi and /dev/tape/by-path
@ 2011-01-11  2:41 James Harper
  2011-01-11 17:37 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 6+ messages in thread
From: James Harper @ 2011-01-11  2:41 UTC (permalink / raw)
  To: xen-devel

I use vscsi fairly extensively (under Windows mainly for testing
baremetal restores from tape), and have a problem that's been bugging me
for ages. If I use "/dev/st4" it works fine, but obviously that's
hopeless unreliable as it relies on device enumeration order at boot. I
want to use something like "
/dev/tape/by-path/pci-0000:01:08.0-scsi-0:0:3:0-st" so that I am
guaranteed of getting the right drive, but vscsi doesn't appear to
support it.

Digging into it, I see function vscsi_get_hctl_and_devname_by that
attempts to figure out the sg device that corresponds to whatever I
specified in the config file. If I could modify that function to simply
follow the symlinks until I get to a real device that would probably be
sufficient, but is that the right way to do it?

Thanks

James

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: vscsi and /dev/tape/by-path
  2011-01-11  2:41 vscsi and /dev/tape/by-path James Harper
@ 2011-01-11 17:37 ` Konrad Rzeszutek Wilk
  2011-01-11 21:00   ` James Harper
  0 siblings, 1 reply; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-01-11 17:37 UTC (permalink / raw)
  To: James Harper; +Cc: xen-devel

On Tue, Jan 11, 2011 at 01:41:29PM +1100, James Harper wrote:
> I use vscsi fairly extensively (under Windows mainly for testing
> baremetal restores from tape), and have a problem that's been bugging me
> for ages. If I use "/dev/st4" it works fine, but obviously that's
> hopeless unreliable as it relies on device enumeration order at boot. I
> want to use something like "
> /dev/tape/by-path/pci-0000:01:08.0-scsi-0:0:3:0-st" so that I am
> guaranteed of getting the right drive, but vscsi doesn't appear to
> support it.
> 
> Digging into it, I see function vscsi_get_hctl_and_devname_by that
> attempts to figure out the sg device that corresponds to whatever I
> specified in the config file. If I could modify that function to simply
> follow the symlinks until I get to a real device that would probably be
> sufficient, but is that the right way to do it?

Yup. Thought I would think that using the /dev/by-uuid/ would be a better
way of doing it in case you want to passthrough a SCSI disk for example?

Thought what if you want to pass in a SCSI scanner? Would that work?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: vscsi and /dev/tape/by-path
  2011-01-11 17:37 ` Konrad Rzeszutek Wilk
@ 2011-01-11 21:00   ` James Harper
  2011-01-11 22:00     ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 6+ messages in thread
From: James Harper @ 2011-01-11 21:00 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel

> 
> On Tue, Jan 11, 2011 at 01:41:29PM +1100, James Harper wrote:
> > I use vscsi fairly extensively (under Windows mainly for testing
> > baremetal restores from tape), and have a problem that's been
bugging me
> > for ages. If I use "/dev/st4" it works fine, but obviously that's
> > hopeless unreliable as it relies on device enumeration order at
boot. I
> > want to use something like "
> > /dev/tape/by-path/pci-0000:01:08.0-scsi-0:0:3:0-st" so that I am
> > guaranteed of getting the right drive, but vscsi doesn't appear to
> > support it.
> >
> > Digging into it, I see function vscsi_get_hctl_and_devname_by that
> > attempts to figure out the sg device that corresponds to whatever I
> > specified in the config file. If I could modify that function to
simply
> > follow the symlinks until I get to a real device that would probably
be
> > sufficient, but is that the right way to do it?
> 
> Yup. Thought I would think that using the /dev/by-uuid/ would be a
better
> way of doing it in case you want to passthrough a SCSI disk for
example?
> 

For disk, /dev/disk/by-uuid might be a better option, although it
depends on your requirements. For tape, my system /dev/tape/by-path is
the only available option on my system, although I could probably create
a /dev/tape/by-id path easily enough using the serial number or
something. by-id would allow the device to be moved across different
busses and still remain the same, but obviously breaks when a tape drive
fails and has to be replaced, which happens fairly regularly.

This is the advantage of having so many choices :)

> Thought what if you want to pass in a SCSI scanner? Would that work?

Do they still exist? :)

James

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: vscsi and /dev/tape/by-path
  2011-01-11 21:00   ` James Harper
@ 2011-01-11 22:00     ` Konrad Rzeszutek Wilk
  2011-01-11 22:27       ` James Harper
  0 siblings, 1 reply; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-01-11 22:00 UTC (permalink / raw)
  To: James Harper; +Cc: xen-devel

On Wed, Jan 12, 2011 at 08:00:47AM +1100, James Harper wrote:
> > 
> > On Tue, Jan 11, 2011 at 01:41:29PM +1100, James Harper wrote:
> > > I use vscsi fairly extensively (under Windows mainly for testing
> > > baremetal restores from tape), and have a problem that's been
> bugging me
> > > for ages. If I use "/dev/st4" it works fine, but obviously that's
> > > hopeless unreliable as it relies on device enumeration order at
> boot. I
> > > want to use something like "
> > > /dev/tape/by-path/pci-0000:01:08.0-scsi-0:0:3:0-st" so that I am
> > > guaranteed of getting the right drive, but vscsi doesn't appear to
> > > support it.
> > >
> > > Digging into it, I see function vscsi_get_hctl_and_devname_by that
> > > attempts to figure out the sg device that corresponds to whatever I
> > > specified in the config file. If I could modify that function to
> simply
> > > follow the symlinks until I get to a real device that would probably
> be
> > > sufficient, but is that the right way to do it?
> > 
> > Yup. Thought I would think that using the /dev/by-uuid/ would be a
> better
> > way of doing it in case you want to passthrough a SCSI disk for
> example?
> > 
> 
> For disk, /dev/disk/by-uuid might be a better option, although it
> depends on your requirements. For tape, my system /dev/tape/by-path is
> the only available option on my system, although I could probably create
> a /dev/tape/by-id path easily enough using the serial number or
> something. by-id would allow the device to be moved across different
> busses and still remain the same, but obviously breaks when a tape drive
> fails and has to be replaced, which happens fairly regularly.

So could the fix you are thinking of, check both of those places?
What would the syntax end up for the vSCSI? I presume not SCSI ID
but now just the UUID (or perhaps the SCSI inq S/N? ?)

> 
> This is the advantage of having so many choices :)
> 
> > Thought what if you want to pass in a SCSI scanner? Would that work?
> 
> Do they still exist? :)

Hehe. Good point. Lets froget that example.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: vscsi and /dev/tape/by-path
  2011-01-11 22:00     ` Konrad Rzeszutek Wilk
@ 2011-01-11 22:27       ` James Harper
  2011-01-11 22:58         ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 6+ messages in thread
From: James Harper @ 2011-01-11 22:27 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel

> > For disk, /dev/disk/by-uuid might be a better option, although it
> > depends on your requirements. For tape, my system /dev/tape/by-path
is
> > the only available option on my system, although I could probably
create
> > a /dev/tape/by-id path easily enough using the serial number or
> > something. by-id would allow the device to be moved across different
> > busses and still remain the same, but obviously breaks when a tape
drive
> > fails and has to be replaced, which happens fairly regularly.
> 
> So could the fix you are thinking of, check both of those places?
> What would the syntax end up for the vSCSI? I presume not SCSI ID
> but now just the UUID (or perhaps the SCSI inq S/N? ?)
> 

Well all of those entries are just symlinks back to the /dev/stX or
/dev/sdX etc device, do I don't think we need to do anything else other
than follow the symlinks. I used os.realpath() (I think that was it) and
it works fine. I was just wondering if that was the right solution.

James

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: vscsi and /dev/tape/by-path
  2011-01-11 22:27       ` James Harper
@ 2011-01-11 22:58         ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-01-11 22:58 UTC (permalink / raw)
  To: James Harper; +Cc: xen-devel

On Wed, Jan 12, 2011 at 09:27:24AM +1100, James Harper wrote:
> > > For disk, /dev/disk/by-uuid might be a better option, although it
> > > depends on your requirements. For tape, my system /dev/tape/by-path
> is
> > > the only available option on my system, although I could probably
> create
> > > a /dev/tape/by-id path easily enough using the serial number or
> > > something. by-id would allow the device to be moved across different
> > > busses and still remain the same, but obviously breaks when a tape
> drive
> > > fails and has to be replaced, which happens fairly regularly.
> > 
> > So could the fix you are thinking of, check both of those places?
> > What would the syntax end up for the vSCSI? I presume not SCSI ID
> > but now just the UUID (or perhaps the SCSI inq S/N? ?)
> > 
> 
> Well all of those entries are just symlinks back to the /dev/stX or
> /dev/sdX etc device, do I don't think we need to do anything else other
> than follow the symlinks. I used os.realpath() (I think that was it) and
> it works fine. I was just wondering if that was the right solution.

I think yes, but we should get the input from the authors of the vscsi
backend/frontend ...

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-11 22:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-11  2:41 vscsi and /dev/tape/by-path James Harper
2011-01-11 17:37 ` Konrad Rzeszutek Wilk
2011-01-11 21:00   ` James Harper
2011-01-11 22:00     ` Konrad Rzeszutek Wilk
2011-01-11 22:27       ` James Harper
2011-01-11 22:58         ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.