idnits 2.17.1 draft-faibish-nfsv4-pnfs-lustre-layout-02.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: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 537 has weird spacing: '... char lmm_p...' == Line 764 has weird spacing: '... string lp_...' -- The document date (November 5, 2012) is 4190 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 539, but not defined ** Obsolete normative reference: RFC 5661 (ref. '8') (Obsoleted by RFC 8881) Summary: 2 errors (**), 0 flaws (~~), 4 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, 2013 November 5, 2012 6 Parallel NFS (pNFS) Lustre Layout Operations 7 draft-faibish-nfsv4-pnfs-lustre-layout-02 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 April 5, 2013. 32 Copyright Notice 34 Copyright (c) 2012 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.......................................4 67 1.3. Lustre Protocol Description...............................4 68 2. Conventions Used in this Document..............................5 69 3. XDR Description of the Lustre-Based Layout Protocol............5 70 3.1. Code Components Licensing Notice..........................6 71 4. Basic Data Type Definitions....................................7 72 4.1. pnfs_lov_magic............................................7 73 4.2. pnfs_los_object_cred4.....................................8 74 4.3. Data Stripping Algorithms................................10 75 5. Object Storage Server Addressing and Discovery................10 76 5.1. pnfs_los_targetid_type4..................................10 77 5.2. pnfs_los_deviceaddr4.....................................10 78 5.2.1. OSS Target Identifier...............................11 79 5.2.2. Device Network Address..............................11 80 6. Lustre-Based Layout...........................................11 81 6.1. pnfs_lov_mds_md..........................................12 82 6.2. pnfs_los_layout4.........................................14 83 6.3. Data Mapping Schemes.....................................14 84 6.3.1. Simple Striping.....................................15 85 6.4. RAID Algorithms..........................................16 86 6.4.1. PNFS_OST_RAID_0.....................................17 87 6.4.2. PNFS_OST_RAID_1.....................................17 89 7. Lustre-Based Creation Layout Hint.............................17 90 7.1. pnfs_los_layouthint4.....................................17 91 8. IANA Considerations...........................................19 92 9. References....................................................19 93 9.1. Normative References.....................................19 94 Authors' Addresses...............................................20 96 1. Introduction 98 1.1. pNFS Lustre Layout Protocol 100 Figure 1 shows the overall architecture of a Parallel NFS (pNFS) 101 Protocol ([8]) system: 103 +-----------+ 104 |+-----------+ +-----------+ 105 ||+-----------+ | | 106 ||| | NFSv4.1 + pNFS | | 107 +|| Clients |<------------------------------>| MDS | 108 +| | | | 109 +-----------+ | | 110 ||| +-----------+ 111 ||| | 112 ||| | 113 ||| Storage +-----------+ | 114 ||| Protocol |+-----------+ | 115 ||+----------------||+-----------+ Control | 116 |+-----------------||| | Protocol | 117 +------------------+|| Storage |------------+ 118 +| Devices | 119 +-----------+ 121 Figure 1 pNFS Architecture 123 In this document, "storage device" is used as a general term for a 124 data server and/or storage server for all pNFS layouts. The 125 MetaData Server (MDS) is the NFSv4.1 server that provides pNFS 126 layouts to clients and handles operations on file metadata (e.g., 127 names, attributes). 129 In pNFS, the file server returns typed layout structures that 130 describe where file data is located. There are different layouts for 131 different storage systems and methods of arranging data on storage 132 devices. This document describes the layouts used with Lustre object 133 storage servers (OSSs) that are accessed according to the Lustre 134 storage protocol ([1]). 136 1.2. General Definitions 138 The following definitions provide an appropriate context for the 139 reader. 141 +-----------------+------------------------------------------------+ 142 | Lustre module | Description | 143 +-----------------+------------------------------------------------+ 144 | OST | Object Storage Targets are SCSI LUNs which | 145 | | store file data objects | 146 | | | 147 | OSS | An Object Storage Sever implements the Lustre | 148 | | data protocol and serves data | 149 | | | 150 | OSC | An Object Storage Client is a client of the | 151 | | Lustre services | 152 | | | 153 | MDT | A Metadata Target is a SCSI LUN that stores | 154 | | file metadata | 155 | | | 156 | MDS | A Metadata Sever implements the Lustre | 157 | | metadata server control protocol | 158 | | | 159 | MDC | A Metadata Client of Lustre protocol services | 160 | | | 161 | PTLRPC | The Portal RPC subsystem is a reliable | 162 | | messaging service layered on top of LNET. It | 163 | | caters for small messages and also for bulk | 164 | | data transfers. | 165 | | | 166 | LNET | LNET is the Lustre Networking sub-system. It | 167 | | hides differences of underlying network types | 168 | | and provides common APIs to LNET users. | 169 +-----------------+------------------------------------------------+ 171 1.3. Lustre Protocol Description 173 Lustre is an object-based file system. It is composed of three 174 components: Metadata servers (MDSs), object storage servers (OSSs), 175 and Lustre clients. 177 Lustre uses block devices (SCSI LUNs) for file data storage (OST) 178 and metadata storages (MDT) and each block device can be managed by 179 only one Lustre server (OSS). The total data capacity of the Lustre 180 filesystem is the sum of all individual OST capacities. Lustre 181 clients access and concurrently use data through the standard POSIX 182 I/O system calls. 184 A Lustre MDS provides metadata services. One Lustre MDS manages one 185 metadata target (MDT). Each MDT stores file metadata, such as file 186 names, directory structures, and access permissions. An OSS exposes 187 block devices and serves data. Each OSS manages one or more object 188 storage targets (OSTs), and OSTs store file data "objects". 190 The Lustre protocol specifies several operations on objects, 191 including OPEN, READ, WRITE, GET ATTRIBUTES, SET ATTRIBUTES, CREATE, 192 and DELETE. However, using the Lustre layout the Lustre client only 193 uses the OPEN, READ, WRITE and GET ATTRIBUTES commands. The other 194 commands are only used by the Lustre server. 196 A Lustre file object's layout information is defined in the extended 197 attribute (EA) of the inode. Essentially, EA describes the mapping 198 between file object identifier and its corresponding OSTs. This 199 information is also known as striping. A Lustre-based layout for 200 pNFS includes object identifiers, capabilities that allow pNFS 201 clients to READ or WRITE those objects, and various parameters that 202 control how file data is striped across OSTs. 204 This document specifies the NFSv4.1 layout protocol and operations 205 for Lustre filesystems ([1]). 207 2. Conventions Used in this Document 209 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 210 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 211 document are to be interpreted as described in RFC-2119 [6]. 213 3. XDR Description of the Lustre-Based Layout Protocol 215 This document contains the external data representation (XDR [2]) 216 description of the NFSv4.1 objects layout protocol. The XDR 217 description is embedded in this document in a way that makes it 218 simple for the reader to extract into a ready-to-compile form. The 219 reader can feed this document into the following shell script to 220 produce the machine readable XDR description of the NFSv4.1 Lustre 221 layout protocol: 223 #!/bin/sh 224 grep '^ *///' $* | sed 's?^ */// ??' | sed 's?^ *///$??' 226 That is, if the above script is stored in a file called 227 "extract.sh", and this document is in a file called "spec.txt", then 228 the reader can do: 230 sh extract.sh < spec.txt > pnfs_lustre_prot.x 232 The effect of the script is to remove leading white space from each 233 line, plus a sentinel sequence of "///". 235 The embedded XDR file header follows. Subsequent XDR descriptions, 236 with the sentinel sequence are embedded throughout the document. 238 Note that the XDR code contained in this document depends on types 239 from the NFSv4.1 nfs4_prot.x file ([3]). This includes both nfs 240 types that end with a 4, such as offset4, length4, etc., as well as 241 more generic types such as uint32_t and uint64_t. 243 3.1. Code Components Licensing Notice 245 The XDR description, marked with lines beginning with the sequence 246 "///", as well as scripts for extracting the XDR description are 247 Code Components as described in Section 4 of "Legal Provisions 248 Relating to IETF Documents" [4]. These Code Components are licensed 249 according to the terms of Section 4 of "Legal Provisions Relating to 250 IETF Documents". 252 /// /* 253 /// * Copyright (c) 2012 IETF Trust and the persons identified 254 /// * as authors of the code. All rights reserved. 255 /// * 256 /// * Redistribution and use in source and binary forms, with 257 /// * or without modification, are permitted provided that the 258 /// * following conditions are met: 259 /// * 260 /// * o Redistributions of source code must retain the above 261 /// * copyright notice, this list of conditions and the 262 /// * following disclaimer. 263 /// * 264 /// * o Redistributions in binary form must reproduce the above 265 /// * copyright notice, this list of conditions and the 266 /// * following disclaimer in the documentation and/or other 267 /// * materials provided with the distribution. 269 /// * 270 /// * o Neither the name of Internet Society, IETF or IETF 271 /// * Trust, nor the names of specific contributors, may be 272 /// * used to endorse or promote products derived from this 273 /// * software without specific prior written permission. 274 /// * 275 /// * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 276 /// * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 277 /// * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 278 /// * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 279 /// * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 280 /// * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 281 /// * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 282 /// * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 283 /// * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 284 /// * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 285 /// * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 286 /// * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 287 /// * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 288 /// * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 289 /// * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 290 /// * 291 /// * Please reproduce this note if possible. 292 /// */ 293 /// 294 /// /* 295 /// * pnfs_lustre_prot.x 296 /// */ 297 /// 298 /// %#include 299 /// 301 4. Basic Data Type Definitions 303 The following sections define basic data types and constants used by 304 the Lustre Layout protocol. 306 4.1. pnfs_lov_magic 308 Lustre uses two magic numbers to identify different "lov_mds_md" 309 versions. 311 /// enum pnfs_lov_magic { 312 /// LOV_MAGIC_V1 = 0x0BD10BD0, /* to identify lov_mds_md_v1 */ 313 /// LOV_MAGIC_V3 = 0x0BD30BD0 /* to identify lov_mds_md_v3 */ 314 /// }; 316 "pnfs_lov_magic" is used to indicate the Lustre protocol MDS 317 metadata version. The magic number is used to identify the protocol 318 version and to detect the byte order of the request sent by the 319 client. 321 At this time, the Lustre protocol uses LOV_MAGIC_V1/3 to mark 322 different version of "lov_mds_md". The difference between 323 LOV_MAGIC_V1 and LOV_MAGIC_V3 is that LOV_MAGIC_V3 supports OST 324 pooling. 326 The OST pools feature allows the administrator to name a group of 327 OSTs for file striping purposes. For instance, a group of local OSTs 328 could be defined for faster access; a group of higher-performance 329 OSTs could be defined for specific applications; a group of non-RAID 330 OSTs could be defined for scratch files; or groups of OSTs could be 331 defined for particular users. 333 If OST pooling is configured, the server SHOULD return LOV_MAGIC_V3. 334 If OST pooling is not configured, the MDS server SHOULD return 335 LOV_MAGIC_V1. So the versioning is used just for feature matching. 337 Therefore, the Lustre protocol version is explicitly called out in 338 the information returned in the layout. (The format value is 339 0x0BD10BD0 for version V1 capability.) 341 4.2. pnfs_los_object_cred4 343 /// enum pnfs_los_cap_key_sec4 { 344 /// PNFS_OSS_CAP_KEY_SEC_NONE = 0, 345 /// PNFS_OSS_CAP_KEY_SEC_SSV = 1 346 /// }; 347 /// 348 /// typedef uint64_t pnfs_los_objid4; 349 /// 350 /// struct pnfs_los_object_cred4 { 351 /// pnfs_los_objid4 ploc_object_id; 352 /// pnfs_los_cap_key_sec4 ploc_cap_key_sec; 353 /// opaque ploc_capability_key<>; 354 /// opaque ploc_capability<>; 355 /// }; 356 /// 357 Lustre PTLRPC supports GSS authentication. PTLRPC implements Lustre 358 communications over LNET ([1]). So "pnfs_los_object_cred4" is put 359 inside pnfs_los_layout4 so that if the network requires security, 360 credentials can be passed around. 362 The pnfs_los_object_cred4 structure is used to identify each 363 component comprising the file. The "ploc_object_id" identifies the 364 component object, the "ploc_capability_key" provide the OSS security 365 credentials needed to access that object. The "ploc_cap_key_sec" 366 value denotes the method used to secure the "ploc_capability_key". 368 To comply with the Lustre security requirements, the capability key 369 SHOULD be transferred securely to prevent eavesdropping. Therefore, 370 a client SHOULD either issue the LAYOUTGET or GETDEVICEINFO 371 operations via RPCSEC_GSS with the privacy service or previously 372 establish a secret state verifier (SSV) for the sessions via the 373 NFSv4.1 SET_SSV operation. The pnfs_los_cap_key_sec4 type is used to 374 identify the method used by the server to secure the capability key. 376 o PNFS_OSS_CAP_KEY_SEC_NONE denotes that the "ploc_capability_key" 377 is not encrypted, in which case the client SHOULD issue the 378 LAYOUTGET or GETDEVICEINFO operations with RPCSEC_GSS with the 379 privacy service or the NFSv4.1 transport should be secured by 380 using methods that are external to NFSv4.1 like the use of IPsec 381 ([5]) for transporting the NFSV4.1 protocol. 383 o PNFS_OSS_CAP_KEY_SEC_SSV denotes that the "ploc_capability_key" 384 contents are encrypted using the SSV GSS context and the 385 capability key as inputs to the GSS_Wrap() function (see GSS-API 386 [7]) with the conf_req_flag set to TRUE. The client MUST use the 387 secret SSV key as part of the client's GSS context to decrypt the 388 capability key using the value of the lc_capability_key field as 389 the input_message to the GSS_unwrap() function. Note that to 390 prevent eavesdropping of the SSV key, the client SHOULD issue 391 SET_SSV via RPCSEC_GSS with the privacy service. 393 The actual method chosen depends on whether the client established a 394 SSV key with the server and whether it issued the operation with the 395 RPCSEC_GSS privacy method. Naturally, if the client did not 396 establish an SSV key via SET_SSV, the server MUST use the 397 PNFS_OSS_CAP_KEY_SEC_NONE method. Otherwise, if the operation was 398 not issued with the RPCSEC_GSS privacy method, the server SHOULD 399 secure the "ploc_capability_key" with the PNFS_OSS_CAP_KEY_SEC_SSV 400 method. The server MAY use the PNFS_OSS_CAP_KEY_SEC_SSV method also 401 when the operation was issued with the RPCSEC_GSS privacy method. 403 4.3. Data Stripping Algorithms 405 Currently only RAID0 is supported but Lustre defines RAID1 as well. 407 /// const LOV_PATTERN_RAID0 = 0x001 408 /// /* stripes are used round-robin */ 409 /// const LOV_PATTERN_RAID1 = 0x002 410 /// /* stripes are mirrors of each other */ 412 5. Object Storage Server Addressing and Discovery 414 Data operations to an OSS require the client to know the "address" 415 of each OSS's root object. The OSS exposes block devices and serves 416 data. Correspondingly, OSC is client of the services. Each OSS 417 manages one or more OSTs, and OSTs store file data objects. Because 418 these representations are local, GETDEVICEINFO must return 419 information that can be used by the client to select the correct 420 local representation. 422 5.1. pnfs_los_targetid_type4 424 The following enum specifies the manner in which an OST can be 425 specified. The target can be specified by the network access 426 protocol type used. 428 /// enum pnfs_los_targetid_type4 { 429 /// LOS_TARGET_TCP = 1, 430 /// LOS_TARGET_IB = 2 431 /// }; 433 Where: 434 o LOS_TARGET_TCP denotes use of the TCP protocol 436 o LOS_TARGET_IB denotes use of the IB protocol 438 Only TCP and IB are defined because these are the two most widely 439 used networks in High Performance Computing deployments. 441 5.2. pnfs_los_deviceaddr4 443 The specification (according to [9]) for an object device address is 444 as follows: 446 /// struct pnfs_los_deviceaddr4 { 447 /// netaddr4 lda_targetid; 448 /// opaque lda_ossname<>; 449 /// }; 451 5.2.1. OSS Target Identifier 453 When "lda_targetid" is specified the opaque field MUST be formatted 454 as the LOS name. 456 5.2.2. Device Network Address 458 The network address is given with the netaddr4 type, which specifies 459 a TCP/IP or IB based endpoint (as specified in NFSv4.1 [3]). When 460 given, the client SHOULD use it to probe for the OSS device at the 461 given network address. The client MAY still use other discovery 462 mechanisms to locate the device using the "lda_targetid". In 463 particular, an external name service (external to data protocol 464 coming from LNET) SHOULD be used when the devices may be attached to 465 the network using multiple connections, and/or multiple storage 466 fabrics (e.g., TCP or IB). 468 6. Lustre-Based Layout 470 The layout4 type is defined in the NFSv4.1 ([3]) as follows: 472 enum layouttype4 { 473 LAYOUT4_NFSV4_1_FILES= 0x1, 474 LAYOUT4_OSD2_OBJECTS = 0x2, 475 LAYOUT4_BLOCK_VOLUME = 0x3, 476 LAYOUT4_OSS_OBJECTS = 0x0BD30BD4 /* Tentatively */ 477 }; 479 struct layout_content4 { 480 layouttype4 loc_type; 481 opaque loc_body<>; 482 }; 484 struct layout4 { 485 offset4 lo_offset; 486 length4 lo_length; 487 layoutiomode4 lo_iomode; 488 layout_content4 lo_content; 489 }; 490 This document defines structure associated with the layouttype4 491 value, LAYOUT4_OSS_OBJECTS. The NFSv4.1 ([3]) specifies the 492 loc_body structure as an XDR type "opaque". The opaque layout is 493 uninterpreted by the generic pNFS client layers, but obviously must 494 be interpreted by the Lustre storage layout driver. This section 495 defines the structure of this opaque value, "pnfs_oss_layout4". 497 6.1. pnfs_lov_mds_md 499 These are the key file mapping data structures. "pnfs_lov_ost_data" 500 is per-stripe data structure. "lov_mds_md" is per file data 501 structure. The difference between v1 and v3 is that, v3 supports OST 502 pooling. 504 /// struct pnfs_lov_ost_data4 { /* per-stripe data structure */ 505 /// uint64_t l_object_id; /* OST object ID */ 506 /// uint64_t l_object_seq; /* OST object seq number */ 507 /// uint32_t l_ost_gen; 508 /// /* generation of this l_ost_idx */ 509 /// uint32_t l_ost_idx; 510 /// /* OST index in LOV (lov_tgt_desc->tgts) */ 511 /// }; 512 /// 513 /// struct pnfs_lov_mds_md_v1 { /* LOV EA mds/wire data */ 514 /// uint32_t lmm_pattern; 515 /// /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */ 516 /// uint64_t lmm_object_id; /* LOV object ID */ 517 /// uint64_t lmm_object_seq;/* LOV object seq number */ 518 /// uint32_t lmm_stripe_size; /* size of stripe in bytes */ 519 /// uint16_t lmm_stripe_count; 520 /// /* num stripes in use for this object */ 521 /// uint16_t lmm_layout_gen; /* layout generation number */ 522 /// 523 /// pnfs_lov_ost_data4 lmm_objects[0]; /* per-stripe data */ 524 /// }; 525 /// 526 /// #define LOV_MAXPOOLNAME 16 527 /// 528 /// struct pnfs_lov_mds_md_v3 { /* LOV EA mds/wire data */ 529 /// uint32_t lmm_pattern; 530 /// /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */ 531 /// uint64_t lmm_object_id; /* LOV object ID */ 532 /// uint64_t lmm_object_seq; /* LOV object seq number */ 533 /// uint32_t lmm_stripe_size; /* size of stripe in bytes */ 534 /// uint16_t lmm_stripe_count; 535 /// /* num stripes in use for this object */ 536 /// uint16_t lmm_layout_gen; /* layout generation number */ 537 /// char lmm_pool_name[LOV_MAXPOOLNAME]; 538 /// /* must be 32bit aligned */ 539 /// pnfs_lov_ost_data4 lmm_objects[0]; /*per-stripe data*/ 540 /// }; 541 /// 542 /// union pnfs_lov_mds_md switch (pnfs_lov_magic lmm_magic) { 543 /// case LOV_MAGIC_V1: 544 /// pnfs_lov_mds_md_v1 mds_md1; 545 /// case LOV_MAGIC_V3: 546 /// pnfs_lov_mds_md_v3 mds_md3; 547 /// default: 548 /// void; 549 /// }; 550 /// 552 The pnfs_"pnfs_lov_ost_data4" structure parameterizes the algorithm 553 that maps a file's contents over the component OST's. 555 The "pnfs_lov_ost_data4" is a per stripe data structure that defines 556 the location of the stripe in OST and which OST holds the data. 558 "l_object_id" holds the file data's object ID on the OST. 559 "l_object_seq" holds the object sequence number which is always 0. 560 "l_ost_idx" holds the OST's index in LOV, and "l_ost_gen" holds the 561 OST's index generation. 563 The "lmm_magic" specifies the format of the returned stripping 564 information. LOV_MAGIC_V1 is used for pnfs_lov_mds_md_v1, and 565 LOV_MAGIC_V3 is used for "pnfs_lov_mds_md_v3". 567 "mds_md1" and "mds_md3" holds the file's detailed stripping 568 information. The two data structure share most fields while 569 "mds_md3" has OST pooling field "lmm_pool_name". When "lmm_magic" is 570 LOV_MAGIC_V3, OST pool name MUST be specified in "lmm_pool_name" 571 filed by MDS, with a pool name at most LOV_MAXPOOLNAME bytes. 573 The "lmm_pattern" holds the file's stripping pattern. It can be 574 either LOV_PATTERN_RAID0 or LOV_PATTERN_RAID1. "lmm_object_id" holds 575 the MDS object ID. "lmm_object_seq" holds the LOV object sequence 576 number. 578 "lmm_stripe_size" holds the stripe size in bytes. A file is striped 579 across multiple OSTs in the same stripe size. The "lmm_stripe_count" 580 holds the number of OSTs over which the file is striped. 582 "llm_layout_gen" holds the generation of current layout information. 583 Clients need to obtain layout generation before IO and check layout 584 generation after IO. If layout generation is changed, client needs 585 to redo the operations. 587 The "lmm_objects" is an array of "lmm_stripe_count" members 588 containing per OST file information. Each element is in form of 589 struct "pnfs_lov_ost_data". 591 6.2. pnfs_los_layout4 593 The following is the opaque data in generic layout. 595 /// struct pnfs_los_layout4 { 596 /// pnfs_lov_magic lmm_magic; 597 /// pnfs_lov_mds_md lov_mds_md; 598 /// pnfs_los_object_cred4 llo_component; 599 /// }; 600 /// 602 pnfs_lov_magic and lov_mds_md are defined as above [section 6.1]. 604 The "llo_component" is of type "pnfs_los_object_cred4", containing 605 credentials that Lustre client needs to use to connect to OSS's. 607 Note that the layout depends on the file size, which the client 608 learns, by doing GETATTR commands to the pNFS metadata server. 610 The pNFS client uses the file size to decide if it should return a 611 short read of the file when trying to read beyond the file size. 613 6.3. Data Mapping Schemes 615 This section describes the different data mapping schemes in detail. 616 The Lustre layout always uses a "dense" layout as described in 617 NFSv4.1 ([3]). This means that the second stripe unit of the file 618 starts at offset 0 of the second component, rather than at offset 619 stripe_unit bytes. After a full stripe has been written, the next 620 stripe unit is appended to the first component object in the list 621 without any holes in the component objects. From the MDS point of 622 view, each file is composed of multiple data objects striped on one 623 or more OSTs. 625 6.3.1. Simple Striping 627 A file object's layout information is defined in the extended 628 attribute (EA) of the inode. Essentially, EA describes the mapping 629 between file object id and its corresponding OSTs. 631 For example, if file A has a stripe count of three, then its EA will 632 look like: 634 EA ---> 635 636 637 stripe size and stripe width 639 In the above equation obj_id is the object identifier of a file 640 fragment on the ost p, "stripe size" is the size of each file 641 segment on one OST and "stripe width" is the number of OST's used. 642 So if the "stripe size" is 1MB, and the "stripe width" is 3, then 643 this would mean that: [0,1M), [4M,5M), ... are stored as object x, 644 which is on OST p; [1M, 2M), [5M, 6M), ... are stored as object y, 645 which is on OST q; [2M,3M), [6M, 7M), ... are stored as object z, 646 which is on OST r. 648 Before reading the file, the pNFS client will query the pNFS MDS and 649 be informed that it should talk to for this 650 operation. This information is structured in so-called LSM, and 651 Lustre client side LOV (logical object volume) is to interpret this 652 information so Lustre client can send requests to OSTs. Here again, 653 the Lustre client communicates with OST through a client module 654 interface known as OSC. Depending on the context, OSC can also be 655 used to refer to an OSS client by itself. 657 The mapping from the logical offset within a file (L) to the 658 component object C and object-specific offset O is defined by the 659 following equations: 661 L = logical offset into the file 662 W = stripe width 663 S = stripe size 664 C = (L-L%S)%W 665 O = L/W/S+L%S 667 In these equations, S is the number of bytes in a full stripe or 668 stripe size. C is an index into the array of components, so it 669 selects a particular OST device. C count starts from zero. O is the 670 offset within the OST that corresponds to the file offset. Note that 671 this computation does accommodate the fact that an object includes 672 all the file segments that are located on same OST. 674 For example, consider an object striped over three devices, 675 . The stripe size is 1024KB. The stripe width W is 676 thus 3. 678 Offset 0KB: 679 C = (0-0%1)%3 = 0 (OST0) 680 O = 0/3/1024 + (0%1024) = 0 682 Offset 1024KB: 683 C = (1024-(1024%1024))%3 = 1 (OST1) 684 O = 1024/3/1024 +(1024%1024) = 0 686 Offset 9000KB: 687 C = (9000-(9000%1024))%3 = 2 (OST2) 688 O = 9000/3/1024 + (9000%1024) = 810 690 Offset 102400KB: 691 C = (102400-(102400%1024))%3 = 1 (OST0) 692 O = 102400/3/1024 + (102400%4096) = 33 694 6.4. RAID Algorithms 696 This section defines the different redundancy algorithms. Note: The 697 term "RAID" (Redundant Array of Independent Disks) is used in this 698 document to represent an array of component OST's that store data 699 for an individual file. The objects are stored on independent OST- 700 based storage devices. File data is encoded and striped across the 701 array of component OST's using algorithms developed for block-based 702 RAID systems. 704 6.4.1. PNFS_OST_RAID_0 706 PNFS_OST_RAID_0 means there is no parity data, so all bytes in the 707 component objects are data bytes located by the above equations for 708 C and O. 710 6.4.2. PNFS_OST_RAID_1 712 PNFS_OST_RAID_1 means there is no parity data, but each OST is 713 mirrored to another OST. In this case the component objects are data 714 bytes still located by the above equations for C and O, defined in 715 section 6.3.1. 717 7. Lustre-Based Creation Layout Hint 719 The layouthint4 type is defined in the NFSv4.1 ([3]) as follows: 721 struct layouthint4 { 722 layouttype4 loh_type; 723 opaque loh_body<>; 724 }; 726 The "layouthint4" structure is used by the client to pass a hint 727 about the type of layout it would like to be created for a 728 particular file. If the "loh_type" layout type is 729 LAYOUT4_OSS_OBJECTS, then the "loh_body" opaque value is defined by 730 the "pnfs_oss_layouthint4" type. 732 7.1. pnfs_los_layouthint4 734 /// union pnfs_lov_stripe_count_hint4 switch (bool lsc_valid) { 735 /// case TRUE: 736 /// uint32_t lsc_stripe_count; 737 /// case FALSE: 738 /// void; 739 /// }; 740 /// 741 /// union pnfs_lov_stripe_size_hint4 switch (bool lss_valid) { 742 /// case TRUE: 743 /// uint32_t lss_stripe_size; 744 /// case FALSE: 745 /// void; 746 /// }; 747 /// 748 /// union pnfs_lov_stripe_offset_hint4 switch (bool lso_valid) { 749 /// case TRUE: 750 /// uint32_t lso_stripe_offset; 751 /// case FALSE: 752 /// void; 753 /// }; 754 /// 755 /// union pnfs_lov_stripe_pattern_hint4 switch (bool lsp_valid) { 756 /// case TRUE: 757 /// uint32_t lsp_stripe_pattern; 758 /// case FALSE: 759 /// void; 760 /// }; 761 /// 762 /// union pnfs_lov_pool_hint4 switch (bool lp_valid) { 763 /// case TRUE: 764 /// string lp_pool_name<>; 765 /// case FALSE: 766 /// void; 767 /// }; 768 /// 769 /// struct pnfs_los_layouthint4 { 770 /// pnfs_lov_stripe_count_hint4 lov_stripe_count_hint; 771 /// pnfs_lov_stripe_size_hint4 lov_stripe_size_hint; 772 /// pnfs_lov_stripe_offset_hint4 lov_stripe_offset_hint; 773 /// pnfs_lov_stripe_pattern_hint4 lov_stripe_pattern_hint; 774 /// pnfs_lov_pool_hint4 lov_pool_hint; 775 /// }; 776 /// 778 "pnfs_los_layouthint4" conveys hints for the desired data map. Hints 779 are indications of the client for preferences of the data stripe 780 type to be used for the file. All parameters are optional so the 781 client can give values for only the parameters it cares about. 783 "lov_stripe_count_hint", "lov_stripe_size_hint", 784 "lov_stripe_offset_hint" and "lov_stripe_pattern_hint" tells server 785 that client wants to create a file with corresponding stripe count, 786 stripe size, stripe offset and stripe pattern. "lov_pool_hint" tells 787 server that client wants to create a file within specific OST pool. 789 The server should make an attempt to honor the hints, but it can 790 ignore any or all of them at its own discretion and without failing 791 the respective CREATE operation. 793 8. IANA Considerations 795 As described in NFSv4.1 ([8]), new layout type numbers have been 796 assigned by IANA. This document defines the protocol associated 797 with a new layout type number, LAYOUT4_OSS_OBJECTS, and it requires 798 to be assigned a new value from IANA. 800 9. References 802 9.1. Normative References 804 [1] http://www.scribd.com/doc/59271212/Understanding-Lustre- 805 File-System-Internals 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 This document was prepared using 2-Word-v2.0.template.dot. 838 Authors' Addresses 840 Sorin Faibish (editor) 841 EMC Corporation 842 228 South Street 843 Hopkinton, MA 01748 844 US 846 Phone: +1 (508) 249-5745 847 Email: sfaibish@emc.com 849 Peng Tao 850 EMC Corporation 851 8F, Block D, SP Tower 852 Tsinghua Science Park 853 Zhongguancun Dong Road 854 Beijing 100084 855 PRC 857 Phone: +86 (10) 8215 8293 858 Email: tao.peng@emc.com