Skip to contentSkip to conversation

Issuing custom IOCTLs to SCSI LLD

DISCUSSION Naveen 5 participants 10 messages May 9, 2016 – May 13, 2016

lore
Share & tools
lore

Naveen

author
#0 lore raw

Hi,

I'm new to ceph and trying to find if on CentOS there is a way to issue IOCTL or similar custom requests (other than fops request like OS issued read/write requests) from ceph OSD/RBD to the underlying SCSI LLD. From initial reading of docs it looks like in the I/O stack user/client issued I/Os would reach the actual device as below:

Client I/O req
VFS
ceph fs
Ceph OSD daemon
RBD
SCSI midlayer
SCSI LLD (say mpt3sas)
Disk

Ref:
https://en.wikipedia.org/wiki/NVM_Express#/media/File:IO_stack_of_the_Li
nux_kernel.svg

My question is:
The SCSI LLD would support both read /write entry points for I/O requests issued by the filesystem/block I/O but they also support some custom requests using IOCTLs. So how can ceph support issuing of such IOCTL requests to the device if user issues such request. Say for example power cycling the drive etc. It can also be a passthro request down to the device.

Appreciate the help and thanks in advance.

thanks & regards,
naveen

author
#1 lore raw
Quoted 4 lines · Naveen <Naveen.Chandrasekaran <at> radisys.com> writes:

Hi,

I'm new to ceph and trying to find if on CentOS there is a way to

issue

Quoted 1 line

IOCTL or similar custom requests (other than fops request like OS

issued

Quoted 2 lines

read/write requests) from ceph OSD/RBD to the underlying SCSI LLD. From initial reading of docs it looks like in the I/O stack

user/client

Quoted 11 lines

issued I/Os would reach the actual device as below:

Client I/O req
VFS
ceph fs
Ceph OSD daemon
RBD
SCSI midlayer
SCSI LLD (say mpt3sas)
Disk

Quoted 2 lines

Ref:

https://en.wikipedia.org/wiki/NVM_Express#/media/File:IO_stack_of_the_Li

Quoted 10 lines

nux_kernel.svg

My question is:
The SCSI LLD would support both read /write entry points for I/O requests issued by the filesystem/block I/O but they also support some custom requests using IOCTLs. So how can ceph support issuing of such IOCTL requests to the device if user issues such request. Say for example power cycling the drive etc. It can also be a passthro request down to the device.

Quoted 2 lines

Appreciate the help and thanks in advance.

Hi,

Still waiting for a response. Can any of the experts clarify on this?

thanks,
naveen

#2 lore raw

Short answer is: don't do it. Use the SES interface for your example, or ensure a proper API exists if the example was just made up.

#4 lore raw
In reply to Naveen
Quoted 21 lines · Naveen
Quoted 3 lines · Naveen <Naveen.Chandrasekaran <at> radisys.com> writes:

Hi,

I'm new to ceph and trying to find if on CentOS there is a way to

issue

Quoted 1 line

IOCTL or similar custom requests (other than fops request like OS

issued

Quoted 2 lines

read/write requests) from ceph OSD/RBD to the underlying SCSI LLD. From initial reading of docs it looks like in the I/O stack

user/client

Quoted 11 lines

issued I/Os would reach the actual device as below:

Client I/O req
VFS
ceph fs
Ceph OSD daemon
RBD
SCSI midlayer
SCSI LLD (say mpt3sas)
Disk

Quoted 12 lines
Quoted 2 lines

Ref:

https://en.wikipedia.org/wiki/NVM_Express#/media/File:IO_stack_of_the_Li

Quoted 9 lines

nux_kernel.svg

My question is:
The SCSI LLD would support both read /write entry points for I/O requests issued by the filesystem/block I/O but they also support some custom requests using IOCTLs. So how can ceph support issuing of such IOCTL requests to the device if user issues such request. Say for example power cycling the drive etc. It can also be a passthro request down to the device.

Can you give an example of such an operation?

In general, any operation is generalized at the librados level. For example, in order to get write same and cmpxchg block operations, we added librados operations with similar semantics and implement them there. It is unlikely that passing a complex operation down to the SCSI layer will work in unison with the other steps involved in committing an operation (e.g., updating metadata indicating the object version has changed).

sage

author
#3 lore raw
In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig <hch <at> infradead.org> writes:

Short answer is: don't do it. Use the SES interface for your example, or ensure a proper API exists if the example was just made up. --
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo <at> vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Thanks Christoph. Power cycling of drive was an example of how some of the management IOCTLs provided by the SCSI LLD driver could be used. So your suggestion is dont' use ceph for this purpose(though its possible) but write or use an existing utility(if HBA vendor provides one) that issues IOCTLs to the SCSI/SAS LLD HBA driver directly?

Related question is if a device like /dev/sda[1..n] is assigned a OSD and is being used by ceph can another user application continue to open and read/write to the /dev/sda1 device directly. How ceph prevents such scenarios?

thanks,
Naveen

author
#5 lore raw
In reply to Sage Weil
Quoted 3 lines · Sage Weil <sage <at> newdream.net> writes:
Quoted 3 lines
Quoted 3 lines

My question is:
The SCSI LLD would support both read /write entry points for I/O requests issued by the filesystem/block I/O but they also support

some

Quoted 1 line
Quoted 1 line
Quoted 1 line

custom requests using IOCTLs. So how can ceph support issuing of

such

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IOCTL requests to the device if user issues such request. Say for example power cycling the drive etc. It can also be a passthro

request

Quoted 6 lines
Quoted 1 line
Quoted 1 line

down to the device.

Can you give an example of such an operation?

In general, any operation is generalized at the librados level. For example, in order to get write same and cmpxchg block operations,

we

Quoted 1 line

added librados operations with similar semantics and implement them

there.

Quoted 9 lines

It is unlikely that passing a complex operation down to the SCSI layer will work in unison with the other steps involved in committing an operation (e.g., updating metadata indicating the object version has changed).

sage

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"

in

Quoted 4 lines

the body of a message to majordomo <at> vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Thanks for the response Sage. Example IOCTL operations would be like downloading a new FW to the drive/HBA, task management requests like Hard reset, power cycling the drive, issue a SAS/SMP/STP pass thro command to the drive for querying etc. All these would have to be initiated and go through ceph (if supported) and not bypassing it.

I asked a related question in another post too: Can a physical disk (/dev/sda1) assigned to a ceph OSD object be continued to used by other apps in the system to issue I/O directly via (/dev/sda1) interface? Does ceph prevent it, as such operations may corrupt data?

Thanks in advance,
naveen

#6 lore raw
Quoted 36 lines · Naveen
Quoted 3 lines · Sage Weil <sage <at> newdream.net> writes:
Quoted 3 lines
Quoted 3 lines

My question is:
The SCSI LLD would support both read /write entry points for I/O requests issued by the filesystem/block I/O but they also support

some

Quoted 1 line
Quoted 1 line
Quoted 1 line

custom requests using IOCTLs. So how can ceph support issuing of

such

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IOCTL requests to the device if user issues such request. Say for example power cycling the drive etc. It can also be a passthro

request

Quoted 6 lines
Quoted 1 line
Quoted 1 line

down to the device.

Can you give an example of such an operation?

In general, any operation is generalized at the librados level. For example, in order to get write same and cmpxchg block operations,

we

Quoted 1 line

added librados operations with similar semantics and implement them

there.

Quoted 9 lines

It is unlikely that passing a complex operation down to the SCSI layer will work in unison with the other steps involved in committing an operation (e.g., updating metadata indicating the object version has changed).

sage

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"

in

Quoted 4 lines

the body of a message to majordomo <at> vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 5 lines

Thanks for the response Sage. Example IOCTL operations would be like downloading a new FW to the drive/HBA, task management requests like Hard reset, power cycling the drive, issue a SAS/SMP/STP pass thro command to the drive for querying etc. All these would have to be initiated and go through ceph (if supported) and not bypassing it.

Ah. I think these kind of management functions should be performed while the ceph-osd daemon for that drive is offline. We would probably want some hardware management layer that coexists with ceph or that perhaps has some minimal integration with the ceph osds to do this sort of thing. It's not something that a client (user) would initiate, though.

Quoted 4 lines

I asked a related question in another post too: Can a physical disk (/dev/sda1) assigned to a ceph OSD object be continued to used by other apps in the system to issue I/O directly via (/dev/sda1) interface? Does ceph prevent it, as such operations may corrupt data?

It depends on what privileges the other app has. If it's root or user ceph, it can step all over the disk (and the rest of the system) and wreak havoc. With the current backend, we are storing data as files, so you could have other apps using other directories on the file system--this is generally a bad idea for real deployments, though, as performance and disk utilization will be unpredictable.

sage

#7 lore raw
Quoted 43 lines · Sage Weil
Quoted 36 lines · Naveen
Quoted 3 lines · Sage Weil <sage <at> newdream.net> writes:
Quoted 3 lines
Quoted 3 lines

My question is:
The SCSI LLD would support both read /write entry points for I/O requests issued by the filesystem/block I/O but they also support

some

Quoted 1 line
Quoted 1 line
Quoted 1 line

custom requests using IOCTLs. So how can ceph support issuing of

such

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IOCTL requests to the device if user issues such request. Say for example power cycling the drive etc. It can also be a passthro

request

Quoted 6 lines
Quoted 1 line
Quoted 1 line

down to the device.

Can you give an example of such an operation?

In general, any operation is generalized at the librados level. For example, in order to get write same and cmpxchg block operations,

we

Quoted 1 line

added librados operations with similar semantics and implement them

there.

Quoted 9 lines

It is unlikely that passing a complex operation down to the SCSI layer will work in unison with the other steps involved in committing an operation (e.g., updating metadata indicating the object version has changed).

sage

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"

in

Quoted 4 lines

the body of a message to majordomo <at> vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 5 lines

Thanks for the response Sage. Example IOCTL operations would be like downloading a new FW to the drive/HBA, task management requests like Hard reset, power cycling the drive, issue a SAS/SMP/STP pass thro command to the drive for querying etc. All these would have to be initiated and go through ceph (if supported) and not bypassing it.

Quoted 5 lines

Ah. I think these kind of management functions should be performed while the ceph-osd daemon for that drive is offline. We would probably want some hardware management layer that coexists with ceph or that perhaps has some minimal integration with the ceph osds to do this sort of thing. It's not something that a client (user) would initiate, though.

This is all pretty relevant to Joe Handzik's stuff:
https://github.com/joehandzik/ceph/commits/wip-hw-mgmt-cli
http://www.spinics.net/lists/ceph-devel/msg30126.html

The idea there though is to enable passing libstoragemgmt calls through the OSD, as opposed to arbitrary SCSI operations.

Although libstoragemgmt is fairly young, I'm a fan of the idea that we could use it internally within Ceph, and then have the same tools/libs used by out-of-ceph management platforms when they want to do equivalent stuff while the OSD is offline.

John

Quoted 17 lines
Quoted 4 lines

I asked a related question in another post too: Can a physical disk (/dev/sda1) assigned to a ceph OSD object be continued to used by other apps in the system to issue I/O directly via (/dev/sda1) interface? Does ceph prevent it, as such operations may corrupt data?

It depends on what privileges the other app has. If it's root or user ceph, it can step all over the disk (and the rest of the system) and wreak havoc. With the current backend, we are storing data as files, so you could have other apps using other directories on the file system--this is generally a bad idea for real deployments, though, as performance and disk utilization will be unpredictable.

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

I was intentionally staying quiet to hear other opinions, but I agree that the same mechanisms I'm building for LED operations could extend here (within Ceph of we want it to, but at the very least in libstoragemgmt).

Naveen, if you have interest in helping push this along I'd encourage you to voice your interest over on the libstoragemgmt GitHub: https://github.com/libstorage/libstoragemgmt

Joe

Quoted 86 lines · John Spray
Quoted 43 lines · Sage Weil
Quoted 32 lines · Naveen
Quoted 3 lines · Sage Weil <sage <at> newdream.net> writes:
Quoted 3 lines
Quoted 3 lines

My question is:
The SCSI LLD would support both read /write entry points for I/O requests issued by the filesystem/block I/O but they also support

some

Quoted 1 line
Quoted 1 line
Quoted 1 line

custom requests using IOCTLs. So how can ceph support issuing of

such

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IOCTL requests to the device if user issues such request. Say for example power cycling the drive etc. It can also be a passthro

request

Quoted 6 lines
Quoted 1 line
Quoted 1 line

down to the device.

Can you give an example of such an operation?

In general, any operation is generalized at the librados level. For example, in order to get write same and cmpxchg block operations,

we

Quoted 1 line

added librados operations with similar semantics and implement them

there.

Quoted 9 lines

It is unlikely that passing a complex operation down to the SCSI layer will work in unison with the other steps involved in committing an operation (e.g., updating metadata indicating the object version has changed).

sage

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"

in

Quoted 8 lines
Quoted 2 lines

the body of a message to majordomo <at> vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Thanks for the response Sage. Example IOCTL operations would be like downloading a new FW to the drive/HBA, task management requests like Hard reset, power cycling the drive, issue a SAS/SMP/STP pass thro command to the drive for querying etc. All these would have to be initiated and go through ceph (if supported) and not bypassing it.

Quoted 5 lines

Ah. I think these kind of management functions should be performed while the ceph-osd daemon for that drive is offline. We would probably want some hardware management layer that coexists with ceph or that perhaps has some minimal integration with the ceph osds to do this sort of thing. It's not something that a client (user) would initiate, though.

This is all pretty relevant to Joe Handzik's stuff:
https://github.com/joehandzik/ceph/commits/wip-hw-mgmt-cli
http://www.spinics.net/lists/ceph-devel/msg30126.html

The idea there though is to enable passing libstoragemgmt calls through the OSD, as opposed to arbitrary SCSI operations.

Although libstoragemgmt is fairly young, I'm a fan of the idea that we could use it internally within Ceph, and then have the same tools/libs used by out-of-ceph management platforms when they want to do equivalent stuff while the OSD is offline.

John

Quoted 12 lines
Quoted 4 lines

I asked a related question in another post too: Can a physical disk (/dev/sda1) assigned to a ceph OSD object be continued to used by other apps in the system to issue I/O directly via (/dev/sda1) interface? Does ceph prevent it, as such operations may corrupt data?

It depends on what privileges the other app has. If it's root or user ceph, it can step all over the disk (and the rest of the system) and wreak havoc. With the current backend, we are storing data as files, so you could have other apps using other directories on the file system--this is generally a bad idea for real deployments, though, as performance and disk utilization will be unpredictable.

Quoted 5 lines

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#9 lore raw
Quoted 2 lines · Handzik, Joseph <joseph.t.handzik <at> hpe.com> writes:

I was intentionally staying quiet to hear other opinions, but I agree

that the same mechanisms I'm building

Quoted 1 line

for LED operations could extend here (within Ceph of we want it to,

but at the very least in libstoragemgmt).

Quoted 2 lines

Naveen, if you have interest in helping push this along I'd encourage

you to voice your interest over on the

Quoted 13 lines

libstoragemgmt GitHub: https://github.com/libstorage/libstoragemgmt

Joe

Quoted 9 lines

This is all pretty relevant to Joe Handzik's stuff:
https://github.com/joehandzik/ceph/commits/wip-hw-mgmt-cli
http://www.spinics.net/lists/ceph-devel/msg30126.html

The idea there though is to enable passing libstoragemgmt calls through the OSD, as opposed to arbitrary SCSI operations.

Although libstoragemgmt is fairly young, I'm a fan of the idea that

we

Quoted 1 line
Quoted 1 line

could use it internally within Ceph, and then have the same

tools/libs

Quoted 7 lines
Quoted 7 lines

used by out-of-ceph management platforms when they want to do equivalent stuff while the OSD is offline.

John

Quoted 1 line
Quoted 1 line

I asked a related question in another post too: Can a physical

disk

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

(/dev/sda1) assigned to a ceph OSD object be continued to used by

other

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

apps in the system to issue I/O directly via (/dev/sda1)

interface? Does

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

ceph prevent it, as such operations may corrupt data?

It depends on what privileges the other app has. If it's root or

user

Quoted 1 line
Quoted 1 line
Quoted 1 line

ceph, it can step all over the disk (and the rest of the system)

and wreak

Quoted 1 line
Quoted 1 line
Quoted 1 line

havoc. With the current backend, we are storing data as files, so

you

Quoted 1 line
Quoted 1 line
Quoted 1 line

could have other apps using other directories on the file system--

this is

Quoted 1 line
Quoted 1 line
Quoted 1 line

generally a bad idea for real deployments, though, as performance

and disk

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

utilization will be unpredictable.

sage

Thanks everyone for the inputs and clarifications. Looks like libstoragemgmt is key to lot of these feature. Will explore that next and add if any questions in the git.

thanks,
naveen