idnits 2.17.1 draft-faibish-nfsv4-pnfs-lustre-layout-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 19) being 64 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. ** There are 2 instances of too long lines in the document, the longest one being 4 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 539 has weird spacing: '... char lmm_p...' == Line 744 has weird spacing: '... string lp_...' -- The document date (November 5, 2013) is 3823 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: None ---------------------------------------------------------------------------- == Missing Reference: '0' is mentioned on line 541, but not defined == Unused Reference: '11' is defined on line 839, but no explicit reference was found in the text ** Obsolete normative reference: RFC 5661 (ref. '8') (Obsoleted by RFC 8881) Summary: 3 errors (**), 0 flaws (~~), 6 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 NFSv4 Working Group S. Faibish 2 Internet-Draft P. Tao 3 Intended status: draft EMC Corporation 4 Expires: May 5, 2014 November 5, 2013 6 Parallel NFS (pNFS) Lustre Layout Operations 7 draft-faibish-nfsv4-pnfs-lustre-layout-06 9 Status of this Memo 11 This Internet-Draft is submitted to IETF in full conformance with 12 the provisions of BCP 78 and BCP 79. 14 Internet-Drafts are working documents of the Internet Engineering 15 Task Force (IETF), its areas, and its working groups. Note that 16 other groups may also distribute working documents as Internet- 17 Drafts. 19 Internet-Drafts are draft documents valid for a maximum of six 20 months and may be updated, replaced, or obsoleted by other documents 21 at any time. It is inappropriate to use Internet-Drafts as reference 22 material or to cite them other than as "work in progress." 24 The list of current Internet-Drafts can be accessed at 25 http://www.ietf.org/ietf/1id-abstracts.txt 27 The list of Internet-Draft Shadow Directories can be accessed at 28 http://www.ietf.org/shadow.html 30 This Internet-Draft will expire on November 5 2013. 32 Copyright Notice 34 Copyright (c) 2013 IETF Trust and the persons identified as the 35 document authors. All rights reserved. 37 This document is subject to BCP 78 and the IETF Trust's Legal 38 Provisions Relating to IETF Documents 39 (http://trustee.ietf.org/license-info) in effect on the date of 40 publication of this document. Please review these documents 41 carefully, as they describe your rights and restrictions with 42 respect to this document. Code Components extracted from this 43 document must include Simplified BSD License text as described in 44 Section 4.e of the Trust Legal Provisions and are provided without 45 warranty as described in the Simplified BSD License. 47 Abstract 49 Parallel NFS (pNFS) extends Network File System version 4.1(NFSv4.1) 50 to allow clients to directly access file data on the storage used by 51 the NFSv4.1 server. This ability to bypass the server for data 52 access can increase both performance and parallelism, but requires 53 additional client functionality for data access, some of which is 54 dependent on the class of storage used, a.k.a. the Layout Type. The 55 main pNFS operations and data types in NFSv4 Minor version 1 specify 56 a layout-type-independent layer; layout-type-specific information is 57 conveyed using opaque data structures whose internal structure is 58 further defined by the particular layout type specification. This 59 document specifies the NFSv4.1 Lustre pNFS Layout Type as a 60 companion to the main NFSv4 Minor version 1 specification. 62 Table of Contents 64 1. Introduction...................................................3 65 1.1. pNFS Lustre Layout Protocol...............................3 66 1.2. General Definitions.......................................5 67 1.3. Lustre Protocol Description...............................6 68 2. Conventions Used in this Document..............................7 69 3. XDR Description of the Lustre-Based Layout Protocol............7 70 3.1. Code Components Licensing Notice..........................7 71 4. Basic Data Type Definitions....................................9 72 4.1. pnfs_los_object_cred4.....................................9 73 4.2. Data Stripping Algorithms................................11 74 5. Object Storage Server Addressing and Discovery................11 75 5.1. pnfs_los_targetid_type4..................................11 76 5.2. pnfs_los_deviceaddr4.....................................12 77 5.2.1. OSS Target Identifier...............................12 78 5.2.2. Device Network Address..............................12 79 6. Lustre-Based Layout...........................................12 80 6.1. pnfs_lov_mds_md..........................................13 81 6.2. pnfs_los_layout4.........................................15 82 6.3. Data Mapping Schemes.....................................16 83 6.3.1. Simple Striping.....................................16 84 6.4. RAID Algorithms..........................................18 85 6.4.1. PNFS_OST_RAID_0.....................................18 86 6.4.2. PNFS_OST_RAID_1.....................................18 88 7. Lustre-Based Creation Layout Hint.............................18 89 7.1. pnfs_los_layouthint4.....................................19 90 8. IANA Considerations...........................................20 91 9. References....................................................20 92 9.1. Normative References.....................................20 93 Authors' Addresses...............................................22 95 1. Introduction 97 1.1. pNFS Lustre Layout Protocol 99 Figure 1 shows the overall architecture of a Parallel NFS (pNFS) 100 Protocol ([8]) system: 102 +-----------+ 103 |+-----------+ +-----------+ 104 ||+-----------+ | | 105 ||| | NFSv4.1 + pNFS | | 106 +|| Clients |<------------------------------>| MDS | 107 +| | | | 108 +-----------+ | | 109 ||| +-----------+ 110 ||| | 111 ||| | 112 ||| Storage +-----------+ | 113 ||| Protocol |+-----------+ | 114 ||+----------------||+-----------+ Control | 115 |+-----------------||| | Protocol | 116 +------------------+|| Storage |------------+ 117 +| Devices | 118 +-----------+ 120 Figure 1 pNFS Architecture 122 In this document, "storage device" is used as a general term for a 123 data server and/or storage server for all pNFS layouts. The 124 MetaData Server (MDS) is the NFSv4.1 server that provides pNFS 125 layouts to clients and handles operations on file metadata (e.g., 126 names, attributes). 128 In pNFS, the file server returns typed layout structures that 129 describe where file data is located. There are different layouts for 130 different storage systems and methods of arranging data on storage 131 devices. This document describes the layouts used with Lustre object 132 storage servers (OSSs) that are accessed according to the Lustre 133 storage protocol ([1]). 135 The pNFS Lustre layout protocol uses Lustre file system protocols as 136 data storage protocol. Implementation-wise, on both pNFS client and 137 server, the pNFS Lustre layout can live as a shim layer on top of 138 Lustre client and server, as shown in Figure 2. 140 +-----------+ 141 | +----------+ +-----------+ 142 | | Generic | NFSv4.1 + pNFS | Generic | 143 | | pNFS |<---------------------------->| pNFS | 144 | | Client | | Server | 145 | +----------+ +-----------+ 146 | | pNFS | | pNFS | 147 | | Lustre | | Lustre | 148 | | Layout | | Layout | 149 | | Client | | Server | 150 | | Driver | | Driver | 151 | +----------+ +-----------+ 152 | | Lustre | | Lustre | 153 + | Client | | MDS | 154 +----------+ +-----------+ 155 | | | | 156 | | | | 157 | | | | 158 | | | | 159 | | | | 160 | | Lustre +-------------+ Lustre | | 161 | | Protocol | +------------+ Protocol | | 162 | +------------| | |------------+ | 163 +--------------| | Lustre OSS |--------------+ 164 + | | 165 +------------+ 167 Figure 2 pNFS Lustre client/server Architecture 169 1.2. General Definitions 171 The following definitions provide an appropriate context for the 172 reader. 174 +-----------------+------------------------------------------------+ 175 | Lustre module | Description | 176 +-----------------+------------------------------------------------+ 177 | OST | Object Storage Targets are SCSI LUNs which | 178 | | store file data objects | 179 | | | 180 | OSS | An Object Storage Sever implements the Lustre | 181 | | data protocol and serves data | 182 | | | 183 | OSC | An Object Storage Client [10] is a client of | 184 | | the Lustre object services | 185 | | | 186 | LOV | LOV is the Lustre Object Volume [10]. It | 187 | | interprets stripe information and directs pages| 188 | | to the correct OSCs. | 189 | | | 190 | MDT | A Metadata Target is a SCSI LUN that stores | 191 | | file metadata | 192 | | | 193 | MDS | A Metadata Sever implements the Lustre | 194 | | metadata server control protocol | 195 | | | 196 | MDC | A Metadata Client of Lustre protocol services | 197 | | | 198 | LDLM | The Lustre Distributed Lock Manager (LDLM) [11]| 199 | | provides a means to ensure that data is updated| 200 | | in a consistent fashion across multiple nodes. | 201 | | | 202 | PTLRPC | The Portal RPC subsystem [12] is a reliable | 203 | | messaging service layered on top of LNET. It | 204 | | caters for small messages and also for bulk | 205 | | data transfers. | 206 | | | 207 | LNET | LNET is the Lustre Networking sub-system [13]. | 208 | | It hides differences of underlying network | 209 | | types and provides common APIs to LNET users. | 210 | | | 211 | LND | LND is the Lustre Network Driver layer [13]. It| 212 | | implements the interface between the generic | 213 | | LNET layer and the drivers for the specific | 214 | | network types. | 215 +-----------------+------------------------------------------------+ 217 1.3. Lustre Protocol Description 219 Lustre is an object-based file system. It is composed of three 220 components: Metadata servers (MDSs), object storage servers (OSSs), 221 and Lustre clients. 223 Lustre uses block devices (SCSI LUNs) for file data storage (OST) 224 and metadata storages (MDT) and each block device can be managed by 225 only one Lustre server (OSS). The total data capacity of the Lustre 226 filesystem is the sum of all individual OST capacities. Lustre 227 clients access and concurrently use data through the standard POSIX 228 I/O system calls. 230 A Lustre MDS provides metadata services. One Lustre MDS manages one 231 metadata target (MDT). Each MDT stores file metadata, such as file 232 names, directory structures, and access permissions. An OSS exposes 233 block devices and serves data. Each OSS manages one or more object 234 storage targets (OSTs), and OSTs store file data "objects". 236 The Lustre protocol specifies several operations on objects, 237 including OPEN, READ, WRITE, GET ATTRIBUTES, SET ATTRIBUTES, CREATE, 238 and DELETE. However, using the Lustre layout the Lustre client only 239 uses the OPEN, READ, WRITE and GET ATTRIBUTES commands. The other 240 commands are only used by the Lustre server. 242 A Lustre file object's layout information is defined in the extended 243 attribute (EA) of the inode. Essentially, EA describes the mapping 244 between file object identifier and its corresponding OSTs. This 245 information is also known as striping. A Lustre-based layout for 246 pNFS includes object identifiers, capabilities that allow pNFS 247 clients to READ or WRITE those objects, and various parameters that 248 control how file data is striped across OSTs. 250 This document specifies the NFSv4.1 layout protocol and operations 251 for Lustre filesystems ([1]). 253 2. Conventions Used in this Document 255 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 256 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 257 document are to be interpreted as described in RFC-2119 [6]. 259 3. XDR Description of the Lustre-Based Layout Protocol 261 This document contains the external data representation (XDR [2]) 262 description of the NFSv4.1 objects layout protocol. The XDR 263 description is embedded in this document in a way that makes it 264 simple for the reader to extract into a ready-to-compile form. The 265 reader can feed this document into the following shell script to 266 produce the machine readable XDR description of the NFSv4.1 Lustre 267 layout protocol: 269 #!/bin/sh 270 grep '^ *///' $* | sed 's?^ */// ??' | sed 's?^ *///$??' 272 That is, if the above script is stored in a file called 273 "extract.sh", and this document is in a file called "spec.txt", then 274 the reader can do: 276 sh extract.sh < spec.txt > pnfs_lustre_prot.x 278 The effect of the script is to remove leading white space from each 279 line, plus a sentinel sequence of "///". 281 The embedded XDR file header follows. Subsequent XDR descriptions, 282 with the sentinel sequence are embedded throughout the document. 284 Note that the XDR code contained in this document depends on types 285 from the NFSv4.1 nfs4_prot.x file ([3]). This includes both nfs 286 types that end with a 4, such as offset4, length4, etc., as well as 287 more generic types such as uint32_t and uint64_t. 289 3.1. Code Components Licensing Notice 291 The XDR description, marked with lines beginning with the sequence 292 "///", as well as scripts for extracting the XDR description are 293 Code Components as described in Section 4 of "Legal Provisions 294 Relating to IETF Documents" [4]. These Code Components are licensed 295 according to the terms of Section 4 of "Legal Provisions Relating to 296 IETF Documents". 298 /// /* 299 /// * Copyright (c) 2013 IETF Trust and the persons identified 300 /// * as authors of the code. All rights reserved. 301 /// * 302 /// * Redistribution and use in source and binary forms, with 303 /// * or without modification, are permitted provided that the 304 /// * following conditions are met: 305 /// * 306 /// * o Redistributions of source code must retain the above 307 /// * copyright notice, this list of conditions and the 308 /// * following disclaimer. 309 /// * 310 /// * o Redistributions in binary form must reproduce the above 311 /// * copyright notice, this list of conditions and the 312 /// * following disclaimer in the documentation and/or other 313 /// * materials provided with the distribution. 314 /// * 315 /// * o Neither the name of Internet Society, IETF or IETF 316 /// * Trust, nor the names of specific contributors, may be 317 /// * used to endorse or promote products derived from this 318 /// * software without specific prior written permission. 319 /// * 320 /// * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 321 /// * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 322 /// * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 323 /// * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 324 /// * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 325 /// * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 326 /// * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 327 /// * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 328 /// * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 329 /// * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 330 /// * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 331 /// * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 332 /// * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 333 /// * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 334 /// * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 335 /// * 336 /// * Please reproduce this note if possible. 337 /// */ 338 /// 339 /// /* 340 /// * pnfs_lustre_prot.x 341 /// */ 342 /// 343 /// %#include 344 /// 346 4. Basic Data Type Definitions 348 The following sections define basic data types and constants used by 349 the Lustre Layout protocol. 351 4.1. pnfs_los_object_cred4 353 /// enum pnfs_los_cap_key_sec4 { 354 /// PNFS_OSS_CAP_KEY_SEC_NONE = 0, 355 /// PNFS_OSS_CAP_KEY_SEC_SSV = 1 356 /// }; 357 /// 358 /// typedef uint64_t pnfs_los_objid4; 359 /// 360 /// struct pnfs_los_object_cred4 { 361 /// pnfs_los_objid4 ploc_object_id; 362 /// pnfs_los_cap_key_sec4 ploc_cap_key_sec; 363 /// opaque ploc_capability_key<>; 364 /// opaque ploc_capability<>; 365 /// }; 366 /// 368 Lustre PTLRPC supports GSS authentication. PTLRPC implements Lustre 369 communications over LNET ([1]). So "pnfs_los_object_cred4" is put 370 inside pnfs_los_layout4 so that if the network requires security, 371 credentials can be passed around. 373 The pnfs_los_object_cred4 structure is used to identify each 374 component comprising the file. The "ploc_object_id" identifies the 375 component object, the "ploc_capability_key" provide the OSS security 376 credentials needed to access that object. The "ploc_cap_key_sec" 377 value denotes the method used to secure the "ploc_capability_key". 379 To comply with the Lustre security requirements, the capability key 380 SHOULD be transferred securely to prevent eavesdropping. Therefore, 381 a client SHOULD either issue the LAYOUTGET or GETDEVICEINFO 382 operations via RPCSEC_GSS with the privacy service or previously 383 establish a secret state verifier (SSV) for the sessions via the 384 NFSv4.1 SET_SSV operation. The pnfs_los_cap_key_sec4 type is used to 385 identify the method used by the server to secure the capability key. 387 o PNFS_OSS_CAP_KEY_SEC_NONE denotes that the "ploc_capability_key" 388 is not encrypted, in which case the client SHOULD issue the 389 LAYOUTGET or GETDEVICEINFO operations with RPCSEC_GSS with the 390 privacy service or the NFSv4.1 transport should be secured by 391 using methods that are external to NFSv4.1 like the use of IPsec 392 ([5]) for transporting the NFSV4.1 protocol. 394 o PNFS_OSS_CAP_KEY_SEC_SSV denotes that the "ploc_capability_key" 395 contents are encrypted using the SSV GSS context and the 396 capability key as inputs to the GSS_Wrap() function (see GSS-API 397 [7]) with the conf_req_flag set to TRUE. The client MUST use the 398 secret SSV key as part of the client's GSS context to decrypt the 399 capability key using the value of the lc_capability_key field as 400 the input_message to the GSS_unwrap() function. Note that to 401 prevent eavesdropping of the SSV key, the client SHOULD issue 402 SET_SSV via RPCSEC_GSS with the privacy service. 404 The actual method chosen depends on whether the client established a 405 SSV key with the server and whether it issued the operation with the 406 RPCSEC_GSS privacy method. Naturally, if the client did not 407 establish an SSV key via SET_SSV, the server MUST use the 408 PNFS_OSS_CAP_KEY_SEC_NONE method. Otherwise, if the operation was 409 not issued with the RPCSEC_GSS privacy method, the server SHOULD 410 secure the "ploc_capability_key" with the PNFS_OSS_CAP_KEY_SEC_SSV 411 method. The server MAY use the PNFS_OSS_CAP_KEY_SEC_SSV method also 412 when the operation was issued with the RPCSEC_GSS privacy method. 414 4.3. Data Stripping Algorithms 416 Currently only RAID0 is supported but Lustre defines RAID1 as well. 418 /// const LOV_PATTERN_RAID0 = 0x001 419 /// /* stripes are used round-robin */ 420 /// const LOV_PATTERN_RAID1 = 0x002 421 /// /* stripes are mirrors of each other */ 423 5. Object Storage Server Addressing and Discovery 425 Data operations to an OSS require the client to know the "address" 426 of each OSS's root object. The OSS exposes block devices and serves 427 data. Correspondingly, OSC is client of the services. Each OSS 428 manages one or more OSTs, and OSTs store file data objects. Because 429 these representations are local, GETDEVICEINFO must return 430 information that can be used by the client to select the correct 431 local representation. 433 5.1. pnfs_los_targetid_type4 435 The following enum specifies the manner in which an OST can be 436 specified. The target can be specified by the network access 437 protocol type used. 439 /// enum pnfs_los_targetid_type4 { 440 /// LOS_TARGET_TCP = 1, 441 /// LOS_TARGET_IB = 2 442 /// }; 444 Where: 445 o LOS_TARGET_TCP denotes use of the TCP protocol 447 o LOS_TARGET_IB denotes use of the IB protocol 449 Only TCP and IB are defined because these are the two most widely 450 used networks in High Performance Computing deployments. 452 5.2. pnfs_los_deviceaddr4 454 The specification (according to [9]) for an object device address is 455 as follows: 457 /// struct pnfs_los_deviceaddr4 { 458 /// netaddr4 lda_targetid; 459 /// opaque lda_ossname<>; 460 /// }; 462 5.2.1. OSS Target Identifier 464 When "lda_targetid" is specified the opaque field MUST be formatted 465 as the LOS name. 467 5.2.2. Device Network Address 469 The network address is given with the netaddr4 type, which specifies 470 a TCP/IP or IB based endpoint (as specified in NFSv4.1 [3]). When 471 given, the client SHOULD use it to probe for the OSS device at the 472 given network address. The client MAY still use other discovery 473 mechanisms to locate the device using the "lda_targetid". In 474 particular, an external name service (external to data protocol 475 coming from LNET) SHOULD be used when the devices may be attached to 476 the network using multiple connections, and/or multiple storage 477 fabrics (e.g., TCP or IB). 479 6. Lustre-Based Layout 481 The layout4 type is defined in the NFSv4.1 ([3]) as follows: 483 enum layouttype4 { 484 LAYOUT4_NFSV4_1_FILES= 0x1, 485 LAYOUT4_OSD2_OBJECTS = 0x2, 486 LAYOUT4_BLOCK_VOLUME = 0x3, 487 LAYOUT4_OSS_OBJECTS = 0x0BD30BD4 /* Tentatively */ 488 }; 490 struct layout_content4 { 491 layouttype4 loc_type; 492 opaque loc_body<>; 493 }; 495 struct layout4 { 496 offset4 lo_offset; 497 length4 lo_length; 498 layoutiomode4 lo_iomode; 499 layout_content4 lo_content; 500 }; 502 This document defines structure associated with the layouttype4 503 value, LAYOUT4_OSS_OBJECTS. The NFSv4.1 ([3]) specifies the 504 loc_body structure as an XDR type "opaque". The opaque layout is 505 uninterpreted by the generic pNFS client layers, but obviously must 506 be interpreted by the Lustre storage layout driver. This section 507 defines the structure of this opaque value, "pnfs_oss_layout4". 509 6.1. pnfs_lov_mds_md 511 There are two kinds of MDS metadata in the Lustre protocol. For pNFS, 512 it is decided to only support V3 that is in use since Lustre 2.0 release. 513 The other V1 metadata is not considered to be supported in this draft. 515 These are the key file mapping data structures. "pnfs_lov_ost_data" 516 is per-stripe data structure. "lov_mds_md" is per file data 517 structure. 519 /// struct pnfs_lov_ost_data4 { /* per-stripe data structure */ 520 /// uint64_t l_object_id; /* OST object ID */ 521 /// uint64_t l_object_seq; /* OST object seq number */ 522 /// uint32_t l_ost_gen; 523 /// /* generation of this l_ost_idx */ 524 /// uint32_t l_ost_idx; 525 /// /* OST index in LOV (lov_tgt_desc->tgts) */ 526 /// }; 527 /// 528 /// #define LOV_MAXPOOLNAME 16 529 /// 530 /// struct pnfs_lov_mds_md { /* LOV EA mds/wire data */ 531 /// uint32_t lmm_pattern; 532 /// /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */ 533 /// uint64_t lmm_object_id; /* LOV object ID */ 534 /// uint64_t lmm_object_seq; /* LOV object seq number */ 535 /// uint32_t lmm_stripe_size; /* size of stripe in bytes */ 536 /// uint16_t lmm_stripe_count; 537 /// /* num stripes in use for this object */ 538 /// uint16_t lmm_layout_gen; /* layout generation number */ 539 /// char lmm_pool_name[LOV_MAXPOOLNAME]; 540 /// /* must be 32bit aligned */ 541 /// pnfs_lov_ost_data4 lmm_objects[0]; /*per-stripe data*/ 542 /// }; 543 /// 545 The pnfs_"pnfs_lov_ost_data4" structure parameterizes the algorithm 546 that maps a file's contents over the component OST's. 548 The "pnfs_lov_ost_data4" is a per stripe data structure that defines 549 the location of the stripe in OST and which OST holds the data. 551 "l_object_id" holds the file data's object ID on the OST. 553 "l_object_seq" holds the object sequence number which is always 0. 554 "l_ost_idx" holds the OST's index in LOV, and "l_ost_gen" holds the 555 OST's index generation. 557 The "lmm_pattern" holds the file's stripping pattern. It can be 558 either LOV_PATTERN_RAID0 or LOV_PATTERN_RAID1. "lmm_object_id" holds 559 the MDS object ID. "lmm_object_seq" holds the LOV object sequence 560 number. 562 "lmm_stripe_size" holds the stripe size in bytes. A file is striped 563 across multiple OSTs in the same stripe size. The "lmm_stripe_count" 564 holds the number of OSTs over which the file is striped. 566 "llm_layout_gen" holds the generation of current layout information. 567 Clients need to obtain layout generation before IO and check layout 568 generation after IO. If layout generation is changed, client needs 569 to redo the operations. 571 The "lmm_objects" is an array of "lmm_stripe_count" members 572 containing per OST file information. Each element is in form of 573 struct "pnfs_lov_ost_data". 575 6.2. pnfs_los_layout4 577 The following is the opaque data in generic layout. 579 /// struct pnfs_los_layout4 { 580 /// pnfs_lov_mds_md lov_mds_md; 581 /// pnfs_los_object_cred4 llo_component; 582 /// }; 583 /// 584 The "llo_component" is of type "pnfs_los_object_cred4", containing 585 credentials that Lustre client needs to use to connect to OSS's. 587 Note that the layout depends on the file size, which the client 588 learns, by doing GETATTR commands to the pNFS metadata server. 590 The pNFS client uses the file size to decide if it should return a 591 short read of the file when trying to read beyond the file size. 593 6.3. Data Mapping Schemes 595 This section describes the different data mapping schemes in detail. 596 The Lustre layout always uses a "dense" layout as described in 597 NFSv4.1 ([3]). This means that the second stripe unit of the file 598 starts at offset 0 of the second component, rather than at offset 599 stripe_unit bytes. After a full stripe has been written, the next 600 stripe unit is appended to the first component object in the list 601 without any holes in the component objects. From the MDS point of 602 view, each file is composed of multiple data objects striped on one 603 or more OSTs. 605 6.3.1. Simple Striping 607 A file object's layout information is defined in the extended 608 attribute (EA) of the inode. Essentially, EA describes the mapping 609 between file object id and its corresponding OSTs. 611 For example, if file A has a stripe count of three, then its EA will 612 look like: 614 EA ---> 615 616 617 stripe size and stripe width 619 In the above equation obj_id is the object identifier of a file 620 fragment on the ost p, "stripe size" is the size of each file 621 segment on one OST and "stripe width" is the number of OST's used. 622 So if the "stripe size" is 1MB, and the "stripe width" is 3, then 623 this would mean that: [0,1M), [4M,5M), ... are stored as object x, 624 which is on OST p; [1M, 2M), [5M, 6M), ... are stored as object y, 625 which is on OST q; [2M,3M), [6M, 7M), ... are stored as object z, 626 which is on OST r. 628 Before reading the file, the pNFS client will query the pNFS MDS and 629 be informed that it should talk to for this 630 operation. This information is structured in so-called LSM, and 631 Lustre client side LOV (logical object volume) is to interpret this 632 information so Lustre client can send requests to OSTs. Here again, 633 the Lustre client communicates with OST through a client module 634 interface known as OSC. Depending on the context, OSC can also be 635 used to refer to an OSS client by itself. 637 The mapping from the logical offset within a file (L) to the 638 component object C and object-specific offset O is defined by the 639 following equations: 641 L = logical offset into the file 642 W = stripe width 643 S = stripe size 644 C = (L-L%S)%W 645 O = L/W/S+L%S 647 In these equations, S is the number of bytes in a full stripe or 648 stripe size. C is an index into the array of components, so it 649 selects a particular OST device. C count starts from zero. O is the 650 offset within the OST that corresponds to the file offset. Note that 651 this computation does accommodate the fact that an object includes 652 all the file segments that are located on same OST. 654 For example, consider an object striped over three devices, 655 . The stripe size is 1024KB. The stripe width W is 656 thus 3. 658 Offset 0KB: 659 C = (0-0%1)%3 = 0 (OST0) 660 O = 0/3/1024 + (0%1024) = 0 662 Offset 1024KB: 663 C = (1024-(1024%1024))%3 = 1 (OST1) 664 O = 1024/3/1024 +(1024%1024) = 0 666 Offset 9000KB: 667 C = (9000-(9000%1024))%3 = 2 (OST2) 668 O = 9000/3/1024 + (9000%1024) = 810 670 Offset 102400KB: 671 C = (102400-(102400%1024))%3 = 1 (OST0) 672 O = 102400/3/1024 + (102400%4096) = 33 674 6.4. RAID Algorithms 676 This section defines the different redundancy algorithms. Note: The 677 term "RAID" (Redundant Array of Independent Disks) is used in this 678 document to represent an array of component OST's that store data 679 for an individual file. The objects are stored on independent OST- 680 based storage devices. File data is encoded and striped across the 681 array of component OST's using algorithms developed for block-based 682 RAID systems. 684 6.4.1. PNFS_OST_RAID_0 686 PNFS_OST_RAID_0 means there is no parity data, so all bytes in the 687 component objects are data bytes located by the above equations for 688 C and O. 690 6.4.2. PNFS_OST_RAID_1 692 PNFS_OST_RAID_1 means there is no parity data, but each OST is 693 mirrored to another OST. In this case the component objects are data 694 bytes still located by the above equations for C and O, defined in 695 section 6.3.1. 697 7. Lustre-Based Creation Layout Hint 699 The layouthint4 type is defined in the NFSv4.1 ([3]) as follows: 701 struct layouthint4 { 702 layouttype4 loh_type; 703 opaque loh_body<>; 704 }; 706 The "layouthint4" structure is used by the client to pass a hint 707 about the type of layout it would like to be created for a 708 particular file. If the "loh_type" layout type is 709 LAYOUT4_OSS_OBJECTS, then the "loh_body" opaque value is defined by 710 the "pnfs_los_layouthint4" type. 712 7.1. pnfs_los_layouthint4 714 /// union pnfs_lov_stripe_count_hint4 switch (bool lsc_valid) { 715 /// case TRUE: 716 /// uint32_t lsc_stripe_count; 717 /// case FALSE: 718 /// void; 719 /// }; 720 /// 721 /// union pnfs_lov_stripe_size_hint4 switch (bool lss_valid) { 722 /// case TRUE: 723 /// uint32_t lss_stripe_size; 724 /// case FALSE: 725 /// void; 726 /// }; 727 /// 728 /// union pnfs_lov_stripe_offset_hint4 switch (bool lso_valid) { 729 /// case TRUE: 730 /// uint32_t lso_stripe_offset; 731 /// case FALSE: 732 /// void; 733 /// }; 734 /// 735 /// union pnfs_lov_stripe_pattern_hint4 switch (bool lsp_valid) { 736 /// case TRUE: 737 /// uint32_t lsp_stripe_pattern; 738 /// case FALSE: 739 /// void; 740 /// }; 741 /// 742 /// union pnfs_lov_pool_hint4 switch (bool lp_valid) { 743 /// case TRUE: 744 /// string lp_pool_name<>; 745 /// case FALSE: 746 /// void; 747 /// }; 748 /// 749 /// enum pnfs_lov_data_tier { 750 /// LOV_DATA_PRIMARY = 1; 751 /// LOV_DATA_SECONDARY = 2; 752 /// }; 753 /// 754 /// union pnfs_lov_data_tiering_hint4 switch (bool lp_valid) { 755 /// case TRUE: 756 /// ldt_data_tier; 757 /// case FALSE: 758 /// void; 759 /// }; 760 /// 761 /// struct pnfs_los_layouthint4 { 762 /// pnfs_lov_stripe_count_hint4 lov_stripe_count_hint; 763 /// pnfs_lov_stripe_size_hint4 lov_stripe_size_hint; 764 /// pnfs_lov_stripe_offset_hint4 lov_stripe_offset_hint; 765 /// pnfs_lov_stripe_pattern_hint4 lov_stripe_pattern_hint; 766 /// pnfs_lov_pool_hint4 lov_pool_hint; 767 /// pnfs_lov_data_tiering_hint4 lov_data_tiering_hint; 768 /// }; 769 /// 771 "pnfs_los_layouthint4" conveys hints for the desired data map. Hints 772 are indications of the client for preferences of the data stripe 773 type to be used for the file. All parameters are optional so the 774 client can give values for only the parameters it cares about. 776 "lov_stripe_count_hint", "lov_stripe_size_hint", 777 "lov_stripe_offset_hint" and "lov_stripe_pattern_hint" tells server 778 that client wants to create a file with corresponding stripe count, 779 stripe size, stripe offset and stripe pattern. "lov_pool_hint" tells 780 server that client wants to create a file within specific OST pool. 781 "lov_data_tiering_hint" tells server with tiering support, that if 782 client wants to store data in primary (usually fast) storage tier. 784 The server should make an attempt to honor the hints, but it can 785 ignore any or all of them at its own discretion and without failing 786 the respective CREATE operation. 788 8. IANA Considerations 790 As described in NFSv4.1 ([8]), new layout type numbers have been 791 assigned by IANA. This document defines the protocol associated 792 with a new layout type number, LAYOUT4_OSS_OBJECTS, and it requires 793 to be assigned a new value from IANA. 795 9. References 797 9.1. Normative References 799 [1] http://www.scribd.com/doc/59271212/Understanding-Lustre- 800 File-System-Internals. Lustre source code is hosted in 801 http://git.whamcloud.com/?p=fs/lustre- 802 release.git;a=summary. The Lustre client code is also in 803 process of being merged in Linux kernel. 804 https://git.kernel.org/cgit/linux/kernel/ 805 git/torvalds/linux.git/tree/drivers/staging 807 [2] Eisler, M., "XDR: External Data Representation Standard", 808 STD 67, RFC 4506, May 2006. 810 [3] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 811 "Network File System (NFS) Version 4 Minor Version 1 812 External Data Representation Standard (XDR) Description", 813 RFC 5662, January 2010. 815 [4] IETF Trust, "Legal Provisions Relating to IETF Documents", 816 November 2008, http://trustee.ietf.org/docs/IETF-Trust- 817 License-Policy.pdf. 819 [5] Kent, S. and K. Seo, "Security Architecture for the 820 Internet Protocol", RFC 4301, December 2005. 822 [6] Bradner, S., "Key words for use in RFCs to Indicate 823 Requirement Levels", BCP 14, RFC 2119, March 1997. 825 [7] Linn, J., "Generic Security Service Application Program 826 Interface Version 2, Update 1", RFC 2743, January 2000. 828 [8] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 829 "Network File System (NFS) Version 4 Minor Version 1 830 Protocol", RFC 5661, January 2010. 832 [9] Eisler, M., "IANA Considerations for Remote Procedure Call 833 (RPC) Network Identifiers and Universal Address Formats", 834 RFC 5665, January 2010. 836 [10] LOV and OSC. 837 http://wiki.lustre.org/lid/ulfi/ulfi_lov_osc.html 839 [11] Lustre Distributed Lock Manager. 840 http://wiki.lustre.org/lid/agi/agi_ldlm.html 842 [12] Portal RPC. http://wiki.lustre.org/lid/agi/agi_ptlrpc.html 844 [13] Lustre Networking. 845 http://wiki.lustre.org/lid/agi/agi_lnet.html 847 This document was prepared using 2-Word-v2.0.template.dot. 849 Authors' Addresses 851 Sorin Faibish (editor) 852 EMC Corporation 853 228 South Street 854 Hopkinton, MA 01748 855 US 857 Phone: +1 (508) 249-5745 858 Email: sfaibish@emc.com 860 Peng Tao 861 EMC Corporation 862 8F, Block D, SP Tower 863 Tsinghua Science Park 864 Zhongguancun Dong Road 865 Beijing 100084 866 PRC 868 Phone: +86 (10) 8215 8293 869 Email: tao.peng@emc.com